| 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/public_html/crmapp/ |
Upload File : |
<?php
include 'connection.php';
session_start();
$_SESSION['username'];
$product=$_POST['product'];
$area=$_POST['area'];
$munci=$_POST['munci'];
$thaluk=$_POST['thaluk'];
$district=$_POST['district'];
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$query_array=array();
$i=0;
if(!empty($product))
$query_array[$i++]="`product`='".$product."' ";
if(!empty($area))
$query_array[$i++]="`area`='".$area."' ";
if(!empty($munci))
$query_array[$i++]="`munci`='".$munci."' ";
if(!empty($thaluk))
$query_array[$i++]="`thaluk`='".$thaluk."' ";
if(!empty($district))
$query_array[$i++]="`district`='".$district."' ";
$query_array_new=implode("AND ",$query_array);
if(count($query_array)>=1)
$query_array_new1=$query_array_new." AND ";
session_start();
$gquery="";
$type=$_SESSION["type"];
$eid=$_SESSION["userid"];
if($type=='Employee')
{
$sql="SELECT * FROM `customer_details`left join leads on customer_details.lid=leads.lid WHERE ".$query_array_new1." leads.followup_excecutive='$eid' ";
}
else
{
$query_array_new1=rtrim($query_array_new, 'AND');
$sql="SELECT * FROM `customer_details`left join leads on customer_details.lid=leads.lid where ".$query_array_new1." order by customer_details.cid desc";
}
// $sql=" select * from customer_details WHERE ".$query_array_new1." order by cid desc";
$res=mysqli_query($con,$sql);
}
$result="";
$rowcount=mysqli_num_rows($res);
//echo $rowcount;
if($rowcount==0)
$result='<h3>No Results Found</h3>';
else
{
$result=' <div id="custable"><table id="buttons-datatables" class="table nowrap dt-responsive align-middle table-hover table-bordered" style="width:100%;">
<thead>
<tr><th>#</th><th>Bill No</th><th>Client <br>Name</th>
<th>Product</th><th>Contact <br>Person</th><th>Muncipality/ <br>Panchayath</th><th>Thaluk</th><th>District</th><th>Net Meter Date</th><th>Taxable <br>Amount</th><th>Total <br>Amount</th> </tr> </thead> <tbody> ';
$j=1;
while($row=mysqli_fetch_array($res))
{
$lid=$row['lid']; $cid=$row['cid'];
$sql1="select * from leads where lid='$lid'";
$result1=mysqli_query($con,$sql1) or die(mysqli_error());
$row1=mysqli_fetch_array($result1);
if($row['pdate']=='0000-00-00')
$pdate='';
else
$pdate=date("d-m-Y", strtotime($row['pdate']));
$lid2=$row['lid'];
if($row1['name_firm']!=""){
$namess= $row1['name_firm'];}
else{$namess= $row['customer'];}
if($row['phone']!=""){
$contact= $row['phone'];}
else{
$contact= $row1['contact_name1']."<br>".$row1['number1'];}
$result.='<tr><th scope="row">'.$j.'</th>
<td>'.$row['order_no'].'</td>
<td>'.$namess.'</td>
<td>'.$row['product'].'</td>
<td>'.$contact.'</td>
<td>'.$row['munci'].'</td>
<td>'.$row['thaluk'].'</td>
<td>'.$row['district'].'</td>
<td>'.$pdate.'</td>
<td>'.$row['famount'].'</td>
<td>'.$row['total_amount'].'</td>
</tr> ';
$j++;
}
$result.="</tbody></table></div>";
}
echo $result;
?>
<script>
$('#buttons-datatables').DataTable({
dom: 'Bftip',
buttons: [
'copy', 'excel', 'pdf', 'print', 'csv'
]
});
</script>