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

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


//connect database
$conn = db_connect();

include('libs/Smarty.class.php');
$smarty = new Smarty();


$includes=
"<STYLE>
	.vis1	{ visibility:\"visible\" }
	.vis2	{ visibility:\"hidden\" }
</STYLE>
<script language=\"JavaScript\" src=\"include/calendar.js\"></script>
<script language=\"JavaScript\" src=\"include/jsfunctions.js\"></script>\r\n";
if ($useAJAX) {
$includes.="<script language=\"JavaScript\" src=\"include/jquery.js\"></script>
<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 = \"pf_proceso_searchsuggest.php\";\r\n".
"var SUGGEST_LOOKUP_TABLE='pf_proceso_lookupsuggest.php';\r\n".
"var AUTOCOMPLETE_TABLE=\"pf_proceso_autocomplete.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_fecha_inicio').style.display =  
		document.forms.editform.elements['asearchopt_fecha_inicio'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_proceso').style.display =  
		document.forms.editform.elements['asearchopt_id_proceso'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_camara').style.display =  
		document.forms.editform.elements['asearchopt_id_camara'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_fin').style.display =  
		document.forms.editform.elements['asearchopt_fecha_fin'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_ultcam').style.display =  
		document.forms.editform.elements['asearchopt_fecha_ultcam'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_estado').style.display =  
		document.forms.editform.elements['asearchopt_estado'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_frecuencia').style.display =  
		document.forms.editform.elements['asearchopt_frecuencia'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_creador_inicial').style.display =  
		document.forms.editform.elements['asearchopt_creador_inicial'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_inicio_giro1').style.display =  
		document.forms.editform.elements['asearchopt_fecha_inicio_giro1'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_fin_giro1').style.display =  
		document.forms.editform.elements['asearchopt_fecha_fin_giro1'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_inicio_giro2').style.display =  
		document.forms.editform.elements['asearchopt_fecha_inicio_giro2'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_fin_giro2').style.display =  
		document.forms.editform.elements['asearchopt_fecha_fin_giro2'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_inicio_giro3').style.display =  
		document.forms.editform.elements['asearchopt_fecha_inicio_giro3'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_fecha_fin_giro3').style.display =  
		document.forms.editform.elements['asearchopt_fecha_fin_giro3'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_Pallets').style.display =  
		document.forms.editform.elements['asearchopt_Pallets'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_Puchos').style.display =  
		document.forms.editform.elements['asearchopt_Puchos'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_bins').style.display =  
		document.forms.editform.elements['asearchopt_bins'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_origen').style.display =  
		document.forms.editform.elements['asearchopt_origen'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_destino').style.display =  
		document.forms.editform.elements['asearchopt_destino'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_especie').style.display =  
		document.forms.editform.elements['asearchopt_id_especie'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_envase').style.display =  
		document.forms.editform.elements['asearchopt_id_envase'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_condicion_inicial').style.display =  
		document.forms.editform.elements['asearchopt_condicion_inicial'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_num_giros').style.display =  
		document.forms.editform.elements['asearchopt_num_giros'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_creador_final').style.display =  
		document.forms.editform.elements['asearchopt_creador_final'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_condicion_final').style.display =  
		document.forms.editform.elements['asearchopt_condicion_final'].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;
}";

if ($useAJAX) {
$includes.="
$(document).ready(function() {
	document.forms.editform.value_fecha_inicio.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_inicio,'advanced')};
	document.forms.editform.value1_fecha_inicio.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_inicio,'advanced1')};
	document.forms.editform.value_fecha_inicio.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_inicio,'advanced')};
	document.forms.editform.value1_fecha_inicio.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_inicio,'advanced1')};
	document.forms.editform.value_id_proceso.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_proceso,'advanced')};
	document.forms.editform.value1_id_proceso.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_proceso,'advanced1')};
	document.forms.editform.value_id_proceso.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_proceso,'advanced')};
	document.forms.editform.value1_id_proceso.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_proceso,'advanced1')};
	document.forms.editform.value_id_camara.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_camara,'advanced')};
	document.forms.editform.value1_id_camara.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_camara,'advanced1')};
	document.forms.editform.value_id_camara.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_camara,'advanced')};
	document.forms.editform.value1_id_camara.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_camara,'advanced1')};
	document.forms.editform.value_fecha_fin.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_fin,'advanced')};
	document.forms.editform.value1_fecha_fin.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_fin,'advanced1')};
	document.forms.editform.value_fecha_fin.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_fin,'advanced')};
	document.forms.editform.value1_fecha_fin.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_fin,'advanced1')};
	document.forms.editform.value_fecha_ultcam.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_ultcam,'advanced')};
	document.forms.editform.value1_fecha_ultcam.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_ultcam,'advanced1')};
	document.forms.editform.value_fecha_ultcam.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_ultcam,'advanced')};
	document.forms.editform.value1_fecha_ultcam.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_ultcam,'advanced1')};
	document.forms.editform.value_estado.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_estado,'advanced')};
	document.forms.editform.value1_estado.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_estado,'advanced1')};
	document.forms.editform.value_estado.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_estado,'advanced')};
	document.forms.editform.value1_estado.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_estado,'advanced1')};
	document.forms.editform.value_frecuencia.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_frecuencia,'advanced')};
	document.forms.editform.value1_frecuencia.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_frecuencia,'advanced1')};
	document.forms.editform.value_frecuencia.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_frecuencia,'advanced')};
	document.forms.editform.value1_frecuencia.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_frecuencia,'advanced1')};
	document.forms.editform.value_creador_inicial.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_creador_inicial,'advanced')};
	document.forms.editform.value1_creador_inicial.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_creador_inicial,'advanced1')};
	document.forms.editform.value_creador_inicial.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_creador_inicial,'advanced')};
	document.forms.editform.value1_creador_inicial.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_creador_inicial,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro1.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_inicio_giro1,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro1.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_inicio_giro1,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro1.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_inicio_giro1,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro1.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_inicio_giro1,'advanced1')};
	document.forms.editform.value_fecha_fin_giro1.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_fin_giro1,'advanced')};
	document.forms.editform.value1_fecha_fin_giro1.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_fin_giro1,'advanced1')};
	document.forms.editform.value_fecha_fin_giro1.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_fin_giro1,'advanced')};
	document.forms.editform.value1_fecha_fin_giro1.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_fin_giro1,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro2.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_inicio_giro2,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro2.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_inicio_giro2,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro2.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_inicio_giro2,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro2.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_inicio_giro2,'advanced1')};
	document.forms.editform.value_fecha_fin_giro2.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_fin_giro2,'advanced')};
	document.forms.editform.value1_fecha_fin_giro2.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_fin_giro2,'advanced1')};
	document.forms.editform.value_fecha_fin_giro2.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_fin_giro2,'advanced')};
	document.forms.editform.value1_fecha_fin_giro2.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_fin_giro2,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro3.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_inicio_giro3,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro3.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_inicio_giro3,'advanced1')};
	document.forms.editform.value_fecha_inicio_giro3.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_inicio_giro3,'advanced')};
	document.forms.editform.value1_fecha_inicio_giro3.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_inicio_giro3,'advanced1')};
	document.forms.editform.value_fecha_fin_giro3.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_fecha_fin_giro3,'advanced')};
	document.forms.editform.value1_fecha_fin_giro3.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_fecha_fin_giro3,'advanced1')};
	document.forms.editform.value_fecha_fin_giro3.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_fecha_fin_giro3,'advanced')};
	document.forms.editform.value1_fecha_fin_giro3.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_fecha_fin_giro3,'advanced1')};
	document.forms.editform.value_Pallets.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_Pallets,'advanced')};
	document.forms.editform.value1_Pallets.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_Pallets,'advanced1')};
	document.forms.editform.value_Pallets.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_Pallets,'advanced')};
	document.forms.editform.value1_Pallets.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_Pallets,'advanced1')};
	document.forms.editform.value_Puchos.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_Puchos,'advanced')};
	document.forms.editform.value1_Puchos.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_Puchos,'advanced1')};
	document.forms.editform.value_Puchos.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_Puchos,'advanced')};
	document.forms.editform.value1_Puchos.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_Puchos,'advanced1')};
	document.forms.editform.value_bins.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_bins,'advanced')};
	document.forms.editform.value1_bins.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_bins,'advanced1')};
	document.forms.editform.value_bins.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_bins,'advanced')};
	document.forms.editform.value1_bins.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_bins,'advanced1')};
	document.forms.editform.value_origen.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_origen,'advanced')};
	document.forms.editform.value1_origen.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_origen,'advanced1')};
	document.forms.editform.value_origen.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_origen,'advanced')};
	document.forms.editform.value1_origen.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_origen,'advanced1')};
	document.forms.editform.value_destino.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_destino,'advanced')};
	document.forms.editform.value1_destino.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_destino,'advanced1')};
	document.forms.editform.value_destino.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_destino,'advanced')};
	document.forms.editform.value1_destino.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_destino,'advanced1')};
	document.forms.editform.value_id_especie.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_especie,'advanced')};
	document.forms.editform.value1_id_especie.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_especie,'advanced1')};
	document.forms.editform.value_id_especie.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_especie,'advanced')};
	document.forms.editform.value1_id_especie.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_especie,'advanced1')};
	document.forms.editform.value_id_envase.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_envase,'advanced')};
	document.forms.editform.value1_id_envase.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_envase,'advanced1')};
	document.forms.editform.value_id_envase.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_envase,'advanced')};
	document.forms.editform.value1_id_envase.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_envase,'advanced1')};
	document.forms.editform.value_condicion_inicial.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_condicion_inicial,'advanced')};
	document.forms.editform.value1_condicion_inicial.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_condicion_inicial,'advanced1')};
	document.forms.editform.value_condicion_inicial.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_condicion_inicial,'advanced')};
	document.forms.editform.value1_condicion_inicial.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_condicion_inicial,'advanced1')};
	document.forms.editform.value_num_giros.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_num_giros,'advanced')};
	document.forms.editform.value1_num_giros.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_num_giros,'advanced1')};
	document.forms.editform.value_num_giros.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_num_giros,'advanced')};
	document.forms.editform.value1_num_giros.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_num_giros,'advanced1')};
	document.forms.editform.value_creador_final.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_creador_final,'advanced')};
	document.forms.editform.value1_creador_final.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_creador_final,'advanced1')};
	document.forms.editform.value_creador_final.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_creador_final,'advanced')};
	document.forms.editform.value1_creador_final.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_creador_final,'advanced1')};
	document.forms.editform.value_condicion_final.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_condicion_final,'advanced')};
	document.forms.editform.value1_condicion_final.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_condicion_final,'advanced1')};
	document.forms.editform.value_condicion_final.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_condicion_final,'advanced')};
	document.forms.editform.value1_condicion_final.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_condicion_final,'advanced1')};
});
</script>
<div id=\"search_suggest\"></div>
";
} else {
$includes.="
function OnKeyDown(e)
{ if(!e) e = window.event; 
if (e.keyCode == 13){ e.cancel = true; document.forms[0].submit();} }

</script>";
}

$smarty->assign("includes",$includes);
$smarty->assign("noAJAX",!$useAJAX);

$onload="onLoad=\"javascript: ShowHideControls();\"";
$smarty->assign("onload",$onload);

if(@$_SESSION[$strTableName."_asearchtype"]=="or")
{
	$smarty->assign("any_checked"," checked");
	$smarty->assign("all_checked","");
}
else
{
	$smarty->assign("any_checked","");
	$smarty->assign("all_checked"," checked");
}

$editformats=array();

// fecha_inicio 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_inicio"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_inicio"];
	$smarty->assign("value_fecha_inicio",@$_SESSION[$strTableName."_asearchfor"]["fecha_inicio"]);
	$smarty->assign("value1_fecha_inicio",@$_SESSION[$strTableName."_asearchfor2"]["fecha_inicio"]);
}	
if($not)
	$smarty->assign("not_fecha_inicio"," checked");
//	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_fecha_inicio\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_inicio",$searchtype);
//	edit format
$editformats["fecha_inicio"]="Text field";
// id_proceso 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_proceso"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_proceso"];
	$smarty->assign("value_id_proceso",@$_SESSION[$strTableName."_asearchfor"]["id_proceso"]);
	$smarty->assign("value1_id_proceso",@$_SESSION[$strTableName."_asearchfor2"]["id_proceso"]);
}	
if($not)
	$smarty->assign("not_id_proceso"," checked");
//	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_id_proceso\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_proceso",$searchtype);
//	edit format
$editformats["id_proceso"]="Text field";
// id_camara 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_camara"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_camara"];
	$smarty->assign("value_id_camara",@$_SESSION[$strTableName."_asearchfor"]["id_camara"]);
	$smarty->assign("value1_id_camara",@$_SESSION[$strTableName."_asearchfor2"]["id_camara"]);
}	
if($not)
	$smarty->assign("not_id_camara"," checked");
//	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_id_camara\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_camara",$searchtype);
//	edit format
$editformats["id_camara"]="Text field";
// fecha_fin 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_fin"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_fin"];
	$smarty->assign("value_fecha_fin",@$_SESSION[$strTableName."_asearchfor"]["fecha_fin"]);
	$smarty->assign("value1_fecha_fin",@$_SESSION[$strTableName."_asearchfor2"]["fecha_fin"]);
}	
if($not)
	$smarty->assign("not_fecha_fin"," checked");
//	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_fecha_fin\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_fin",$searchtype);
//	edit format
$editformats["fecha_fin"]="Text field";
// fecha_ultcam 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_ultcam"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_ultcam"];
	$smarty->assign("value_fecha_ultcam",@$_SESSION[$strTableName."_asearchfor"]["fecha_ultcam"]);
	$smarty->assign("value1_fecha_ultcam",@$_SESSION[$strTableName."_asearchfor2"]["fecha_ultcam"]);
}	
if($not)
	$smarty->assign("not_fecha_ultcam"," checked");
//	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_fecha_ultcam\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_ultcam",$searchtype);
//	edit format
$editformats["fecha_ultcam"]="Text field";
// estado 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["estado"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["estado"];
	$smarty->assign("value_estado",@$_SESSION[$strTableName."_asearchfor"]["estado"]);
	$smarty->assign("value1_estado",@$_SESSION[$strTableName."_asearchfor2"]["estado"]);
}	
if($not)
	$smarty->assign("not_estado"," checked");
//	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_estado\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_estado",$searchtype);
//	edit format
$editformats["estado"]="Text field";
// frecuencia 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["frecuencia"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["frecuencia"];
	$smarty->assign("value_frecuencia",@$_SESSION[$strTableName."_asearchfor"]["frecuencia"]);
	$smarty->assign("value1_frecuencia",@$_SESSION[$strTableName."_asearchfor2"]["frecuencia"]);
}	
if($not)
	$smarty->assign("not_frecuencia"," checked");
//	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_frecuencia\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_frecuencia",$searchtype);
//	edit format
$editformats["frecuencia"]="Text field";
// creador_inicial 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["creador_inicial"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["creador_inicial"];
	$smarty->assign("value_creador_inicial",@$_SESSION[$strTableName."_asearchfor"]["creador_inicial"]);
	$smarty->assign("value1_creador_inicial",@$_SESSION[$strTableName."_asearchfor2"]["creador_inicial"]);
}	
if($not)
	$smarty->assign("not_creador_inicial"," checked");
//	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_creador_inicial\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_creador_inicial",$searchtype);
//	edit format
$editformats["creador_inicial"]="Text field";
// fecha_inicio_giro1 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_inicio_giro1"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_inicio_giro1"];
	$smarty->assign("value_fecha_inicio_giro1",@$_SESSION[$strTableName."_asearchfor"]["fecha_inicio_giro1"]);
	$smarty->assign("value1_fecha_inicio_giro1",@$_SESSION[$strTableName."_asearchfor2"]["fecha_inicio_giro1"]);
}	
if($not)
	$smarty->assign("not_fecha_inicio_giro1"," checked");
//	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_fecha_inicio_giro1\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_inicio_giro1",$searchtype);
//	edit format
$editformats["fecha_inicio_giro1"]="Text field";
// fecha_fin_giro1 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_fin_giro1"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_fin_giro1"];
	$smarty->assign("value_fecha_fin_giro1",@$_SESSION[$strTableName."_asearchfor"]["fecha_fin_giro1"]);
	$smarty->assign("value1_fecha_fin_giro1",@$_SESSION[$strTableName."_asearchfor2"]["fecha_fin_giro1"]);
}	
if($not)
	$smarty->assign("not_fecha_fin_giro1"," checked");
//	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_fecha_fin_giro1\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_fin_giro1",$searchtype);
//	edit format
$editformats["fecha_fin_giro1"]="Text field";
// fecha_inicio_giro2 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_inicio_giro2"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_inicio_giro2"];
	$smarty->assign("value_fecha_inicio_giro2",@$_SESSION[$strTableName."_asearchfor"]["fecha_inicio_giro2"]);
	$smarty->assign("value1_fecha_inicio_giro2",@$_SESSION[$strTableName."_asearchfor2"]["fecha_inicio_giro2"]);
}	
if($not)
	$smarty->assign("not_fecha_inicio_giro2"," checked");
//	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_fecha_inicio_giro2\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_inicio_giro2",$searchtype);
//	edit format
$editformats["fecha_inicio_giro2"]="Text field";
// fecha_fin_giro2 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_fin_giro2"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_fin_giro2"];
	$smarty->assign("value_fecha_fin_giro2",@$_SESSION[$strTableName."_asearchfor"]["fecha_fin_giro2"]);
	$smarty->assign("value1_fecha_fin_giro2",@$_SESSION[$strTableName."_asearchfor2"]["fecha_fin_giro2"]);
}	
if($not)
	$smarty->assign("not_fecha_fin_giro2"," checked");
//	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_fecha_fin_giro2\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_fin_giro2",$searchtype);
//	edit format
$editformats["fecha_fin_giro2"]="Text field";
// fecha_inicio_giro3 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_inicio_giro3"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_inicio_giro3"];
	$smarty->assign("value_fecha_inicio_giro3",@$_SESSION[$strTableName."_asearchfor"]["fecha_inicio_giro3"]);
	$smarty->assign("value1_fecha_inicio_giro3",@$_SESSION[$strTableName."_asearchfor2"]["fecha_inicio_giro3"]);
}	
if($not)
	$smarty->assign("not_fecha_inicio_giro3"," checked");
//	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_fecha_inicio_giro3\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_inicio_giro3",$searchtype);
//	edit format
$editformats["fecha_inicio_giro3"]="Text field";
// fecha_fin_giro3 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["fecha_fin_giro3"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["fecha_fin_giro3"];
	$smarty->assign("value_fecha_fin_giro3",@$_SESSION[$strTableName."_asearchfor"]["fecha_fin_giro3"]);
	$smarty->assign("value1_fecha_fin_giro3",@$_SESSION[$strTableName."_asearchfor2"]["fecha_fin_giro3"]);
}	
if($not)
	$smarty->assign("not_fecha_fin_giro3"," checked");
//	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_fecha_fin_giro3\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_fecha_fin_giro3",$searchtype);
//	edit format
$editformats["fecha_fin_giro3"]="Text field";
// Pallets 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["Pallets"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["Pallets"];
	$smarty->assign("value_Pallets",@$_SESSION[$strTableName."_asearchfor"]["Pallets"]);
	$smarty->assign("value1_Pallets",@$_SESSION[$strTableName."_asearchfor2"]["Pallets"]);
}	
if($not)
	$smarty->assign("not_Pallets"," checked");
//	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_Pallets\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_Pallets",$searchtype);
//	edit format
$editformats["Pallets"]="Text field";
// Puchos 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["Puchos"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["Puchos"];
	$smarty->assign("value_Puchos",@$_SESSION[$strTableName."_asearchfor"]["Puchos"]);
	$smarty->assign("value1_Puchos",@$_SESSION[$strTableName."_asearchfor2"]["Puchos"]);
}	
if($not)
	$smarty->assign("not_Puchos"," checked");
//	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_Puchos\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_Puchos",$searchtype);
//	edit format
$editformats["Puchos"]="Text field";
// bins 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["bins"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["bins"];
	$smarty->assign("value_bins",@$_SESSION[$strTableName."_asearchfor"]["bins"]);
	$smarty->assign("value1_bins",@$_SESSION[$strTableName."_asearchfor2"]["bins"]);
}	
if($not)
	$smarty->assign("not_bins"," checked");
//	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_bins\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_bins",$searchtype);
//	edit format
$editformats["bins"]="Text field";
// origen 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["origen"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["origen"];
	$smarty->assign("value_origen",@$_SESSION[$strTableName."_asearchfor"]["origen"]);
	$smarty->assign("value1_origen",@$_SESSION[$strTableName."_asearchfor2"]["origen"]);
}	
if($not)
	$smarty->assign("not_origen"," checked");
//	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_origen\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_origen",$searchtype);
//	edit format
$editformats["origen"]="Text field";
// destino 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["destino"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["destino"];
	$smarty->assign("value_destino",@$_SESSION[$strTableName."_asearchfor"]["destino"]);
	$smarty->assign("value1_destino",@$_SESSION[$strTableName."_asearchfor2"]["destino"]);
}	
if($not)
	$smarty->assign("not_destino"," checked");
//	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_destino\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_destino",$searchtype);
//	edit format
$editformats["destino"]="Text field";
// id_especie 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_especie"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_especie"];
	$smarty->assign("value_id_especie",@$_SESSION[$strTableName."_asearchfor"]["id_especie"]);
	$smarty->assign("value1_id_especie",@$_SESSION[$strTableName."_asearchfor2"]["id_especie"]);
}	
if($not)
	$smarty->assign("not_id_especie"," checked");
//	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_id_especie\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_especie",$searchtype);
//	edit format
$editformats["id_especie"]="Text field";
// id_envase 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_envase"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_envase"];
	$smarty->assign("value_id_envase",@$_SESSION[$strTableName."_asearchfor"]["id_envase"]);
	$smarty->assign("value1_id_envase",@$_SESSION[$strTableName."_asearchfor2"]["id_envase"]);
}	
if($not)
	$smarty->assign("not_id_envase"," checked");
//	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_id_envase\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_envase",$searchtype);
//	edit format
$editformats["id_envase"]="Text field";
// condicion_inicial 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["condicion_inicial"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["condicion_inicial"];
	$smarty->assign("value_condicion_inicial",@$_SESSION[$strTableName."_asearchfor"]["condicion_inicial"]);
	$smarty->assign("value1_condicion_inicial",@$_SESSION[$strTableName."_asearchfor2"]["condicion_inicial"]);
}	
if($not)
	$smarty->assign("not_condicion_inicial"," checked");
//	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_condicion_inicial\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_condicion_inicial",$searchtype);
//	edit format
$editformats["condicion_inicial"]="Text field";
// num_giros 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["num_giros"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["num_giros"];
	$smarty->assign("value_num_giros",@$_SESSION[$strTableName."_asearchfor"]["num_giros"]);
	$smarty->assign("value1_num_giros",@$_SESSION[$strTableName."_asearchfor2"]["num_giros"]);
}	
if($not)
	$smarty->assign("not_num_giros"," checked");
//	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_num_giros\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_num_giros",$searchtype);
//	edit format
$editformats["num_giros"]="Text field";
// creador_final 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["creador_final"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["creador_final"];
	$smarty->assign("value_creador_final",@$_SESSION[$strTableName."_asearchfor"]["creador_final"]);
	$smarty->assign("value1_creador_final",@$_SESSION[$strTableName."_asearchfor2"]["creador_final"]);
}	
if($not)
	$smarty->assign("not_creador_final"," checked");
//	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_creador_final\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_creador_final",$searchtype);
//	edit format
$editformats["creador_final"]="Text field";
// condicion_final 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["condicion_final"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["condicion_final"];
	$smarty->assign("value_condicion_final",@$_SESSION[$strTableName."_asearchfor"]["condicion_final"]);
	$smarty->assign("value1_condicion_final",@$_SESSION[$strTableName."_asearchfor2"]["condicion_final"]);
}	
if($not)
	$smarty->assign("not_condicion_final"," checked");
//	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_condicion_final\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_condicion_final",$searchtype);
//	edit format
$editformats["condicion_final"]="Text field";

$linkdata="";

if ($useAJAX) {
	$linkdata .= "<script type=\"text/javascript\">\r\n";
	$linkdata .= "$(document).ready(function(){ \r\n";
	$linkdata .= "
function loadSelectContent(txt, selectControl, selectValue) 
{
	$('#'+selectControl).get(0).options[0]=new Option(TEXT_PLEASE_SELECT,'');
	var str = txt.split('\\n');
	var index = 0;
	for(i=0,j=0; i < str.length - 1; i=i+2, j++) {
		$('#'+selectControl).get(0).options[j+1]=new Option(unescape(str[i+1]),unescape(str[i]));
		if ( unescape(str[i]) == selectValue ) {index = j+1;}
	}
	$('#'+selectControl).get(0).selectedIndex = index;
}"."\r\n";
	$linkdata .= "});\r\n";
	$linkdata .= "</script>\r\n";
} else {
}

$smarty->assign("linkdata",$linkdata);

$templatefile = "pf_proceso_search.htm";
if(function_exists("BeforeShowSearch"))
	BeforeShowSearch($smarty,$templatefile);

$smarty->display($templatefile);

?>