Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/sys_advanced.txt
<?php
/*
OpenDataBag - Data Web Interface
Copyright (C) 2004 Nawara

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

//get bags
$bag_array=array();
$bag_array['']=0;
$result_array=search('MyBag');
$sizeof=sizeof($result_array);
for($ii=0;$ii<$sizeof;$ii++)
{
  $variable_array=$result_array[$ii];
  $explode_array=explode(' ',$variable_array['MyBag']['value']);
  $jjsizeof=sizeof($explode_array);
  for($jj=0;$jj<$jjsizeof;$jj++)
  {
    $bag=ucfirst(trim($explode_array[$jj]));
    if($bag)
    {
      if(isset($bag_array[$bag]))
      {
        $bag_array[$bag]++;
        $overall_sum++;
      }
      else
        $bag_array[$bag]=0;
    }
  }
}

ksort($bag_array);

echo '<div class="supergroup">';

echo '<h2>Advanced Search</h2>';

echo('<form action="index.php#top" method="post">');
echo('<input name="odb_run" type="hidden" value="advanced"></input>');

//---------------------------------------------------------------------------------------
echo '<table class="recordTabs">';
  echo '<tr>';
    echo '<td class="tabon">';
      echo 'Basic search';
    echo '</td>';
  echo '</tr>';
echo '</table>';

echo '<table style="width:600px;">'; 
  
  echo '<tr>';
    echo '<td style="width:250px;">';
      echo('in <b>bag</b> defined');
    echo '</td>';
    echo '<td>';
      echo '<select class="bag" name="odb_new_bag">';
      echo '<option value="'.get('bag').'">'.split_label(get('bag')).'</option>';
      reset($bag_array);
      while(list($key,$val)=each($bag_array))
        echo '<option value="'.$key.'">'.split_label($key).'</option>';
      echo '</select>';
    echo '</td>';
  echo '</tr>';
  
  echo '<tr>';
    echo '<td>';
      echo('with <b>all</b> of the words');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_with" type="text" value="'.$search.'" />');
    echo '</td>';
  echo '</tr>';
  
  echo '<tr>';
    echo '<td>';
      echo('<b>without</b> the words');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_without" type="text" value=""></input>');
    echo '</td>';
  echo '</tr>';
  
echo '</table>'; 
  
//---------------------------------------------------------------------------------------
echo '<table class="recordTabs">';
  echo '<tr>';
    echo '<td class="tabon">';
      echo 'Range search';
    echo '</td>';
  echo '</tr>';
echo '</table>';

echo '<table style="width:600px;">'; 
  
  echo '<tr>';
    echo '<td style="width:250px;">';
      echo('with field <b>equal</b> to value');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_eqfield1" type="text" value=""></input>'); echo(' = <input name="odb_eqvalue1" type="text" value=""></input>');
    echo '</td>';
  echo '</tr>';
  
  echo '<tr>';
    echo '<td>';
      echo('with field <b>greater</b> than value');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_gtfield1" type="text" value=""></input>'); echo(' &gt; <input name="odb_gtvalue1" type="text" value=""></input>');
    echo '</td>';
  echo '</tr>';
  
  /*
  echo '<tr>';
    echo '<td>';
      echo('with field <b>lesser</b> than value');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_ltfield1" type="text" value=""></input>'); echo(' &lt; <input name="odb_ltvalue1" type="text" value=""></input>');
    echo '</td>';
  echo '</tr>';
  */
echo '</table>'; 


 //---------------------------------------------------------------------------------------
echo '<table class="recordTabs">';
  echo '<tr>';
    echo '<td class="tabon">';
      echo 'Changes search';
    echo '</td>';
  echo '</tr>';
echo '</table>';

echo '<table style="width:600px;">'; 
  
  echo '<tr>';
    echo '<td style="width:250px;">';
      echo('only <b>modified by</b> user');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_modby" type="text" value="" />');
    echo '</td>';
  echo '</tr>';
  
  /*
  echo '<tr>';
    echo '<td>';
      echo('only modified <b>on</b> date');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_modon" type="text" value="" />');
    echo '</td>';
  echo '</tr>';
  */
  
  /*
  echo '<tr>';
    echo '<td>';
      echo('only modified <b>after</b> date');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_modfrom" type="text" value="" />');
    echo '</td>';
  echo '</tr>';
  */
  
  echo '<tr>';
    echo '<td>';
      echo('only modified <b>before</b> date');
    echo '</td>';
    echo '<td>';
      echo('<input name="odb_modto" type="text" value="" />');
    echo '</td>';
  echo '</tr>';

  echo '<tr>';
    echo '<td>';
      echo('show also <b>deleted</b> records');
    echo '</td>';
    echo '<td>';
      echo('<select name="odb_showall">');
        echo('<option></option>');
        echo('<option value="0">No</option>');
        echo('<option value="1">Yes</option>');
      echo('</select>');
    echo '</td>';
  echo '</tr>';

  echo '<tr>';
    echo '<td colspan="2" style="text-align: right;">';
      echo('<input class="submit" type="submit" value="Search" />');
    echo '</td>';
  echo '</tr>';

echo '</table>'; 


/*
echo('<div class="advsearch_block block4">');
  echo('<div class="advsearch_label">');
    echo('only data <b>valid</b> on date');
    echo('<span class="advsearch_input">');
      echo('<input name="odb_vdate" type="text" value=""></input>');
    echo('</span>');
  echo('</div>');

  echo('<div class="advsearch_label">');
    echo('show also <b>deleted</b> records');
    echo('<span class="advsearch_input">');
      echo('<select name="odb_showall">');
        echo('<option></option>');
        echo('<option value="0">No</option>');
        echo('<option value="1">Yes</option>');
      echo('</select>');
    echo('</span>');
  echo('</div>');
echo('</div>');

echo('<div class="advsearch_block block5">');
  echo('<div class="advsearch_label">');
    echo('with <b>function</b> and arguments');
    echo('<span class="advsearch_input">');
      echo('<select name="odb_fn">');
        echo('<option></option>');
        $res=opendir(cfg_system_path.'/script');
        while($fl = readdir($res)) 
        {
          if(substr($fl,0,3)=='fn_')
            echo('<option>'.substr($fl,3,-4).'</option>');
        }
        closedir($res);
      echo('</select>');
      echo('<input name="odb_inner" type="text" value=""></input>');
    echo('</span>');
  echo('</div>');
echo('</div>');

*/

echo('</form></div>');

?>
Return current item: OpenBizMap