<!-- Start SQL Search -->
<?php
$strSQL = "SELECT * FROM job_detail ";
if($_GET["txtKeyword"] !='' and $_GET["statusKeyword"] =='' and $_GET["job_typeKeyword"] ==''){
$strSQL .= " WHERE cus_name LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_tel LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_address LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or product_type LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or model LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or detail LIKE '%".$_GET["txtKeyword"]."%' ";
} else if($_GET["txtKeyword"] !='' and $_GET["statusKeyword"] !='' and $_GET["job_typeKeyword"] ==''){
$strSQL .= " WHERE cus_name LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_tel LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_address LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or product_type LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or model LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or detail LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " AND status = '".$_GET["statusKeyword"]."' ";
} else if($_GET["txtKeyword"] !='' and $_GET["statusKeyword"] !='' and $_GET["job_typeKeyword"] !=''){
$strSQL .= " WHERE cus_name LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_tel LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_address LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or product_type LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or model LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or detail LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " AND status = '".$_GET["statusKeyword"]."' ";
$strSQL .= " AND job_type = '".$_GET["job_typeKeyword"]."' ";
} else if($_GET["txtKeyword"] !='' and $_GET["statusKeyword"] =='' and $_GET["job_typeKeyword"] !=''){
$strSQL .= " WHERE cus_name LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_tel LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or cus_address LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or product_type LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or model LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " or detail LIKE '%".$_GET["txtKeyword"]."%' ";
$strSQL .= " AND job_type = '".$_GET["job_typeKeyword"]."' ";
} else if($_GET["txtKeyword"] =='' and $_GET["statusKeyword"] !='' and $_GET["job_typeKeyword"] !=''){
$strSQL .= " WHERE status = '".$_GET["statusKeyword"]."' ";
$strSQL .= " AND job_type = '".$_GET["job_typeKeyword"]."' ";
} else if($_GET["txtKeyword"] =='' and $_GET["statusKeyword"] =='' and $_GET["job_typeKeyword"] !=''){
$strSQL .= " WHERE job_type = '".$_GET["job_typeKeyword"]."' ";
} else if($_GET["txtKeyword"] =='' and $_GET["statusKeyword"] !='' and $_GET["job_typeKeyword"] ==''){
$strSQL .= " WHERE status = '".$_GET["statusKeyword"]."' ";
}
$strSQL .= " ORDER BY job_ID DESC ";
echo $strSQL;
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<!-- Start SQL Search -->