Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/run_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.
*/

/*
Action execution

IN $id - current record id
*/

$search='';

//-----------------------------------------------------
$new_bag=get('new_bag');
if($bag!=$new_bag)
{
  $search.='MyBag:'.$new_bag;
  $bag=$new_bag;
}

//-----------------------------------------------------
$with=get('with');
$search.=' '.$with;

//-----------------------------------------------------
$without=get('without');
$without_array=explode(' ',$without);
$sizeof=sizeof($without_array);
for($ii=0;$ii<$sizeof;$ii++)
  if(strlen($without_array[$ii]))
    $search.=' -'.$without_array[$ii];

//-----------------------------------------------------
$eqfield1=get('eqfield1');
$eqvalue1=get('eqvalue1');
$eqfield2=get('eqfield2');
$eqvalue2=get('eqvalue2');
$eqfield3=get('eqfield3');
$eqvalue3=get('eqvalue3');

if(strlen($eqfield1) and strlen($eqvalue1)) $search.=' '.$eqfield1.':'.$eqvalue1;
if(strlen($eqfield2) and strlen($eqvalue2)) $search.=' '.$eqfield2.':'.$eqvalue2;
if(strlen($eqfield3) and strlen($eqvalue3)) $search.=' '.$eqfield3.':'.$eqvalue3;

//-----------------------------------------------------
$gtfield1=get('gtfield1');
$gtvalue1=get('gtvalue1');
$gtfield2=get('gtfield2');
$gtvalue2=get('gtvalue2');
$gtfield3=get('gtfield3');
$gtvalue3=get('gtvalue3');

if(strlen($gtfield1) and strlen($gtvalue1)) $search.=' '.$gtfield1.'>'.$gtvalue1;
if(strlen($gtfield2) and strlen($gtvalue2)) $search.=' '.$gtfield2.'>'.$gtvalue2;
if(strlen($gtfield3) and strlen($gtvalue3)) $search.=' '.$gtfield3.'>'.$gtvalue3;

//-----------------------------------------------------
$ltfield1=get('ltfield1');
$ltvalue1=get('ltvalue1');
$ltfield2=get('ltfield2');
$ltvalue2=get('ltvalue2');
$ltfield3=get('ltfield3');
$ltvalue3=get('ltvalue3');

if(strlen($ltfield1) and strlen($ltvalue1)) $search.=' '.$ltfield1.'<'.$ltvalue1;
if(strlen($ltfield2) and strlen($ltvalue2)) $search.=' '.$ltfield2.'<'.$ltvalue2;
if(strlen($ltfield3) and strlen($ltvalue3)) $search.=' '.$ltfield3.'<'.$ltvalue3;

//-----------------------------------------------------
$modfrom=get('modfrom');
$modto=get('modto');
$modon=get('modon');
$modby=get('modby');
$vdate=get('vdate');

if(strlen($modfrom)>0) $search.=' sysModOn>'.$modfrom;
if(strlen($modto)>0) $search.=' sysModOn<'.$modto;
if(strlen($modon)>0) $search.=' sysModOn:'.$modon;
if(strlen($modby)>0) $search.=' sysModBy:'.$modby;
if(strlen($vdate)>0) $search.=' sysValidOn:'.$vdate;

//-----------------------------------------------------
$showall=get('showall');

if($showall=='1') $search.=' sysShow:All';
if($showall=='0') $search.=' sysShow:Valid';


//-----------------------------------------------------
$fn=get('fn');
$inner=get('inner');

if(strlen($fn)>0)
  $search='='.$fn.'('.trim($search).','.$inner.')';
  
$search=trim($search);

?>
Return current item: OpenBizMap