/[health_html]/inc/search.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/search.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by ravilov, Thu Aug 30 16:35:36 2001 UTC revision 1.6 by ravilov, Tue Sep 25 15:38:04 2001 UTC
# Line 62  Line 62 
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;
# Line 99  Line 99 
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;
# Line 127  Line 127 
127                  $tp->assign("section_menu", $section_menu);                  $tp->assign("section_menu", $section_menu);
128                  $tp->assign("FORM_ACTION", $PHP_SELF.HTMLSpecialChars("?section=$section&section_menu={$section_menu}&stype=$stype"));                  $tp->assign("FORM_ACTION", $PHP_SELF.HTMLSpecialChars("?section=$section&section_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  ?>  ?>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.26