OverLord Shell
<?php
session_start();
if(isset($_POST['page'])){
//Include pagination class file
include('../Pagination.php');
//Include database configuration file
include("db/conn.php");
// echo $_GET['qal']; exit;
$start = !empty($_POST['page'])?$_POST['page']:0;
$limit = 10;
//set conditions for search
$whereSQL = $orderSQL = '';
$keywords = $_POST['keywords'];
$sortBy = $_POST['sortBy'];
$asd=$_POST['asd'];
//print_r($_POST); exit;
if($keywords!='')
{
$whereSQL.=" AND (fname like '%".$keywords."%'";
$whereSQL.=" OR lname like '%".$keywords."%'";
$whereSQL.=" OR rep_name like '%".$keywords."%'";
$whereSQL.=" OR memcode like '%".$keywords."%'";
$whereSQL.=" OR mobno like '%".$keywords."%'";
$whereSQL.=" OR email like '%".$keywords."%'";
$whereSQL.=" OR memshiptype like '%".$keywords."%')";
}
// echo 111;exit;
if(!empty($sortBy)){
$orderSQL = " ORDER BY con_sr_no ".$sortBy;
}else{
$orderSQL = " ORDER BY con_sr_no ASC ";
}
$qal1="SELECT COUNT(1) as postNum FROM otms_mst_contact where active='y' AND su_sr_no=1";
$qal1.=" ".$whereSQL.$orderSQL;
//echo $qal1;exit;
$queryNum = $db->query($qal1);
$resultNum = $queryNum->fetch_assoc();
$rowCount = $resultNum['postNum'];
//initialize pagination class
$pagConfig = array(
'currentPage' => $start,
'totalRows' => $rowCount,
'perPage' => $limit,
'link_func' => 'searchFilter'
);
$queryNum->free();
$pagination = new Pagination($pagConfig);
if(!empty($sortBy)){
$orderSQL = " ORDER BY con_sr_no ".$sortBy;
}else{
$orderSQL = " ORDER BY con_sr_no ASC ";
}
$qal2="SELECT * FROM otms_mst_contact where active='y' AND su_sr_no=1 ";
$qal2.="$whereSQL $orderSQL LIMIT $start,$limit";
//$query = $db->query("SELECT * FROM otms_mst_contact where active='y' AND su_sr_no=".$_SESSION['su_sr_no']." $whereSQL $orderSQL LIMIT $start,$limit");
//echo $qal2; exit;
$query = $db->query($qal2);
if($query->num_rows > 0){
$i=1;
while($listrow = $query->fetch_assoc()){
include("ajax-contact-list.php");
$i++;}
$query->free();
// echo $pagination->createLinks();
}?>
<tr>
<td colspan="14"><?php echo $pagination->createLinks();?></td>
</tr>
<?php }?>
</div>
<script src="js/validate.js"></script>
xRyukZ - Copyright 2k19