62 |
$i = 1; |
$i = 1; |
63 |
while (${"search_".$i}) { |
while (${"search_".$i}) { |
64 |
$field = ${"field_".$i}; |
$field = ${"field_".$i}; |
65 |
$not = ${"not_".$i} ? "NOT" : ""; |
$not = ${"not_".$i} ? " NOT" : ""; |
66 |
$qry1 = preg_split('/\s+/', ${"query_".$i}); |
$qry1 = preg_split('/\s+/', ${"query_".$i}); |
67 |
$qry2 = array(); |
$qry2 = array(); |
68 |
$qry3 = array(); |
$qry3 = array(); |
69 |
while (list($k, $v) = each($qry1)) { |
while (list($k, $v) = each($qry1)) { |
70 |
if (!$qry1[$k]) continue; |
if (!$qry1[$k]) continue; |
71 |
if (${"case_".$i}) $qq = "(".$fields[$field]["dbname"]." $not LIKE '%".$qry1[$k]."%')"; |
if (${"case_".$i}) $qq = "(".$fields[$field]["dbname"]."$not LIKE '%".$qry1[$k]."%')"; |
72 |
else $qq = "(UPPER(".$fields[$field]["dbname"].") $not LIKE UPPER('%".$qry1[$k]."%'))"; |
else $qq = "(UPPER(".$fields[$field]["dbname"].")$not LIKE '%".MyUpper($qry1[$k])."%')"; |
73 |
$is_q1 = false; |
$is_q1 = false; |
74 |
for ($j = 0; $j < count($q1_fields); $j++) |
for ($j = 0; $j < count($q1_fields); $j++) |
75 |
if ($q1_fields[$j] == $field) $is_q1 = true; |
if ($q1_fields[$j] == $field) $is_q1 = true; |
99 |
$q3 = array(); |
$q3 = array(); |
100 |
while (list($k, $v) = each($q)) { |
while (list($k, $v) = each($q)) { |
101 |
if (!$q[$k]) continue; |
if (!$q[$k]) continue; |
102 |
$qq = "(UPPER(".$fields[$field]["dbname"].") LIKE UPPER('%".$q[$k]."%'))"; |
$qq = "(UPPER(".$fields[$field]["dbname"].") LIKE '%".MyUpper($q[$k])."%')"; |
103 |
$is_q1 = false; |
$is_q1 = false; |
104 |
for ($i = 0; $i < count($q1_fields); $i++) |
for ($i = 0; $i < count($q1_fields); $i++) |
105 |
if ($q1_fields[$i] == $field) $is_q1 = true; |
if ($q1_fields[$i] == $field) $is_q1 = true; |
127 |
$tp->assign("section_menu", $section_menu); |
$tp->assign("section_menu", $section_menu); |
128 |
$tp->assign("FORM_ACTION", $PHP_SELF.HTMLSpecialChars("?section=$section§ion_menu={$section_menu}&stype=$stype")); |
$tp->assign("FORM_ACTION", $PHP_SELF.HTMLSpecialChars("?section=$section§ion_menu={$section_menu}&stype=$stype")); |
129 |
$form = $tp->fetch("search.tpl"); |
$form = $tp->fetch("search.tpl"); |
130 |
|
if ($form) { |
131 |
|
global $onload; |
132 |
|
$onload .= "document.forms[1].elements[".($stype?2:1)."].focus();"; |
133 |
|
} |
134 |
return array($form, $qry_1, $qry_2); |
return array($form, $qry_1, $qry_2); |
135 |
} |
} |
136 |
?> |
?> |