File: /home/cafsindia/crm_cafsindia_com/application/views/CrmHealthDashboard.php
<?php
if($emp_health_onchange==="1")
{
$emp_id = $emp_health_empid;
$emp_cat = $emp_health_cat;
$emp_role = $emp_health_role;
$today = new DateTime();
$lastDay = new DateTime('last day of this month');
$DaysRemaining = $lastDay->diff($today)->format('%a days');
$first_day = date("Y-m-01");
$last_day = date("t");
$today = date("Y-m-d");
$yesterday = date("Y-m-d",strtotime("-1 days"));
$tmrw = new DateTime('tomorrow');
$tmrw = $tmrw->format('Y-m-d');
$cur_month = date("Y-m");
$cur_year = date("Y");
$datestring= "$today first day of last month";
$dt=date_create($datestring);
$last_month = $dt->format('Y-m');
$april_month = date("Y-04");
//Get Financial Year
$year = date('Y');
$year1 = date('Y')-1;
$year2 = date('Y')+1;
if (date('m') > 03){
$fin_start_month = $year."-"."04"."-"."01";
$fin_end_month = $year2."-"."03"."-"."31";
$m = date("m");
$mth = $m - 1 ;
$lst_mth = $mth - 3;
}else{
$fin_start_month = $year1."-"."04"."-"."01";
$fin_end_month = $year."-"."03"."-"."31";
$m = date("m");
$lst_mth = $m + 9 ;
}
//Last 30 days
$thirty_days = date('Y-m-d', strtotime('today - 30 days'));
//Last Month End Date
$dd = $endLastMonth = mktime(0, 0, 0, date("m"), 0, date("Y"));
$last_month_endDate = date("Y-m-d", $dd);
}
$qry = $this->db->query("SELECT login_date FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where prospect_level='4' and ospos_lead_type_info.category = '3' and ospos_leads_product.status = '1' and ospos_lead_type_info.created_by = '$emp_id' and category='3' order by login_date desc limit 0,1");
$result = $qry->result_array();
$login_date = $result[0]['login_date'];
if($login_date === ""){
$login_date =date('Y-m-01');
}
$now = time();
$your_date = strtotime($login_date);
$datediff = $now - $your_date;
$Zero_days = (floor($datediff / (60 * 60 * 24)))-1;
//Zero Days in a month- crmbox - 1
$zero_in_month = $this->db->query("SELECT count(distinct(login_date)) as login_date FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where prospect_level='4' and ospos_lead_type_info.category = '3' and ospos_leads_product.status = '1' and category='3' and ospos_lead_type_info.created_by = '$emp_id' and login_date BETWEEN '$first_day' and '$yesterday'"); //$first_day , $yesterday
$zero_in_month_result = $zero_in_month->result_array();
$month = (int)$zero_in_month_result[0]['login_date'];
$days = explode("-", $yesterday);
$days = (int)$days[2];
$zeromonth = $days - $month;
$zeroresult = $Zero_days;
//Self Met crmbox - 2
$self_qry=$this->db->query("SELECT IFNULL(sum(overall_net_premium),0) as value FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where prospect_level='4' and ospos_lead_type_info.category = '3' and ospos_leads_product.status = '1' and product_category='3' and ospos_lead_type_info.created_by = '$emp_id' and login_date like '$cur_month%'");
$self_result = $self_qry->result_array();
$self_value = round($self_result[0]['value']);
$crm_target_qry = $this->db->query("SELECT IFNULL(premium,0) as value FROM `ospos_target` where role = '$emp_role' and emp_id = '$emp_id' and category = '$emp_cat' and from_date like '$cur_month%' and to_date like '$cur_month%' ");
$crm_target_result = $crm_target_qry->result_array();
$crm_target = $crm_target_result[0]['value'];
if(!$crm_target){
$crm_target = 0;
}
//Con/Nop & value crmbox - 4
//echo "SELECT count(DISTINCT (lead_id)) as count FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.prospect_level = '4' and ospos_lead_type_info.category='3' and login_date like '$cur_month%'";
$crm_nop_qry = $this->db->query("SELECT count(DISTINCT (lead_id)) as count FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.prospect_level = '4' and ospos_lead_type_info.category='3' and login_date like '$cur_month%' and ospos_leads_product.status = '1' ");
$crm_nop_result = $crm_nop_qry->result_array();
$crm_nop = $crm_nop_result[0]['count'];
$avg_value = round($self_value / $crm_nop);
if(!$avg_value){
$avg_value = 0;
}
//Avg per month
$crm_avgmonth_qry = $this->db->query("SELECT count(*) as count,IFNULL(sum(overall_net_premium),0) as value FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where ospos_lead_type_info.created_by = '$emp_id' and login_date BETWEEN '$fin_start_month' and ospos_lead_type_info.category='3' and ospos_leads_product.status = '1' and '$fin_end_month%' ");
$crm_avgmonth_result = $crm_avgmonth_qry->result_array();
$crm_avgmonth = round($crm_avgmonth_result[0]['value']);
$crm_nop_qry = $this->db->query("SELECT count(*) as count FROM `ospos_lead_type_info` where ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.prospect_level = '4' and ospos_lead_type_info.category='3' and ncd BETWEEN '$fin_start_month' and '$fin_end_month%'");
$crm_nop_result = $crm_nop_qry->result_array();
$fy_crm_nop = $crm_nop_result[0]['count'];
$cr_lst_mth = $lst_mth -1;
$health_avg = round($crm_avgmonth / $cr_lst_mth);
/* Head box - END */
/*Leads - START */
// Today Count
$today_lead = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and ncd like '$today%' GROUP by prospect_level");
$today_lead_rslt = $today_lead->result_array();
$today_hot = "0 - 0";
$today_warm = "0 - 0";
$today_log = "0 - 0";
foreach ($today_lead_rslt as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$today_hot = "$count - $amount";
}else
if($statusname === "Warm"){
$today_warm = "$count - $amount";
}else
if($statusname === "Login"){
$today_log = "$count - $amount";
}
}
$today_lead_cr = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and created_date like '$today%' GROUP by prospect_level");
$today_lead_rslt_cr = $today_lead_cr->result_array();
$today_hot_cr = "0 - 0";
$today_warm_cr = "0 - 0";
$today_log_cr = "0 - 0";
foreach ($today_lead_rslt_cr as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$today_hot_cr = "$count - $amount";
}else
if($statusname === "Warm"){
$today_warm_cr = "$count - $amount";
}else
if($statusname === "Login"){
$today_log_cr = "$count - $amount";
}
}
// Tomorrow count
$tmrw_lead = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and ncd like '$tmrw%' GROUP by prospect_level");
$tmrw_lead_rslt = $tmrw_lead->result_array();
$tmrw_hot = "0 - 0";
$tmrw_warm = "0 - 0";
foreach ($tmrw_lead_rslt as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$tmrw_hot = "$count - $amount";
}else
if($statusname === "Warm"){
$tmrw_warm = "$count - $amount";
}
}
// Month count
$month_lead = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and ncd like '$cur_month%' GROUP by prospect_level");
$month_lead_rslt = $month_lead->result_array();
$month_hot = "0 - 0";
$month_warm = "0 - 0";
$month_log = "0 - 0";
foreach ($month_lead_rslt as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$month_hot = "$count - $amount";
}else
if($statusname === "Warm"){
$month_warm = "$count - $amount";
}else
if($statusname === "Login"){
$month_log = "$count - $amount";
}
}
$month_lead_cr = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and created_date like '$cur_month%' GROUP by prospect_level");
$month_lead_rslt_cr = $month_lead_cr->result_array();
$month_hot_cr = "0 - 0";
$month_warm_cr = "0 - 0";
$month_log_cr = "0 - 0";
foreach ($month_lead_rslt_cr as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$month_hot_cr = "$count - $amount";
}else
if($statusname === "Warm"){
$month_warm_cr = "$count - $amount";
}else
if($statusname === "Login"){
$month_log_cr = "$count - $amount";
}
}
$last_month_lead_cr = $this->db->query("SELECT count(*) as count,lead_status,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$emp_id' and ospos_lead_type_info.category='3' and created_date like '$last_month%' GROUP by prospect_level");
$last_month_lead_rslt_cr = $last_month_lead_cr->result_array();
$last_month_hot_cr = "0 - 0";
$last_month_warm_cr = "0 - 0";
$last_month_log_cr = "0 - 0";
foreach ($last_month_lead_rslt_cr as $key => $value) {
$count = $value['count'];
$amount = $value['amount'];
$statusname = $value['prospect_name'];
if($statusname === "Hot"){
$last_month_hot_cr = "$count - $amount";
}else
if($statusname === "Warm"){
$last_month_warm_cr = "$count - $amount";
}else
if($statusname === "Login"){
$last_month_log_cr = "$count - $amount";
}
}
/*Leads - END */
/*Issuance Status - START*/
$issuance = $this->db->query("SELECT count(DISTINCT(lead_id)) as count,IFNULL(issuance_status,'Not Issued') as status,IFNULL(sum(net_premium ),0) as netamount FROM `ospos_lead_type_info` left join ospos_leads_product on lead_info_id = lead_type_id left join ospos_happy_calling on call_product_id = customer_product_id where ospos_lead_type_info.created_by in ($emp_id) and ospos_lead_type_info.ncd like '$cur_month%' and ospos_lead_type_info.category='3' and ospos_lead_type_info.prospect_level = '4' and ospos_leads_product.status = '1' and lead_mode='1' GROUP by issuance_status");
$issuance_rslt = $issuance->result_array();
$issued = 0;
$not_issued = 0;
$med_pend = 0;
foreach ($issuance_rslt as $key => $value) {
$count = $value['count'];
$netamount = $value['netamount'];
$issued_sts = $value['status'];
if($issued_sts === "Issued"){
$issued = $netamount;
}
if($issued_sts === "Issued"){
$issued = $netamount;
}
/*else if($issued_sts === "Not Issued"){
$not_issued = $netamount;
}*/else
if($issued_sts === "Medical Pending"){
$med_pend = $netamount;
}
else {
$not_issued = $netamount;
}
}
/*Issuance Status - END*/
/*Goal Sheet - START */
$goal_sheet = $this->db->query("SELECT premium,conversion_ratio FROM `ospos_goal_sheet` where emp_id = '$emp_id' AND role = '$emp_role' AND category = '$emp_cat' AND (YEAR(from_date) = '$cur_year' or YEAR(to_date) = '$cur_year') ");
$goal_sheet_rslt = $goal_sheet->result_array();
$req_value = $goal_sheet_rslt[0]['premium'];
$conversion_ratio = $goal_sheet_rslt[0]['conversion_ratio'];
$actual_month = round($req_value / 12);
//Pending
$collected_qry=$this->db->query("SELECT IFNULL(sum(overall_net_premium),0) as value FROM `ospos_lead_type_info` left join ospos_leads_product on lead_info_id = lead_type_id where lead_status='11' AND product_category = '$emp_cat' and ospos_lead_type_info.created_by = '$emp_id' and ncd between '$fin_start_month' and '$fin_end_month' and ncd not like '$cur_month%' and ospos_leads_product.status = '1' and lead_mode='1'");
$collected_result = $collected_qry->result_array();
$collected_value = $collected_result[0]['value'];
$fnl_collected_value = $req_value - $collected_value;
$req_gola_amt = $actual_month + $fnl_collected_value;
/* Team Result - START*/
$map_crm_query=$this->db->query("select teammembers from ospos_team where FIND_IN_SET($emp_id ,teammembers)");
$map_crm_result = $map_crm_query->result_array();
$map_crm = $map_crm_result[0]['teammembers'];
$hl_crm_line = "";
$hl_crm_hot = 0;
$hl_crm_warm = 0;
$hl_crm_ids = explode(",",$map_crm);
foreach($hl_crm_ids as $id){
$crm_info = $this->db->query("SELECT first_name FROM `ospos_employees` left join ospos_people on ospos_people.person_id = ospos_employees.id where ospos_employees.id = '$id'");
$crm_info_rslt = $crm_info->row();
$crm_name = $crm_info_rslt->first_name;
$log_info = $this->db->query("SELECT count(DISTINCT(lead_id)) as count,IFNULL(sum(overall_net_premium),0) as netamount FROM ospos_lead_type_info INNER join ospos_leads_product on lead_info_id = lead_type_id where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$id' and ospos_leads_product.status = '1' and ospos_lead_type_info.prospect_level = '4' and ospos_lead_type_info.ncd like '$cur_month%' and ospos_lead_type_info.category in ($emp_cat)");
$log_info_rslt = $log_info->row();
$log_val = $log_info_rslt->netamount;
$log_info = $this->db->query("SELECT count(DISTINCT(lead_id)) as nop,IFNULL(sum(overall_net_premium),0) as netamount FROM ospos_lead_type_info inner join ospos_leads_product on lead_info_id = lead_type_id where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by = '$id' and ospos_lead_type_info.prospect_level = '4' and ospos_leads_product.status = '1' and ospos_lead_type_info.ncd like '$cur_month%' and ospos_lead_type_info.category in ($emp_cat)");
$log_info_rslt = $log_info->row();
$nop = $log_info_rslt->nop;
$log_val = $log_info_rslt->netamount;
$avg_premium = round((int)$log_val / (int)$nop);
$hl_crm_lead = $this->db->query("SELECT count(*) as count,prospect_name,IFNULL(sum(expected_value),0) as amount FROM `ospos_lead_type_info` left join ospos_prospect_level on prospect_id = prospect_level where ospos_lead_type_info.lead_mode='1' and ospos_lead_type_info.created_by in ($id) and ncd like '$cur_month%' and ospos_lead_type_info.category in ($emp_cat) GROUP by prospect_level");
$hl_crm_lead_rslt = $hl_crm_lead->result_array();
$hl_crm_hot = 0;
$hl_crm_warm = 0;
foreach ($hl_crm_lead_rslt as $key => $value) {
$count = $value['count'];
$prospect_name = $value['prospect_name'];
if($prospect_name === "Hot"){
$hl_crm_hot = $count;
}else
if($prospect_name === "Warm"){
$hl_crm_warm = $count;
}
}
$qry = $this->db->query("SELECT login_date FROM `ospos_lead_type_info` inner join ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where prospect_level='4' and ospos_leads_product.status = '1' and ospos_lead_type_info.created_by = '$id' and ospos_lead_type_info.category in ($emp_cat) order by login_date desc limit 0,1");
$result = $qry->result_array();
$login_date = $result[0]['login_date'];
if($login_date === ""){
$login_date =date('Y-m-01');
}
$now = time();
$your_date = strtotime($login_date);
$datediff = $now - $your_date;
$Zero_days = floor($datediff / (60 * 60 * 24));
$clr = "";
if((int)$Zero_days >= 5){
$clr = "style='color:#FF5252';";
}
$hl_crm_line .= "<tr $clr>
<td>$crm_name</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,'$id',4,'M','PROSPECT');>$log_val</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,'$id',4,'M','PROSPECT');>$nop</td>
<td>$avg_premium</td>
<td>$Zero_days</td>
</tr>";
}
/* Removed By BSK @20Aug2018
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,'$id',1,'M','PROSPECT_NCD');>$hl_crm_hot</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,'$id',2,'M','PROSPECT_NCD');>$hl_crm_warm</td> */
/* Team Result - END */
//Total login value
$login_value_qry = $this->db->query("SELECT IFNULL(sum(overall_net_premium),0) as net_premium FROM `ospos_lead_type_info` INNER JOIN ospos_leads_product on ospos_leads_product.lead_info_id = ospos_lead_type_info.lead_type_id where ospos_lead_type_info.created_by = '$emp_id' and ospos_leads_product.status = '1' and ospos_lead_type_info.category='3' and lead_mode='1'");
$login_value_result = $login_value_qry->row();
$tot_log_val = $login_value_result->net_premium;
/*Goal Sheet - END */
echo "<div class='col-md-12 pd0 dash_header'>
<h3 class='text-center headtxt'>CRM Health</h3>
<div class='row mg0 mgb15'>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-placement='right' title='Zero Days / Zero in a Month'>
<div class='dashbox orange'>
<table>
<tr>
<td class='pd10'><i class='fa fa-user-md fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>Zero</h5> <span class='bold'>$zeroresult</span>
<div style='position: absolute; top: 5px; right: 25px; font-weight: bold;font-size: 11px;'>$zeromonth
</div>
</td>
</tr>
</table>
</div>
</div>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-placement='right' title='Self Login Value'>
<div class='dashbox red'>
<table>
<tr>
<td class='pd10'><i class='fa fa-sign-in fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>Login</h5> <span class='bold'> $self_value </span>
<div style='position: absolute; top: 5px; right: 25px; font-weight: bold;font-size: 11px;'>$crm_target
</div>
</td>
</tr>
</table>
</div>
</div>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-placement='right' title='Nop - ATS' >
<div class='dashbox blue'>
<table>
<tr>
<td class='pd10'><i class='fa fa-tags fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>NOP</h5> <span class='bold'> $crm_nop - $avg_value</span></td>
</tr>
</table>
</div>
</div>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-placement='right' title='Avg Per month current FY. Excluding current Month'>
<div class='dashbox violet'>
<table>
<tr>
<td class='pd10'><i class='fa fa-thermometer-half fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>Avg Per</h5> <span class='bold'> $health_avg</span></td>
</tr>
</table>
</div>
</div>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-toggle='tooltip' data-placement='right' title='Last Month Earned Incentive'>
<div class='dashbox yellow'>
<table>
<tr>
<td class='pd10'><i class='fa fa-ticket fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>Incentive</h5> <span class='bold'> Under Processing...</span></td>
</tr>
</table>
</div>
</div>
<div class='col-md-2 pdl0' data-toggle='tooltip' data-placement='right' title='Days to go'>
<div class='dashbox teal'>
<table>
<tr>
<td class='pd10'><i class='fa fa-hourglass-half fa-2x' aria-hidden='true'></i></td>
<td class='white'><h5>Days</h5> <span class='bold'> $DaysRemaining</span></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class='col-md-12 pd0 divider'></div>
<div class='row mg0'>
<div class='col-md-12'>
<div class='col-md-6 pd0'>
<div class='row mg0'>
<div class='col-md-12 pd0'>
<table class='table table-bordered table-hover col-style'>
<thead>
<tr>
<th>Leads</th>
<th>Hot</th>
<th>Warm</th>
<th>Colleted</th>
</tr>
</thead>
<tbody>
<tr>
<td >Today</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'T','HLPROSPECT');>$today_hot</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'T','HLPROSPECT');>$today_warm</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,4,'T','HLPROSPECT');>$today_log</td>
</tr>
<tr>
<td >Tomorrow</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'TW','HLPROSPECT');>$tmrw_hot</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'TW','HLPROSPECT');>$tmrw_warm</td>
<td > - </td>
</tr>
<tr>
<td >Month</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'M','HLPROSPECT');>$month_hot</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'M','HLPROSPECT');>$month_warm</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,4,'M','HLPROSPECT');>$month_log</td>
</tr>
</tbody>
</table>
</div>
<div class='col-md-12 pd0'>
<table class='table table-bordered table-hover col-style'>
<thead>
<tr>
<th>Generated</th>
<th>Hot</th>
<th>Warm</th>
<th>Collected</th>
</tr>
</thead>
<tbody>
<tr>
<td >Today</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'T','PROSPECT_CR');>$today_hot_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'T','PROSPECT_CR');>$today_warm_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,4,'T','PROSPECT_CR');>$today_log_cr</td>
</tr>
<tr>
<td >Month</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'M','PROSPECT_CR');>$month_hot_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'M','PROSPECT_CR');>$month_warm_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,4,'M','PROSPECT_CR');>$month_log_cr</td>
</tr>
<tr>
<td>Last Month</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,1,'LM','PROSPECT_CR');>$last_month_hot_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,2,'LM','PROSPECT_CR');>$last_month_warm_cr</td>
<td class='cursor' onclick=get_lead_info($emp_role,$emp_cat,$emp_id,4,'LM','PROSPECT_CR');>$last_month_log_cr</td>
</tr>
</tbody>
</table>
</div>
<div class='col-md-12 pd0'>
<table class='table table-bordered table-hover col-style'>
<thead>
<tr>
<th>Goal Sheet</th>
<th>This Month Actual</th>
<th>Pending</th>
<th>Total Required</th>
</tr>
</thead>
<tbody>
<tr><td>Under Processing...<td></tr>
</tbody>
</table>
</div>
<div class='col-md-12 pd0'>
<table class='table table-bordered table-hover col-style'>
<thead>
<tr>
<th>Issuance Status</th>
<th>Issued</th>
<th>Not Issued</th>
<th>Medical Pending</th>
</tr>
</thead>
<tbody>
<tr>
<td >Current Month</td>
<td class='cursor' onclick=get_lead_info_issued($emp_role,$emp_cat,$emp_id,'issued','M','');>$issued</td>
<td class='cursor' onclick=get_lead_info_issued($emp_role,$emp_cat,$emp_id,'not_issued','M','');>$not_issued</td>
<td class='cursor' onclick=get_lead_info_issued($emp_role,$emp_cat,$emp_id,'med_pend','M','');>$med_pend</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class='col-md-6' style='padding-right: 0px !important;'>
<div class='col-md-12 col-style'>
<div id='ribbon'>Login $tot_log_val</div>
<div id='crm_chart' style='height:315px;'></div>
</div>
</div>
</div>
<div class='col-md-12 pd0'>
<div class='col-md-6' style='height: 350px;overflow: auto;padding-right: 2px;' >
<table id='tbl' class='table table-bordered table-hover col-style tbl'>
<thead>
<tr>
<th>CRM Name</th>
<th>Value</th>
<th>NOP</th>
<th>Avg. Premium</th>
<th>Zero Days</th>
</tr>
</thead>
<tbody>
$hl_crm_line
</tbody>
</table>
</div>
<div class='col-md-6'>
<div class='col-md-12 col-style'>
<div id='healthteamperformance' style='height:315px;'></div>
</div>
</div>
</div>
</div>";
/* Removed By BSK @20Aug2018
<th>Hot</th>
<th>Warm</th>
*/
?>