<?
// start code
include("../config.inc.php") ;
$objQuery = "SELECT * FROM Member WHERE (NumberCard LIKE '%".$_GET["txtKeyword1"]."%'
and IDCard LIKE '%".$_GET["txtKeyword2"]."%'
and Sex LIKE '%".$_GET["txtKeyword3"]."%'
and District LIKE '%".$_GET["txtKeyword4"]."%'
and Education LIKE '%".$_GET["txtKeyword5"]."%'
and Occuption LIKE '%".$_GET["txtKeyword6"]."%')";
if($_GET["txtKeyword7"] != "" or $_GET["txtKeyword8"] != ""){
$objQuery .= " and (DateOfBrd between '".$_GET["txtKeyword7"]."' and '".$_GET["txtKeyword8"]."') ";
}
if($_GET["txtKeyword9"] != "" or $_GET["txtKeyword10"] != ""){
$objQuery .= " and (Age between '".$_GET["txtKeyword9"]."' and '".$_GET["txtKeyword10"]."') ";
}
if($_GET["txtKeyword11"] != "" or $_GET["txtKeyword12"] != ""){
$objQuery .= " and (Income between '".$_GET["txtKeyword11"]."' and '".$_GET["txtKeyword12"]."') ";
$objQuery = mssql_query($objQuery) or die ("Error Query [".$objQuery."]");
$Num_Rows = mssql_num_rows($objQuery);
$Per_Page =10; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$Page_End = $Per_Page * $Page;
IF ($Page_End > $Num_Rows)
{
$Page_End = $Num_Rows;
}
?>
if($_GET["txtKeyword7"] != "" or $_GET["txtKeyword8"] != ""){
$objQuery .= " and (DateOfBrd between '".$_GET["txtKeyword7"]."' and '".$_GET["txtKeyword8"]."') ORDER BY IDCard ASC ";
}
if($_GET["txtKeyword9"] != "" or $_GET["txtKeyword10"] != ""){
$objQuery .= " and (Age between '".$_GET["txtKeyword9"]."' and '".$_GET["txtKeyword10"]."') ORDER BY IDCard ASC ";
}
if($_GET["txtKeyword11"] != "" or $_GET["txtKeyword12"] != ""){
$objQuery .= " and (Income between '".$_GET["txtKeyword11"]."' and '".$_GET["txtKeyword12"]."') ORDER BY IDCard ASC ";