| Server IP : 92.204.40.98 / Your IP : 216.73.216.201 Web Server : LiteSpeed System : Linux amster.dnsfors.com 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : tmksyste ( 2190) PHP Version : 8.3.31 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/tmksyste/domains/tmksystems.in/private_html/crmapp/ |
Upload File : |
<?php
error_reporting(1);
session_start();
include 'connection.php';
$month = $_POST['month'];
$ddate = date("Y-m-d");
$start=date("Y-m");
$dstart=$start."-01";
$html='';
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$html= ' <table id="buttons-datatables" class="table nowrap dt-responsive align-middle table-hover table-bordered" style="width:100%;">
<thead>
<tr><th>#</th>
<th>Employee</th>
<th>Leads</th>
<th>Digital Marketing</th>
<th>Referral</th>
<th>Followup</th>
<th>Customer</th>
<th>Installation</th>
</tr> </thead><tbody id="sale_report_table"> ';
$date=date('Y-m-d');
$i=1;
$sql_emp="select * from login where type!='Admin'";
$result_emp=mysqli_query($con,$sql_emp);
while($row_emp=mysqli_fetch_array($result_emp)){
$eid=$row_emp['id'];
if($month==0)
$sql_leads="select * from leads where followup_excecutive='$eid'";
else
$sql_leads="select * from leads where followup_excecutive='$eid' and added_date>='$dstart' and added_date<'$date'";
$result_leads=mysqli_query($con,$sql_leads);
$row_leads=mysqli_fetch_array($result_leads);
$countleads=mysqli_num_rows($result_leads);
$lid=$row_leads['lid'];
if($month==0)
$sql_mar="select * from marketing_activities where followup_excecutive='$eid'";
else
$sql_mar="select * from marketing_activities where followup_excecutive='$eid' and date>='$dstart' and date<'$date'";
$result_mar=mysqli_query($con,$sql_mar);
$row_mar=mysqli_fetch_array($result_mar);
$countmar=mysqli_num_rows($result_mar);
if($month==0)
$sql_cust="select * from customer_details where lid='$lid'";
else
$sql_cust="select * from customer_details where lid='$lid'";
$result_cust=mysqli_query($con,$sql_cust);
$row_cust=mysqli_fetch_array($result_cust);
$countcust=mysqli_num_rows($result_cust);
$cid=$row_cust['cid'];
if($month==0)
$sql_pro="select * from project where cid='$cid' and aname='Installation'";
else
$sql_pro="select * from project where cid='$cid' and aname='Installation'";
$result_pro=mysqli_query($con,$sql_pro);
$countpro=mysqli_num_rows($result_pro);
if($month==0)
$sql_dm="select * from leads where followup_excecutive='$eid' and (source_lead='Marketing' or source_lead='Digital Marketing') ";
else
$sql_dm="select * from leads where followup_excecutive='$eid' and (source_lead='Marketing' or source_lead='Digital Marketing') and added_date>='$dstart' and added_date<'$date'";
$result_dm=mysqli_query($con,$sql_dm);
$countdm=mysqli_num_rows($result_dm);
if($month==0)
$sql_re="select * from leads where followup_excecutive='$eid' and (source_lead='Reference' or source_lead='Referral')";
else
$sql_re="select * from leads where followup_excecutive='$eid' and (source_lead='Reference' or source_lead='Referral') and added_date>='$dstart' and added_date<'$date'";
$result_re=mysqli_query($con,$sql_re);
$countre=mysqli_num_rows($result_re);
$html.='<tr><th scope="row">'.$i.'</th>
<td>'.$row_emp['Name'].'</td>
<td>'.$countleads.'</td>
<td>'.$countdm.'</td>
<td>'.$countre.'</td>
<td>'.$countmar.'</td>
<td>'.$countcust.'</td>
<td>'.$countpro.'</td>
</tr> ';
$i++;
$countleads=0;
$countdm=0;
$countre=0;
$countmar=0;
$countcust=0;
$countpro=0;
}
$html.='</tbody></table> ';
}
echo $html;
?>