function sendAjax(typeVar,jaxData,jaxurl,jaxspinControlID,jaxspinNormalString){
    alert(jaxData);
    $.ajax({
	        type:typeVar,url:jaxurl,data:jaxData
	        ,cache:false,
	        beforeSend:function(){
	        	//$('#viewclass').prop('disabled', true);
	        	//$("'#"+jaxspinControlID+"'").html('<span id="spinoff" class="glyphicon"></span>Loading....');

$("#spinoff").addClass("glyphicon-refresh glyphicon-refresh-animate");
//$("#viewclass").disable(true);

		        },
	        success:function(response){
		        //alert(response);
	return response;
	            },
	            complete:function(){
	            	$("'#"+"'"+jaxspinControlID+"'").html(jaxspinNormalString);
	            	$("#spinoff").removeClass("glyphicon-refresh glyphicon-refresh-animate");
	            	//$("#viewclass").disable(false);
		            }

	        });//end of ajax call

}

function get_Wardlist(){
    var jaxData="globeVar=0";
     $.ajax({
	        type:"POST",url:"wardlist.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#wardlist").html(response);
    $("#target").html(response);

	            }

	        });//end of ajax call

}

function get_Vatlist(){
    var jaxData="globeVar=1";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#tax").html(response);
    $("#vat").html(response);
    $("#edit_tax").html(response);

	            }

	        });//end of ajax call

}


function get_Itemlist(){
    var jaxData="globeVar=2";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#itemstable").html(response);

	            }

	        });//end of ajax call

}




function get_locations(){
    var jaxData="globeVar=21";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#locations").html(response);
    $(".locations").html(response);
	            }

	        });//end of ajax call

}


function get_user_level(){
    var jaxData="globeVar=72";
    var user_level="";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
            user_level=response;
		        //alert(response);
	            }

	        });//end of ajax call
return user_level;
}





function get_userlevels(){
    var jaxData="globeVar=71";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#userlevel").html(response);
      $(".userlevel").html(response);
    $("#edit_user_level").html(response);
	            }

	        });//end of ajax call

}






function get_shiftlist(){
    var jaxData="globeVar=36";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#shift").html(response);
    //$(".locations").html(response);
	            }

	        });//end of ajax call

}




function get_CompanyDatatable(){
    var jaxData="globeVar=35";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#receipt_header").html(response);
	            }

	        });//end of ajax call

}


function getCompanyDatatable(branchid){
    var jaxData="globeVar=35";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#receipt_header").html(response);
	            }

	        });//end of ajax call

}




function get_expensenames(){
    var jaxData="globeVar=26";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#expense").html(response);

	            }

	        });//end of ajax call

}







function get_Rawlist(){
    var jaxData="globeVar=3";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#rawtable").html(response);

	            }

	        });//end of ajax call

}

function get_CustomerList(){

  var jaxData="globeVar=4";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#custable").html(response);

            }

        });//end of ajax call


}


function get_BranchList(){

  var jaxData="globeVar=31";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#branches").html(response);
  $("#edit_branches").html(response);


            }

        });//end of ajax call


}



function get_loginusersList(){

  var jaxData="globeVar=30";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#usertable").html(response);

            }

        });//end of ajax call


}



function get_expenseList(){

  var jaxData="globeVar=25";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#expenselist").html(response);

            }

        });//end of ajax call


}

function get_bankaccList(){

  var jaxData="globeVar=27";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#accountslist").html(response);

            }

        });//end of ajax call


}




function get_SupplierList(){

  var jaxData="globeVar=5";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#suptable").html(response);

            }

        });//end of ajax call


}

function get_usersList(){

  var jaxData="globeVar=22";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#usertable").html(response);

            }

        });//end of ajax call


}

function get_usersoptionList(){

  var jaxData="globeVar=23";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#staffname").html(response);

            }

        });//end of ajax call


}


function bankAccount_Options(){

  var jaxData="globeVar=28";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#bankaccname").html(response);

            }

        });//end of ajax call


}







function get_ItemsOptons(){
	var jaxData="globeVar=6";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#itemname").html(response);

            }

        });//end of ajax call

}


function get_rawItemsOptons(){
	var jaxData="globeVar=19";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#itemname").html(response);

            }

        });//end of ajax call

}



function get_RawItemsOptons(){
	var jaxData="globeVar=17";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#rawitemname").html(response);

            }

        });//end of ajax call

}



function get_ItemsOptons(){
	var jaxData="globeVar=6";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#itemname").html(response);

            }

        });//end of ajax call

}


function get_paymodeOptons(){
	var jaxData="globeVar=13";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#paymode").html(response);

            }

        });//end of ajax call

}

function get_CustomerOptions(){
	var jaxData="globeVar=15";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#customer").html(response);

            }

        });//end of ajax call

}





function get_SupplierOptons(){
	var jaxData="globeVar=8";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#supplier").html(response);

            }

        });//end of ajax call

}

function get_CompanyData(){
	var jaxData="globeVar=32";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);

          var resp=jQuery.parseJSON(response);
          var status=resp.status;
             var CompanyName=resp.CompanyName;
             var Address=resp.Address;
              var emailAddr=resp.emailAddr;
               var PinNo=resp.PinNo;
                var TelNo=resp.TelNo;

  if(status=="success"){
    //alert(status);
    $("#company").val(CompanyName);
    $("#address").val(Address);
    $("#email").val(emailAddr);
    $("#pinno").val(PinNo);
    $("#tel").val(TelNo);

  }

            }

        });//end of ajax call

}


function get_supplierBal(supplierID){
var jaxData="globeVar=29&varID="+supplierID;
var itemCost=0;
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
   //alert(jaxData);
      itemCost=response;
  $("#balance").val(itemCost);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}


function get_customerBal(customerID){
var jaxData="globeVar=33&varID="+customerID;
var itemCost=0;
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
   //alert(jaxData);
      itemCost=response;
  $("#balance").val(itemCost);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}

function get_itemName(itemCode){
var jaxData="globeVar=38&varID="+itemCode;
var itemName="";
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
   //alert(jaxData);
      itemName=response;
  $("#itemname").val(itemName);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}


function get_rawitemName(itemCode){
var jaxData="globeVar=37&varID="+itemCode;
var itemName="";
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
   //alert(jaxData);
      itemName=response;
  $("#itemname").val(itemName);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}

function customer_invoices(customerID){
var jaxData="globeVar=44&varID="+customerID;
var itemName="";
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
  // alert(response);
      //itemName=response;
  $("#alloctable").html(response);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}

function supplier_invoices(supplierID){
var jaxData="globeVar=45&varID="+supplierID;
var itemName="";
$.ajax({
     type:"POST",url:"listcats.php",data:jaxData
     ,cache:false,
     success:function(response){
   //alert(response);
      //itemName=response;
  $("#alloctable").html(response);
//alert(response);
         }

     });//end of ajax call
//return itemCost;
}

function load_Rightslist(userLevel){
    var jaxData="globeVar=46&varID="+userLevel;
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        //alert(response);
                        // alert(response);
    $("#accesstable").html(response);

	            }

	        });//end of ajax call

}

function check_Allow_Deny(accessCode){
  //alert(accessCode);
  var jaxData="globeVar=51&varID="+accessCode;
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
        var jsonreply=jQuery.parseJSON(response);
        //alert(response);
        var status=jsonreply.status;
        var msg=jsonreply.msg;
         if(status=="success"){
//alert("allowed");
         }else{
//alert("Denied");
             var ErrorStr="<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'>×</button><strong>Error!</strong>"+msg+".</div>";
           $("#content_zone").html(ErrorStr);
         }
          //alert(response);
                      // alert(response);
            }

        });//end of ajax call
}

function get_patients(){
    var jaxData="globeVar=62";
     $.ajax({
	        type:"POST",url:"listcats.php",data:jaxData
	        ,cache:false,
	        success:function(response){
		        alert(response);
                        // alert(response);
  //  $("#locations").html(response);
    $(".patients").html(response);
	            }

	        });//end of ajax call

}

function get_tank_options(){

  var jaxData="globeVar=77";
   $.ajax({
        type:"POST",url:"listcats.php",data:jaxData
        ,cache:false,
        success:function(response){
          //alert(response);
                      // alert(response);
  $("#tank_names").html(response);

            }

        });//end of ajax call


}
