var conversationreport_obj 	= null ;

var C_FILTER_CONVERSATION_REPORT = "741";

function filterConversationReport() {
	LoadingScreen("show");
	var data = { 
				"type"			: C_FILTER_CONVERSATION_REPORT,
				"company_name"	: $('#txtConversationReportCustomerNameFilter').val(),
				"contact_name"	: $('#txtConversationReportContactNameFilter').val(),
				"conv_date_from": $('#txtConversationReportConvDateFromFilter').val(),
				"conv_date_to"	: $('#txtConversationReportConvDateToFilter').val(),
				"next_date_from": $('#txtConversationReportNextDateFromFilter').val(),
				"next_date_to"	: $('#txtConversationReportNextDateToFilter').val(),
				"assign_to"		: $('#txtConversationReportNextAssignToFilter').val(),
			};
	var url  = "request.pzx?c=" + conversation_report_url + "&d=" + new Date().getTime() ;
	callServer(url,"json",data,onConversationReportResponse,null) ;
	return false;
}

//=====================================
            
function onConversationReportResponse(obj,resp) {
	LoadingScreen("hide");
    if (resp.status != C_OK) {
		swal.fire("Warning", resp.mesg, "warning")
        return false;
    }

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



