Jump to content

removing some code without affecting searching feature


hookit

Recommended Posts

I have this page:

 

<?php 
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
set_magic_quotes_runtime(0);

include("include/dbcommon.php");
include("include/reuniones_variables.php");


//connect database
$conn = db_connect();

include('libs/xtempl.php');
$xt = new Xtempl();

//  Before Process event
if(function_exists("BeforeProcessSearch"))
    BeforeProcessSearch($conn);


$includes=
"<script language=\"JavaScript\" src=\"include/calendar.js\"></script>
<script language=\"JavaScript\" src=\"include/jsfunctions.js\"></script>\r\n";
$includes.="<script language=\"JavaScript\" src=\"include/jquery.js\"></script>";
if ($useAJAX) {
$includes.="<script language=\"JavaScript\" src=\"include/ajaxsuggest.js\"></script>\r\n";
}
$includes.="<script language=\"JavaScript\" type=\"text/javascript\">\r\n".
"var locale_dateformat = ".$locale_info["LOCALE_IDATE"].";\r\n".
"var locale_datedelimiter = \"".$locale_info["LOCALE_SDATE"]."\";\r\n".
"var bLoading=false;\r\n".
"var TEXT_PLEASE_SELECT='".addslashes("Por favor seleccione")."';\r\n";
if ($useAJAX) {
$includes.="var SUGGEST_TABLE = \"reuniones_searchsuggest.php\";\r\n";
}
$includes.="var detect = navigator.userAgent.toLowerCase();

function checkIt(string)
{
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
}


function ShowHideControls()
{
    document.getElementById('second_reuniones_id').style.display =  
        document.forms.editform.elements['asearchopt_reuniones_id'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_AREA').style.display =  
        document.forms.editform.elements['asearchopt_AREA'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_PROVINCIA').style.display =  
        document.forms.editform.elements['asearchopt_PROVINCIA'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_POBLACION').style.display =  
        document.forms.editform.elements['asearchopt_POBLACION'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_DIRECCION').style.display =  
        document.forms.editform.elements['asearchopt_DIRECCION'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_DIA').style.display =  
        document.forms.editform.elements['asearchopt_DIA'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_HORA').style.display =  
        document.forms.editform.elements['asearchopt_HORA'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_FORMATO').style.display =  
        document.forms.editform.elements['asearchopt_FORMATO'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_OBSERVACIONES').style.display =  
        document.forms.editform.elements['asearchopt_OBSERVACIONES'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_MAPA').style.display =  
        document.forms.editform.elements['asearchopt_MAPA'].value==\"Between\" ? '' : 'none'; 
    document.getElementById('second_TELEFONO').style.display =  
        document.forms.editform.elements['asearchopt_TELEFONO'].value==\"Between\" ? '' : 'none'; 
    return false;
}
function ResetControls()
{
    var i;
    e = document.forms[0].elements; 
    for (i=0;i<e.length;i++) 
    {
        if (e[i].name!='type' && e[i].className!='button' && e[i].type!='hidden')
        {
            if(e[i].type=='select-one')
                e[i].selectedIndex=0;
            else if(e[i].type=='select-multiple')
            {
                var j;
                for(j=0;j<e[i].options.length;j++)
                    e[i].options[j].selected=false;
            }
            else if(e[i].type=='checkbox' || e[i].type=='radio')
                e[i].checked=false;
            else 
                e[i].value = ''; 
        }
        else if(e[i].name.substr(0,6)=='value_' && e[i].type=='hidden')
            e[i].value = ''; 
    }
    ShowHideControls(); 
    return false;
}";

$includes.="
$(document).ready(function() {
    document.forms.editform.value_reuniones_id.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_reuniones_id,'advanced')};
    document.forms.editform.value1_reuniones_id.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_reuniones_id,'advanced1')};
    document.forms.editform.value_reuniones_id.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_reuniones_id,'advanced')};
    document.forms.editform.value1_reuniones_id.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_reuniones_id,'advanced1')};
    document.forms.editform.value_AREA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_AREA,'advanced')};
    document.forms.editform.value1_AREA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_AREA,'advanced1')};
    document.forms.editform.value_AREA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_AREA,'advanced')};
    document.forms.editform.value1_AREA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_AREA,'advanced1')};
    document.forms.editform.value_PROVINCIA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_PROVINCIA,'advanced')};
    document.forms.editform.value1_PROVINCIA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_PROVINCIA,'advanced1')};
    document.forms.editform.value_PROVINCIA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_PROVINCIA,'advanced')};
    document.forms.editform.value1_PROVINCIA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_PROVINCIA,'advanced1')};
    document.forms.editform.value_POBLACION.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_POBLACION,'advanced')};
    document.forms.editform.value1_POBLACION.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_POBLACION,'advanced1')};
    document.forms.editform.value_POBLACION.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_POBLACION,'advanced')};
    document.forms.editform.value1_POBLACION.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_POBLACION,'advanced1')};
    document.forms.editform.value_DIRECCION.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_DIRECCION,'advanced')};
    document.forms.editform.value1_DIRECCION.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_DIRECCION,'advanced1')};
    document.forms.editform.value_DIRECCION.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_DIRECCION,'advanced')};
    document.forms.editform.value1_DIRECCION.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_DIRECCION,'advanced1')};
    document.forms.editform.value_DIA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_DIA,'advanced')};
    document.forms.editform.value1_DIA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_DIA,'advanced1')};
    document.forms.editform.value_DIA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_DIA,'advanced')};
    document.forms.editform.value1_DIA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_DIA,'advanced1')};
    document.forms.editform.value_HORA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_HORA,'advanced')};
    document.forms.editform.value1_HORA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_HORA,'advanced1')};
    document.forms.editform.value_HORA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_HORA,'advanced')};
    document.forms.editform.value1_HORA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_HORA,'advanced1')};
    document.forms.editform.value_FORMATO.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_FORMATO,'advanced')};
    document.forms.editform.value1_FORMATO.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_FORMATO,'advanced1')};
    document.forms.editform.value_FORMATO.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_FORMATO,'advanced')};
    document.forms.editform.value1_FORMATO.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_FORMATO,'advanced1')};
    document.forms.editform.value_OBSERVACIONES.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_OBSERVACIONES,'advanced')};
    document.forms.editform.value1_OBSERVACIONES.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_OBSERVACIONES,'advanced1')};
    document.forms.editform.value_OBSERVACIONES.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_OBSERVACIONES,'advanced')};
    document.forms.editform.value1_OBSERVACIONES.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_OBSERVACIONES,'advanced1')};
    document.forms.editform.value_MAPA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_MAPA,'advanced')};
    document.forms.editform.value1_MAPA.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_MAPA,'advanced1')};
    document.forms.editform.value_MAPA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_MAPA,'advanced')};
    document.forms.editform.value1_MAPA.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_MAPA,'advanced1')};
    document.forms.editform.value_TELEFONO.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_TELEFONO,'advanced')};
    document.forms.editform.value1_TELEFONO.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_TELEFONO,'advanced1')};
    document.forms.editform.value_TELEFONO.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_TELEFONO,'advanced')};
    document.forms.editform.value1_TELEFONO.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_TELEFONO,'advanced1')};
});
</script>
<div id=\"search_suggest\"></div>
";



$all_checkbox="value=\"and\"";
$any_checkbox="value=\"or\"";

if(@$_SESSION[$strTableName."_asearchtype"]=="or")
    $any_checkbox.=" checked";
else
    $all_checkbox.=" checked";
$xt->assign("any_checkbox",$any_checkbox);
$xt->assign("all_checkbox",$all_checkbox);

$editformats=array();

// reuniones_id 
$opt="";
$not=false;
$control_reuniones_id=array();
$control_reuniones_id["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["reuniones_id"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["reuniones_id"];
    $control_reuniones_id["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["reuniones_id"];
}
$control_reuniones_id["func"]="xt_buildeditcontrol";
$control_reuniones_id["params"]["field"]="reuniones_id";
$control_reuniones_id["params"]["mode"]="search";
$xt->assignbyref("reuniones_id_editcontrol",$control_reuniones_id);
$control1_reuniones_id=$control_reuniones_id;
$control1_reuniones_id["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_reuniones_id["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["reuniones_id"];
$xt->assignbyref("reuniones_id_editcontrol1",$control1_reuniones_id);
    
$xt->assign_section("reuniones_id_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"reuniones_id\">","");
$reuniones_id_notbox="name=\"not_reuniones_id\"";
if($not)
    $reuniones_id_notbox=" checked";
$xt->assign("reuniones_id_notbox",$reuniones_id_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_reuniones_id\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_reuniones_id",$searchtype);
//  edit format
$editformats["reuniones_id"]="Text field";
// AREA 
$opt="";
$not=false;
$control_AREA=array();
$control_AREA["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["AREA"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["AREA"];
    $control_AREA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["AREA"];
}
$control_AREA["func"]="xt_buildeditcontrol";
$control_AREA["params"]["field"]="AREA";
$control_AREA["params"]["mode"]="search";
$xt->assignbyref("AREA_editcontrol",$control_AREA);
$control1_AREA=$control_AREA;
$control1_AREA["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_AREA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["AREA"];
$xt->assignbyref("AREA_editcontrol1",$control1_AREA);
    
$xt->assign_section("AREA_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"AREA\">","");
$AREA_notbox="name=\"not_AREA\"";
if($not)
    $AREA_notbox=" checked";
$xt->assign("AREA_notbox",$AREA_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">".""."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">".""."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_AREA\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_AREA",$searchtype);
//  edit format
$editformats["AREA"]="Text field";
// PROVINCIA 
$opt="";
$not=false;
$control_PROVINCIA=array();
$control_PROVINCIA["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["PROVINCIA"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["PROVINCIA"];
    $control_PROVINCIA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["PROVINCIA"];
}
$control_PROVINCIA["func"]="xt_buildeditcontrol";
$control_PROVINCIA["params"]["field"]="PROVINCIA";
$control_PROVINCIA["params"]["mode"]="search";
$xt->assignbyref("PROVINCIA_editcontrol",$control_PROVINCIA);
$control1_PROVINCIA=$control_PROVINCIA;
$control1_PROVINCIA["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_PROVINCIA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["PROVINCIA"];
$xt->assignbyref("PROVINCIA_editcontrol1",$control1_PROVINCIA);
    
$xt->assign_section("PROVINCIA_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"PROVINCIA\">","");
$PROVINCIA_notbox="name=\"not_PROVINCIA\"";
if($not)
    $PROVINCIA_notbox=" checked";
$xt->assign("PROVINCIA_notbox",$PROVINCIA_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_PROVINCIA\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_PROVINCIA",$searchtype);
//  edit format
$editformats["PROVINCIA"]="Text field";
// POBLACION 
$opt="";
$not=false;
$control_POBLACION=array();
$control_POBLACION["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["POBLACION"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["POBLACION"];
    $control_POBLACION["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["POBLACION"];
}
$control_POBLACION["func"]="xt_buildeditcontrol";
$control_POBLACION["params"]["field"]="POBLACION";
$control_POBLACION["params"]["mode"]="search";
$xt->assignbyref("POBLACION_editcontrol",$control_POBLACION);
$control1_POBLACION=$control_POBLACION;
$control1_POBLACION["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_POBLACION["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["POBLACION"];
$xt->assignbyref("POBLACION_editcontrol1",$control1_POBLACION);
    
$xt->assign_section("POBLACION_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"POBLACION\">","");
$POBLACION_notbox="name=\"not_POBLACION\"";
if($not)
    $POBLACION_notbox=" checked";
$xt->assign("POBLACION_notbox",$POBLACION_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_POBLACION\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_POBLACION",$searchtype);
//  edit format
$editformats["POBLACION"]="Text field";
// DIRECCION 
$opt="";
$not=false;
$control_DIRECCION=array();
$control_DIRECCION["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["DIRECCION"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["DIRECCION"];
    $control_DIRECCION["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["DIRECCION"];
}
$control_DIRECCION["func"]="xt_buildeditcontrol";
$control_DIRECCION["params"]["field"]="DIRECCION";
$control_DIRECCION["params"]["mode"]="search";
$xt->assignbyref("DIRECCION_editcontrol",$control_DIRECCION);
$control1_DIRECCION=$control_DIRECCION;
$control1_DIRECCION["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_DIRECCION["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["DIRECCION"];
$xt->assignbyref("DIRECCION_editcontrol1",$control1_DIRECCION);
    
$xt->assign_section("DIRECCION_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"DIRECCION\">","");
$DIRECCION_notbox="name=\"not_DIRECCION\"";
if($not)
    $DIRECCION_notbox=" checked";
$xt->assign("DIRECCION_notbox",$DIRECCION_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_DIRECCION\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_DIRECCION",$searchtype);
//  edit format
$editformats["DIRECCION"]="Text field";
// DIA 
$opt="";
$not=false;
$control_DIA=array();
$control_DIA["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["DIA"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["DIA"];
    $control_DIA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["DIA"];
}
$control_DIA["func"]="xt_buildeditcontrol";
$control_DIA["params"]["field"]="DIA";
$control_DIA["params"]["mode"]="search";
$xt->assignbyref("DIA_editcontrol",$control_DIA);
$control1_DIA=$control_DIA;
$control1_DIA["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_DIA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["DIA"];
$xt->assignbyref("DIA_editcontrol1",$control1_DIA);
    
$xt->assign_section("DIA_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"DIA\">","");
$DIA_notbox="name=\"not_DIA\"";
if($not)
    $DIA_notbox=" checked";
$xt->assign("DIA_notbox",$DIA_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_DIA\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_DIA",$searchtype);
//  edit format
$editformats["DIA"]="Text field";
// HORA 
$opt="";
$not=false;
$control_HORA=array();
$control_HORA["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["HORA"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["HORA"];
    $control_HORA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["HORA"];
}
$control_HORA["func"]="xt_buildeditcontrol";
$control_HORA["params"]["field"]="HORA";
$control_HORA["params"]["mode"]="search";
$xt->assignbyref("HORA_editcontrol",$control_HORA);
$control1_HORA=$control_HORA;
$control1_HORA["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_HORA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["HORA"];
$xt->assignbyref("HORA_editcontrol1",$control1_HORA);
    
$xt->assign_section("HORA_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"HORA\">","");
$HORA_notbox="name=\"not_HORA\"";
if($not)
    $HORA_notbox=" checked";
$xt->assign("HORA_notbox",$HORA_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_HORA\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_HORA",$searchtype);
//  edit format
$editformats["HORA"]="Text field";
// FORMATO 
$opt="";
$not=false;
$control_FORMATO=array();
$control_FORMATO["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["FORMATO"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["FORMATO"];
    $control_FORMATO["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["FORMATO"];
}
$control_FORMATO["func"]="xt_buildeditcontrol";
$control_FORMATO["params"]["field"]="FORMATO";
$control_FORMATO["params"]["mode"]="search";
$xt->assignbyref("FORMATO_editcontrol",$control_FORMATO);
$control1_FORMATO=$control_FORMATO;
$control1_FORMATO["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_FORMATO["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["FORMATO"];
$xt->assignbyref("FORMATO_editcontrol1",$control1_FORMATO);
    
$xt->assign_section("FORMATO_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"FORMATO\">","");
$FORMATO_notbox="name=\"not_FORMATO\"";
if($not)
    $FORMATO_notbox=" checked";
$xt->assign("FORMATO_notbox",$FORMATO_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_FORMATO\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_FORMATO",$searchtype);
//  edit format
$editformats["FORMATO"]="Text field";
// OBSERVACIONES 
$opt="";
$not=false;
$control_OBSERVACIONES=array();
$control_OBSERVACIONES["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["OBSERVACIONES"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["OBSERVACIONES"];
    $control_OBSERVACIONES["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["OBSERVACIONES"];
}
$control_OBSERVACIONES["func"]="xt_buildeditcontrol";
$control_OBSERVACIONES["params"]["field"]="OBSERVACIONES";
$control_OBSERVACIONES["params"]["mode"]="search";
$xt->assignbyref("OBSERVACIONES_editcontrol",$control_OBSERVACIONES);
$control1_OBSERVACIONES=$control_OBSERVACIONES;
$control1_OBSERVACIONES["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_OBSERVACIONES["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["OBSERVACIONES"];
$xt->assignbyref("OBSERVACIONES_editcontrol1",$control1_OBSERVACIONES);
    
$xt->assign_section("OBSERVACIONES_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"OBSERVACIONES\">","");
$OBSERVACIONES_notbox="name=\"not_OBSERVACIONES\"";
if($not)
    $OBSERVACIONES_notbox=" checked";
$xt->assign("OBSERVACIONES_notbox",$OBSERVACIONES_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_OBSERVACIONES\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_OBSERVACIONES",$searchtype);
//  edit format
$editformats["OBSERVACIONES"]="Text field";
// MAPA 
$opt="";
$not=false;
$control_MAPA=array();
$control_MAPA["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["MAPA"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["MAPA"];
    $control_MAPA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["MAPA"];
}
$control_MAPA["func"]="xt_buildeditcontrol";
$control_MAPA["params"]["field"]="MAPA";
$control_MAPA["params"]["mode"]="search";
$xt->assignbyref("MAPA_editcontrol",$control_MAPA);
$control1_MAPA=$control_MAPA;
$control1_MAPA["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_MAPA["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["MAPA"];
$xt->assignbyref("MAPA_editcontrol1",$control1_MAPA);
    
$xt->assign_section("MAPA_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"MAPA\">","");
$MAPA_notbox="name=\"not_MAPA\"";
if($not)
    $MAPA_notbox=" checked";
$xt->assign("MAPA_notbox",$MAPA_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_MAPA\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_MAPA",$searchtype);
//  edit format
$editformats["MAPA"]="Text field";
// TELEFONO 
$opt="";
$not=false;
$control_TELEFONO=array();
$control_TELEFONO["params"] = array();
if(@$_SESSION[$strTableName."_search"]==2)
{
    $opt=@$_SESSION[$strTableName."_asearchopt"]["TELEFONO"];
    $not=@$_SESSION[$strTableName."_asearchnot"]["TELEFONO"];
    $control_TELEFONO["params"]["value"]=@$_SESSION[$strTableName."_asearchfor"]["TELEFONO"];
}
$control_TELEFONO["func"]="xt_buildeditcontrol";
$control_TELEFONO["params"]["field"]="TELEFONO";
$control_TELEFONO["params"]["mode"]="search";
$xt->assignbyref("TELEFONO_editcontrol",$control_TELEFONO);
$control1_TELEFONO=$control_TELEFONO;
$control1_TELEFONO["params"]["second"]=true;
if(@$_SESSION[$strTableName."_search"]==2)
    $control1_TELEFONO["params"]["value"]=@$_SESSION[$strTableName."_asearchfor2"]["TELEFONO"];
$xt->assignbyref("TELEFONO_editcontrol1",$control1_TELEFONO);
    
$xt->assign_section("TELEFONO_fieldblock","<input type=\"Hidden\" name=\"asearchfield[]\" value=\"TELEFONO\">","");
$TELEFONO_notbox="name=\"not_TELEFONO\"";
if($not)
    $TELEFONO_notbox=" checked";
$xt->assign("TELEFONO_notbox",$TELEFONO_notbox);

//  write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_TELEFONO\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$xt->assign("searchtype_TELEFONO",$searchtype);
//  edit format
$editformats["TELEFONO"]="Text field";

$linkdata="";

$linkdata .= "<script type=\"text/javascript\">\r\n";

if ($useAJAX) {
}
else
{
}
$linkdata.="</script>\r\n";


$body=array();
$body["begin"]=$includes;
$body["end"]=$linkdata."<script>ShowHideControls()</script>";
$xt->assignbyref("body",$body);

$contents_block=array();
$contents_block["begin"]="<form method=\"POST\" ";
if(isset( $_GET["rname"]))
{
    $contents_block["begin"].="action=\"dreport.php?rname=".$_GET["rname"]."\" ";
}   
else if(isset( $_GET["cname"]))
{
    $contents_block["begin"].="action=\"dchart.php?cname=".$_GET["cname"]."\" ";
}   
else
{
$contents_block["begin"].="action=\"reuniones_list.php\" ";
}
$contents_block["begin"].="name=\"editform\"><input type=\"hidden\" id=\"a\" name=\"a\" value=\"advsearch\">";
$contents_block["end"]="</form>";
$xt->assignbyref("contents_block",$contents_block);

$xt->assign("searchbutton_attrs","name=\"SearchButton\" onclick=\"javascript&#058;document.forms.editform.submit();\"");
$xt->assign("resetbutton_attrs","onclick=\"return ResetControls();\"");

$xt->assign("backbutton_attrs","onclick=\"javascript&#058; document.forms.editform.a.value='return'; document.forms.editform.submit();\"");

$xt->assign("conditions_block",true);
$xt->assign("search_button",true);
$xt->assign("reset_button",true);
$xt->assign("back_button",true);

if ( isset( $_GET["rname"] ) ) {
    $xt->assign("dynamic", "true");
    $xt->assign("rname", $_GET["rname"]);
}
if ( isset( $_GET["cname"] ) ) {
    $xt->assign("dynamic", "true");
    $xt->assign("cname", $_GET["cname"]);
}
    
$templatefile = "reuniones_search.htm";
if(function_exists("BeforeShowSearch"))
    BeforeShowSearch($xt,$templatefile);

$xt->display($templatefile);

?>

 

I would like to replace the OPTIONS VALUE in all the textfields for only one searching criteria "contains". Leaving the possibility of combining the fields for a searching.

 

Any idea?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.