file_get_contents
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u247928417
/
domains
/
riddi.in
/
public_html
/
admin
/
Filename :
client_list.php
back
Copy
<?php session_start(); include_once("config/config.php"); error_reporting(0); if(empty($_SESSION['user_id'])){ echo"<meta http-equiv='refresh' content='0; url=index.php' />"; } $userid=$_SESSION['user_id']; /**************************************** PAGINATION START HERE*************************************************/ $page = (int) $_GET['page']; if ($page < 1) $page = 1; // service_details.service_name,service_details.domain $resultsPerPage = 10; $startResults = (($page - 1) * $resultsPerPage); if(isset($_REQUEST['search'])){ $search="where clients.first_name like '%".trim($_POST['firstName'])."%' and service_details.service_product_id='".$_POST['service_name']."' and service_details.domain like '%".trim($_POST['domain'])."%' and clients.company_name like '%".trim($_POST['company_name'])."%' or (service_details.start_date>='".$_POST['Serstart_date']."' and service_details.expire_date<='".$_POST['Serend_date']."')"; //first name if(empty($_POST['service_name']) and empty($_POST['domain']) and empty($_POST['Serstart_date']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where clients.first_name like '%".trim($_POST['firstName'])."%' "; } //service name elseif(empty($_POST['firstName']) and empty($_POST['domain']) and empty($_POST['Serstart_date']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where service_details.service_product_id='".$_POST['service_name']."'"; } //domain elseif(empty($_POST['firstName']) and empty($_POST['service_name']) and empty($_POST['Serstart_date']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where service_details.domain like '%".trim($_POST['domain'])."%' "; } //start date elseif(empty($_POST['firstName']) and empty($_POST['service_name']) and empty($_POST['domain']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where service_details.start_date<='".$_POST['Serstart_date']."' "; } //end date elseif(empty($_POST['firstName']) and empty($_POST['service_name']) and empty($_POST['domain']) and empty($_POST['Serstart_date']) and empty($_POST['company_name']) ){ $search="where service_details.expire_date>='".$_POST['Serend_date']."' "; } //first name and domain elseif(empty($_POST['service_name']) and empty($_POST['Serstart_date']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where clients.first_name like '%".trim($_POST['firstName'])."%' and service_details.domain like '%".trim($_POST['domain'])."%' "; } //domain and start date elseif(empty($_POST['firstName']) and empty($_POST['service_name']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where service_details.domain like '%".trim($_POST['domain'])."%' and service_details.start_date<='".$_POST['Serstart_date']."'"; } //client first name and start date elseif(empty($_POST['domain']) and empty($_POST['service_name']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search="where clients.first_name like '%".trim($_POST['firstName'])."%' and ervice_details.start_date<='".$_POST['Serstart_date']."'"; } elseif(empty($_POST['domain']) and empty($_POST['service_name']) and empty($_POST['Serend_date']) and empty($_POST['firstName']) and empty($_POST['Serend_date'])){ $search="where clients.company_name like '%".trim($_POST['company_name'])."%'"; } elseif(empty($_POST['firstName']) and empty($_POST['service_name']) and empty($_POST['domain']) and empty($_POST['Serstart_date']) and empty($_POST['Serend_date']) and empty($_POST['company_name'])){ $search=" "; } } $Selectclient="SELECT DISTINCT(clients.client_id),service_details.sclient_id, clients.title, clients.first_name, clients.middle_name, clients.last_name, clients.address_street1,clients.company_name, clients.address_street2, clients.city, clients.pincode, clients.work_phone,clients.date,state.state_name,users.name FROM clients LEFT JOIN state ON clients.state = state.state_id LEFT JOIN users ON clients.add_users_id=users.id LEFT JOIN service_details ON clients.client_id = service_details.sclient_id"; $record=mysqli_query($Selectclient) or die (mysqli_error()); $data_count=mysqli_num_rows($record); $totalPages = ceil($data_count / $resultsPerPage); $start=abs($_GET['start']); if($start==''){ $start=0; } /******************************************* PAGINATION END HERE***********************************************/ $selectClients ="$Selectclient " . $search . " LIMIT $startResults, $resultsPerPage"; $queryClients =mysqli_query($conn,$selectClients) or die (mysqli_error()); $numRowClients=mysqli_num_rows($queryClients); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>View Client</title> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link type="text/css" href="menu.css" rel="stylesheet" /> <link type="text/css" href="Library/css/formdesign.css" rel="stylesheet"/> <link href="css/style.css" type="text/css" rel="stylesheet" /> <link type="text/css" href="css/pim.css" rel="stylesheet"/> <script type="text/javascript" src="datetimepicker.js"></script> <!--Auto Suggestion Start Here--> <script src="js/jquery.tools.min.js" type="text/javascript"></script> <script type='text/javascript' src="jquery-autocomplete/jquery.autocomplete.js"></script> <link rel="stylesheet" type="text/css" href="jquery-autocomplete/jquery.autocomplete.css" /> <script type="text/javascript"> $().ready(function() { $("#clientName").autocomplete("client_name_list.php", { width: 260, matchContains: true, mustMatch: true, selectFirst: false }); $("#clientName").result(function(event, data, formatted) { }); }); </script> <script type="text/javascript"> $().ready(function() { $("#domainName").autocomplete("domain_name_list.php", { width: 260, matchContains: true, mustMatch: true, selectFirst: false }); $("#domainName").result(function(event, data, formatted) { }); }); </script> <script type="text/javascript"> $().ready(function() { $("#company").autocomplete("company_name_list.php", { width: 260, matchContains: true, mustMatch: true, selectFirst: false }); $("#company").result(function(event, data, formatted) { }); }); </script> <!--Auto Suggestion End Here--> <script language="JavaScript" type="text/javascript"> function checkdelete(){ var r=confirm("Are you sure to delete?"); if (r==true){ return true; } else{ return false; } } function changeurl(id) { var newurl = id.options[id.selectedIndex].value; window.location.href = newurl; } </script> <?php if($_SESSION['user_type']=='3'){?> <script language="JavaScript"> <!-- Disable function disableselect(e){ return false } function reEnable(){ return true } //if IE4+ document.onselectstart=new Function ("return false") document.oncontextmenu=new Function ("return false") //if NS6 if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } //--> </script> <?php }?> </head> <body> <div class="main"> <div class="header"> <?php require_once'menu.php';?> </div> <div> <?php //require_once'clientMenu.php';?></div> <table border="0" cellspacing="0" cellpadding="10" class="ipm"> <tr id="ipm-th"> <td align="center"><b>View All Clients</b><div align="center"><b style="background-color:#000; color:#F00; border-radius:5px; margin-bottom:5px;"><?php echo $delmessage;?></b></div></td> </tr> <tr> <td> <form method="GET" action="search_client.php"> <table width="1114" cellspacing="10" class="searching"> <tr> <th>Client First Name</th> <td><input type="text" name="firstName" id="clientName" value="<?php $_POST['firstName'];?>" style="width:151px;"/> <!--For Auto Suggestion use id="clientName"--> </td> <th>Service Name/Product</th> <td><select name="service_name" style="width:170px;"> <option value="">Select Service</option> <?php $selPro="select * from product where product_status='Active'"; $resPro=mysqli_query($selPro) or die(mysqli_error()); while($dataPro=mysqli_fetch_assoc($resPro)){ ?> <option value="<?php echo $dataPro['prod_id'];?>"><?php echo $dataPro['product'];?></option> <?php }?> </select></td> <th>Domain</th> <td><input type="text" name="domain" id="domainName" value="<?php $_POST['domain'];?>" style="width:151px;"/></td> <th>Company Name</th> <td><input type="text" name="company_name" id="company" value="<?php $_POST['company_name'];?>" style="width:151px;"/></td> </tr> <!--<tr> <td>Client Add Date From</td> <td><input type="text" name="start_date" id="start_date" size="10" style="width: 129px;" value="<?php echo $resultClients['start_date'];?>" /> <a href="javascript:NewCssCal('start_date','yyyymmdd','false')"><img src="img/calendar.png" style="width:16px; height:16px;" border="0" alt="Pick a date" ></a></td> <td>Client Add TO</td> <td><input type="text" name="end_date" id="end_date" size="10" style="width: 129px;" value="<?php echo $resultClients['start_date'];?>" /> <a href="javascript:NewCssCal('end_date','yyyymmdd','false')"><img src="img/calendar.png" style="width:16px; height:16px;" border="0" alt="Pick a date" ></a></td> <td> </td> <td> </td> </tr>--> <tr> <th>Service Start Date</th> <td><input type="text" name="Serstart_date" id="Serstart_date" size="10" style="width: 129px;" value="<?php echo $resultClients['Serstart_date'];?>" /> <a href="javascript:NewCssCal('Serstart_date','yyyymmdd','false')"><img src="img/calendar.png" style="width:16px; height:16px;" border="0" alt="Pick a date" ></a></td> <th>Service Expire Date</th> <td><input type="text" name="Serend_date" id="Serend_date" size="10" style="width: 129px;" value="<?php echo $resultClients['Serend_date'];?>" /> <a href="javascript:NewCssCal('Serend_date','yyyymmdd','false')"><img src="img/calendar.png" style="width:16px; height:16px;" border="0" alt="Pick a date" ></td> <td> </td> <td><input type="submit" name="search" value="Search" id="searchbutton"/></td> </tr> </table> </form> </td> </tr> <tr> <td> <table width="90%" border="1" rules="all" cellspacing="0" cellpadding="0" class="ipmsub-tab" style="margin-top:9px; margin-left:65px;"> <table width="100%" border="1" rules="all" class="clientDetail" id="table"> <tr style="background-color:#C0C0C0; color:#000; height:30px;"> <th scope="col">Client Name</th> <th scope="col">Work Phone</th> <th scope="col">Company Name</th> <th scope="col">View Details</th> <th scope="col">Client Services</th> <th scope="col">Add/View Concerned Person</th> <th scope="col">Add Meeting</th> <th scope="col">Share/Transfer Client</th> <th scope="col">Client Added By</th> <th scope="col">Client Shared To</th> </tr> <?php $i=0; while($resultClients = mysqli_fetch_assoc($queryClients)){ //share client list $Shareclient="select t1.cusers_id,t2.name,t2.code,t2.email_id from clients t1 left join users t2 on t1.cusers_id=t2.id where t1.client_id='".$resultClients['client_id']."'"; $clientShare=mysqli_query($Shareclient) or die(mysqli_error()); $dataShare=mysqli_fetch_assoc($clientShare); ?> <tr> <th scope="col"><?php echo $resultClients['title'].' '.$resultClients['first_name'].' '.$resultClients['middle_name'].' '.$resultClients['last_name'];?></th> <th scope="col"><?php echo $resultClients['work_phone'];?></th> <th scope="col"><?php echo $resultClients['company_name'];?></th> <th scope="col"><a href="client_details.php?cid=<?php echo base64_encode($resultClients['client_id']);?>"><img src="Library/images/view-details.png" title="View Client Details"/></a></th> <th scope="col"><a href="client_services.php?cid=<?php echo base64_encode($resultClients['client_id']);?>"><img src="Library/images/details.gif"/></a></th> <th scope="col"><a href="view_cperson.php?cid=<?php echo base64_encode($resultClients['client_id']);?>"><img alt="Add/View Concerned Person" src="img/adminclient.png" title="Add/View Concerned Person" width="26" height="32"/></a></th> <th scope="col"><a href="meeting.php?cid=<?php echo base64_encode($resultClients['client_id']);?>"><img alt="Add Meeting" src="Library/images/add.png" title="Add Meeting"/></a></th> <th scope="col"><a href="client_share.php?cid=<?php echo base64_encode($resultClients['client_id']);?>"><img alt="Share/Transfer Client" src="images/share.png" title="Share/Transfer Client" width="45" height="45"/></a></th> <th scope="col"><?php echo $resultClients['name'];?></th> <th scope="col"><?php echo $dataShare['name'];?></th> </tr> <?php }$i++;?> <tr><td colspan="10" align="center" bgcolor="#422518" style="color:#FFF"> <?php if($numRowClients==0){ echo "No Data Found"; }?></td></tr> </table> <div style="margin-left:482px;"> <?php /***********************************PAGINATION START HERE*********************************/ echo 'Viewing results <form name="form1" id="form1" method="post" action=""><select name="select" style="width:67px;" id="select" onchange="changeurl(this)">'; for($i = 1; $i <$totalPages; $i++) { $startResults2 = (($i - 1) * $resultsPerPage); echo '<option value="client_list.php?&page='.$i.'"'.(($i == $page) ? ' selected="selected"' : '').'>'.($startResults2 + 1).' to '.($startResults2 + $resultsPerPage).'</option>'; } echo '<option value="client_list.php?&page='.$totalPages.'"'.(($totalPages == $page) ? ' selected="selected"' : '').'>'.((($totalPages - 1) * $resultsPerPage) + 1).' to '.$data_count.'</option>'; /***********************************PAGINATION END HERE*************************************/ ?> </div> </table> </td> </tr> </table> </div> <div class="footer"> <?php require_once'footer.php';?> </div> </body> </html>