01.
<!-- Start SQL Search -->
02.
<?php
03.
$strSQL
=
"SELECT * FROM job_detail "
;
04.
if
(
$_GET
[
"txtKeyword"
] !=
''
and
$_GET
[
"statusKeyword"
] ==
''
and
$_GET
[
"job_typeKeyword"
] ==
''
){
05.
$strSQL
.=
" WHERE cus_name LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
06.
$strSQL
.=
" or cus_tel LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
07.
$strSQL
.=
" or cus_address LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
08.
$strSQL
.=
" or product_type LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
09.
$strSQL
.=
" or model LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
10.
$strSQL
.=
" or detail LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
11.
12.
}
else
if
(
$_GET
[
"txtKeyword"
] !=
''
and
$_GET
[
"statusKeyword"
] !=
''
and
$_GET
[
"job_typeKeyword"
] ==
''
){
13.
$strSQL
.=
" WHERE cus_name LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
14.
$strSQL
.=
" or cus_tel LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
15.
$strSQL
.=
" or cus_address LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
16.
$strSQL
.=
" or product_type LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
17.
$strSQL
.=
" or model LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
18.
$strSQL
.=
" or detail LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
19.
$strSQL
.=
" AND status = '"
.
$_GET
[
"statusKeyword"
].
"' "
;
20.
21.
}
else
if
(
$_GET
[
"txtKeyword"
] !=
''
and
$_GET
[
"statusKeyword"
] !=
''
and
$_GET
[
"job_typeKeyword"
] !=
''
){
22.
$strSQL
.=
" WHERE cus_name LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
23.
$strSQL
.=
" or cus_tel LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
24.
$strSQL
.=
" or cus_address LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
25.
$strSQL
.=
" or product_type LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
26.
$strSQL
.=
" or model LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
27.
$strSQL
.=
" or detail LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
28.
$strSQL
.=
" AND status = '"
.
$_GET
[
"statusKeyword"
].
"' "
;
29.
$strSQL
.=
" AND job_type = '"
.
$_GET
[
"job_typeKeyword"
].
"' "
;
30.
31.
}
else
if
(
$_GET
[
"txtKeyword"
] !=
''
and
$_GET
[
"statusKeyword"
] ==
''
and
$_GET
[
"job_typeKeyword"
] !=
''
){
32.
$strSQL
.=
" WHERE cus_name LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
33.
$strSQL
.=
" or cus_tel LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
34.
$strSQL
.=
" or cus_address LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
35.
$strSQL
.=
" or product_type LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
36.
$strSQL
.=
" or model LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
37.
$strSQL
.=
" or detail LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' "
;
38.
$strSQL
.=
" AND job_type = '"
.
$_GET
[
"job_typeKeyword"
].
"' "
;
39.
40.
}
else
if
(
$_GET
[
"txtKeyword"
] ==
''
and
$_GET
[
"statusKeyword"
] !=
''
and
$_GET
[
"job_typeKeyword"
] !=
''
){
41.
$strSQL
.=
" WHERE status = '"
.
$_GET
[
"statusKeyword"
].
"' "
;
42.
$strSQL
.=
" AND job_type = '"
.
$_GET
[
"job_typeKeyword"
].
"' "
;
43.
44.
}
else
if
(
$_GET
[
"txtKeyword"
] ==
''
and
$_GET
[
"statusKeyword"
] ==
''
and
$_GET
[
"job_typeKeyword"
] !=
''
){
45.
$strSQL
.=
" WHERE job_type = '"
.
$_GET
[
"job_typeKeyword"
].
"' "
;
46.
47.
}
else
if
(
$_GET
[
"txtKeyword"
] ==
''
and
$_GET
[
"statusKeyword"
] !=
''
and
$_GET
[
"job_typeKeyword"
] ==
''
){
48.
$strSQL
.=
" WHERE status = '"
.
$_GET
[
"statusKeyword"
].
"' "
;
49.
50.
}
51.
52.
53.
54.
55.
56.
$strSQL
.=
" ORDER BY job_ID DESC "
;
57.
echo
$strSQL
;
58.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
59.
60.
61.
62.
?>
63.
<!-- Start SQL Search -->