var uniqueEmployeesDetailsArray_GlobalVar=[];
$(document).ready(function(){


 /*---------------------------------------------------*/
 /*search  unique Empid to download excel individually*/
 /*---------------------------------------------------*/
 if(checkWheatherLogoutOrNot_InternetConnection()){
       fetch_emp_id(); //function call
 }else{
     alertNoInternet_connection();
 }
        function fetch_emp_id() {
            $.ajax({
                url: "php/fetchEmpId.php",
                method: "POST",
                dataType: "JSON",
                success: function (data) //"data"  contains values from fetch.php
                {
                    var resltArrayLength = data.length;
                   // console.log(resltArrayLength);
                    if (resltArrayLength > 0) {
                        for (var i = 0; i < resltArrayLength; i++) {
                            var uniqEmpId = data[i].empId;
                            var strngarray = "<option>" + uniqEmpId + "</option>";
                            $('#unique_emp_ids').append(strngarray);
                            $('#search_unique_emp_ids').append(strngarray);// excel
							
							uniqueEmployeesDetailsArray_GlobalVar.push(data[i].empId);
                        }
                    }
                },
				statusCode: {
    			    404: function(){
    			        alert("requesting file(fetchEmpId.php) does not exists! in server");
    			    }
    			},
    			error: function (jqXHR, textStatus, errorThrown) {
    			    console.log("ajax error on requesting fetchEmpId file");
    			}
            });
        }
 /*---------------------------------------------------*/

});



// ;;