var customercontactlisting_obj 	= null ;

var C_FILTER_CUSTOMER_CONTACT_LISTING = "601";

function filterCustomerContactListing() {
	LoadingScreen("show");
	var data = { 
				"type"				: C_FILTER_CUSTOMER_CONTACT_LISTING,
				"company_code"		: $('#txtCustomerContactListingCustomerCodeFilter').val(),
				"company_name"		: $('#txtCustomerContactListingCustomerNameFilter').val(),
				"software"			: $('#cobCustomerContactListingSoftwareFilter').val(),
				"customer_status"	: $('#cobCustomerContactListingCustomerStatusFilter').val(),
				"contact_name"		: $('#txtCustomerContactListingContactNameFilter').val(),
				"contact_status"	: $('#cobCustomerContactListingContactStatusFilter').val(),
			};

	var url  = "request.pzx?c=" + customercontactlisting_url + "&d=" + new Date().getTime() ;
	callServer(url,"json",data,onCustomerContactListingResponse,null) ;
	return false;
}

//=====================================
            
function onCustomerContactListingResponse(obj,resp) {
	LoadingScreen("hide");

    if (resp.status != C_OK) {
		swal.fire("Warning", resp.mesg, "warning")
        return false;
    }

    if(resp.type == C_FILTER_CUSTOMER_CONTACT_LISTING) {
       	$('#customercontactlisting-table').html('');
	   	$('#customercontactlisting-table').html(resp.data);
	   	filterRow('customercontactlisting-row-filter',this,false);
    } 
}
