File: /home/cafsindia/refimac_cafsjobs_com/ajax/loaddata - Copy.php
<?php
include_once('../dbconnect.php');
$pageid=$_REQUEST['pageid'];
$type=$_REQUEST['type'];
$searchby=$_REQUEST['searchby'];
$searchtext=$_REQUEST['searchtext'];
if($pageid=="2_1_1")
{
if($type=="1")
{
?>
<div class="col-md-12">
<h4 class="heading">View / Search / Update Pages </h4>
<table class="table table-striped table-bordered table-hover dt-responsive" style="width:100% !important" id="sample" >
<thead>
<tr>
<th>S.No. </th>
<th>option</th>
<th>Name</th>
<th>Address </th>
<th>Area</th>
<th>Surround Area/City</th>
<th>Phone</th>
<th>Mobile</th>
<th>Contact Person</th>
<th>Pincode</th>
</tr>
</thead>
<tbody>
<?php
// use serial no to get customer code
if($searchby=="SERIALNO")
{
$sqls="SELECT GROUP_CONCAT(distinct(CUSTOMER_code)) as custcode FROM sales inner join service on service.SALES_ID=sales.SALES_ID where SERIALNO like '%".$searchtext."%' ORDER BY sales.SALES_ID";
//echo $sqls; die;
$qus=mysql_query($sqls);
$fetch=mysql_fetch_array($qus);
$customer_code=str_replace(',',"','",$fetch['custcode']);
$sql1="select CUSTOMER_NAME,CUSTOMER_ADDRESS,CUSTOMER_AREA,CUSTOMER_SURROUND_AREA,CUSTOMER_CITY,CUSTOMER_PINCODE,CUSTOMER_PHONE,CUSTOMER_MOBILE,CUSTOMER_CONTACT_PERSON from customer where CUSTOMER_code in ('".$customer_code."')";
//echo $sql1; die;
}
else
{
$sql1="select CUSTOMER_code, CUSTOMER_NAME,CUSTOMER_ADDRESS,CUSTOMER_AREA,CUSTOMER_SURROUND_AREA,CUSTOMER_CITY,CUSTOMER_PINCODE,CUSTOMER_PHONE,CUSTOMER_MOBILE,CUSTOMER_CONTACT_PERSON from customer where ".$searchby." like '%".$searchtext."%'";
}
//echo $sql1; die;
//$sql1="select CUSTOMER_NAME,CUSTOMER_ADDRESS,CUSTOMER_AREA,CUSTOMER_SURROUND_AREA from customer limit 1,10";
$qu1=mysql_query($sql1);
$i=1;
while($rd=mysql_fetch_array($qu1))
{
?>
<tr>
<td><?php echo $i;?></td>
<td><a><span class="icon-pencil" style="cursor: pointer;" ></a> <a><span class="icon-plus" style="cursor: pointer;" id"booknew" alt="<?php echo $rd['CUSTOMER_code'];?>" title="Book New Complaint"></a> <a><span class="icon-call-in" style="cursor: pointer;" id"viewmachine" alt="<?php echo $rd['CUSTOMER_code'];?>" title="View Complaint History"></a></td>
<td ><?php echo $rd['CUSTOMER_NAME'];?></td>
<td ><?php echo $rd['CUSTOMER_ADDRESS'];?></td>
<td ><?php echo $rd['CUSTOMER_AREA'];?></td>
<td class="center" ><?php echo $rd['CUSTOMER_SURROUND_AREA'].'-'. $rd['CUSTOMER_CITY']; ?></td>
<!--<td class="center" ><?php echo $rd['CUSTOMER_CITY']; ?></td> -->
<td class="center" ><?php echo $rd['CUSTOMER_PHONE']; ?></td>
<td class="center" ><?php echo $rd['CUSTOMER_MOBILE']; ?></td>
<td class="center"><?php echo $rd['CUSTOMER_CONTACT_PERSON']; ?></td>
<td class="center"><?php echo $rd['CUSTOMER_PINCODE']; ?></td>
</tr>
<?php $i++; }?>
</tbody>
</table>
</div>
<?php
}
}
?>