Jump to content

hookit

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by hookit

  1. Hi There is a textfiedl with date format yyyy/mm/dd and send matching queries to a database with same format. But if i validate the kind of format i want dd/mm/yyyy returns no results. Here is the php code: <?php require_once('Connections/soloporhoy.php'); ?> <?php if (isset($_GET['S_Fecha']) && ($_GET['S_Fecha']) == "") { $_GET['S_Fecha'] = "1/1/1"; } ?> <?php if (isset($_GET['S_Título']) && ($_GET['S_Título']) == "") { $_GET['S_Título'] = "-1"; } ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php $currentPage = $_SERVER["PHP_SELF"]; ?> <?php if (!session_id()) session_start(); if (isset($_SESSION["soloporhoy_Results_QueryString"]) && ($_SESSION["soloporhoy_Results_QueryString"] != "") && !isset($_SERVER["QUERY_STRING"]) ){ header("Location: solopor hoy_Results.php?".str_replace("&totalRows_","&old_totalRows_",$_SESSION["soloporhoy_Results_QueryString"])); } else{$_SESSION["soloporhoy_Results_QueryString"] = isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:""; } ?> <?php $maxRows_WADAsoloporhoy = 10; $pageNum_WADAsoloporhoy = 0; if (isset($_GET['pageNum_WADAsoloporhoy'])) { $pageNum_WADAsoloporhoy = $_GET['pageNum_WADAsoloporhoy']; } $startRow_WADAsoloporhoy = $pageNum_WADAsoloporhoy * $maxRows_WADAsoloporhoy; $ParamFecha_WADAsoloporhoy = "1/1/1"; if (isset($_GET['S_Fecha'])) { $ParamFecha_WADAsoloporhoy = $_GET['S_Fecha']; } $ParamFecha2_WADAsoloporhoy = "1/1/1"; if (isset($_GET['S_Fecha'])) { $ParamFecha2_WADAsoloporhoy = $_GET['S_Fecha']; } $ParamTítulo_WADAsoloporhoy = "-1"; if (isset($_GET['S_Título'])) { $ParamTítulo_WADAsoloporhoy = $_GET['S_Título']; } $ParamTítulo2_WADAsoloporhoy = "-1"; if (isset($_GET['S_Título'])) { $ParamTítulo2_WADAsoloporhoy = $_GET['S_Título']; } mysql_select_db($database_soloporhoy, $soloporhoy); $query_WADAsoloporhoy = sprintf("SELECT * FROM `solopor hoy` WHERE (Fecha = %s OR 1/1/1 = %s) AND (Título LIKE CONCAT('%%', %s, '%%') OR '-1' = %s)", GetSQLValueString($ParamFecha_WADAsoloporhoy, "date"),GetSQLValueString($ParamFecha2_WADAsoloporhoy, "date"),GetSQLValueString($ParamTítulo_WADAsoloporhoy, "text"),GetSQLValueString($ParamTítulo2_WADAsoloporhoy, "text")); $query_limit_WADAsoloporhoy = sprintf("%s LIMIT %d, %d", $query_WADAsoloporhoy, $startRow_WADAsoloporhoy, $maxRows_WADAsoloporhoy); $WADAsoloporhoy = mysql_query($query_limit_WADAsoloporhoy, $soloporhoy) or die(mysql_error()); $row_WADAsoloporhoy = mysql_fetch_assoc($WADAsoloporhoy); if (isset($_GET['totalRows_WADAsoloporhoy'])) { $totalRows_WADAsoloporhoy = $_GET['totalRows_WADAsoloporhoy']; } else { $all_WADAsoloporhoy = mysql_query($query_WADAsoloporhoy); $totalRows_WADAsoloporhoy = mysql_num_rows($all_WADAsoloporhoy); } $totalPages_WADAsoloporhoy = ceil($totalRows_WADAsoloporhoy/$maxRows_WADAsoloporhoy)-1; ?> <?php $queryString_WADAsoloporhoy = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_WADAsoloporhoy") == false && stristr($param, "totalRows_WADAsoloporhoy") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_WADAsoloporhoy = "&" . htmlentities(implode("&", $newParams)); } } $queryString_WADAsoloporhoy = sprintf("&totalRows_WADAsoloporhoy=%d%s", $totalRows_WADAsoloporhoy, $queryString_WADAsoloporhoy); ?> <?php //WA AltClass Iterator class WA_AltClassIterator { var $DisplayIndex; var $DisplayArray; function WA_AltClassIterator($theDisplayArray = array(1)) { $this->ClassCounter = 0; $this->ClassArray = $theDisplayArray; } function getClass($incrementClass) { if (sizeof($this->ClassArray) == 0) return ""; if ($incrementClass) { if ($this->ClassCounter >= sizeof($this->ClassArray)) $this->ClassCounter = 0; $this->ClassCounter++; } if ($this->ClassCounter > 0) return $this->ClassArray[$this->ClassCounter-1]; else return $this->ClassArray[0]; } } ?><?php //WA Alternating Class $WARRT_AltClass1 = new WA_AltClassIterator(explode("|", "WADAResultsRowDark|")); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Resultados de solopor hoy.</title> <link href="WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" /> <link href="WA_DataAssist/styles/TimesNewRoman.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body,td,th { color: #FFFFFF; font-size: 16px; } body { background-color: #000099; } .style2 {padding-left: 6px; padding-right: 6px; vertical-align: middle;} .style3 {padding-top: 1px; padding-bottom: 1px; clear: both;} .style5 {font-size: 14} a:link { color: #CC0000; } .style6 { color: #00FF33; font-size: 12px; } a:visited { color: #FFFF00; } .style4 { font-size: 36px; font-style: italic; } .style7 { font-size: 18px; font-weight: bold; } .style8 {font-size: 16px; font-style: italic; } .style11 { font-size: 16px; color: #000000; } base { color: #FFFFFF; background-color: #666666; } .style13 {color: #333333} .style14 {font-size: 16px} .style16 {font-size: 14px} .style17 { font-size: 12 } --> </style> </head> <body> <div class="WADAResultsContainer"> <div class="WADAResultsHeader"> <div class="WADAHeaderText"> <p> </p> <p align="center"><img src="images/logoamor.png" alt="amor" width="105" height="109"></p> <p align="center" class="style4">EL PODER DEL AMOR</p> <p align="center" class="style4"><span class="style7"> Búsqueda de "Sólo por hoy"</span></p> <hr> <p align="center" class="style8"><u>Resultados de la Búsqueda.</u></p> </div> <div> <div align="center"><a href="solopor hoy_Search.php" class="style6 style16">Nueva Búsqueda.</a> </div> </div> </div> <div class="WADAHorizLine"> <div align="center"><img src="WA_DataAssist/images/Pacifica/Refined_tx.gif" alt="" height="1" width="1" border="0" /></div> </div> <div align="center"> <?php if ($totalRows_WADAsoloporhoy > 0) { // Show if recordset not empty ?> </div> <div class="WADAResults style5"> <div class="WADAResultsNavigation"> <div> <div align="center"> <p> </p> <p>Registros desde <?php echo ($startRow_WADAsoloporhoy + 1) ?> a <?php echo min($startRow_WADAsoloporhoy + $maxRows_WADAsoloporhoy, $totalRows_WADAsoloporhoy) ?>.<br> <br> </p> </div> </div> <div class="WADAResultsNavTop"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable"> <tr valign="middle"> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy > 0) { // Show if not first page ?> <span class="style2" id="First"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, 0, $queryString_WADAsoloporhoy); ?>">Primero</a></span> <?php } // Show if not first page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy > 0) { // Show if not first page ?> <span class="style2" id="Previous"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, max(0, $pageNum_WADAsoloporhoy - 1), $queryString_WADAsoloporhoy); ?>">Anterior</a> </span> <?php } // Show if not first page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy < $totalPages_WADAsoloporhoy) { // Show if not last page ?> <span class="style2" id="Next"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, min($totalPages_WADAsoloporhoy, $pageNum_WADAsoloporhoy + 1), $queryString_WADAsoloporhoy); ?>">Siguiente</a> </span> <?php } // Show if not last page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy < $totalPages_WADAsoloporhoy) { // Show if not last page ?> <span class="style2" id="Last"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, $totalPages_WADAsoloporhoy, $queryString_WADAsoloporhoy); ?>">Ultimo</a> </span> <?php } // Show if not last page ?></td> </tr> </table> <br> </div> </div> <div class="WADAResultsInsertButton"> </div> </div> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" bordercolor="#33FFFF" bgcolor="#FFFFFF" class="style3"> <tr> <th bgcolor="#000099" class="WADAResultsTableHeader style16">Fecha:</th> <th bgcolor="#000099" class="WADAResultsTableHeader style16">Título:</th> <th bgcolor="#000099" class="WADAResultsTableHeader style16">Vínculo:</th> <th bgcolor="#000099"> </th> </tr> <?php do { ?> <tr class="<?php echo $WARRT_AltClass1->getClass(true); ?>"> <td class="WADAResultsTableCell style11 style13 style14 style14"><?php echo($row_WADAsoloporhoy['Fecha']); ?></td> <td class="WADADataTableCell style11 style14"><?php echo($row_WADAsoloporhoy['Título']); ?></td> <td class="WADAResultsTableCell"><?php echo($row_WADAsoloporhoy['Vínculo']); ?></td> <td nowrap="nowrap" bgcolor="#000099" class="WADAResultsEditButtons"> </td> </tr> <?php } while ($row_WADAsoloporhoy = mysql_fetch_assoc($WADAsoloporhoy)); ?> </table> </div> <div class="WADAResultsNavigation"> <div> <div align="center"><br> Registros desde <?php echo ($startRow_WADAsoloporhoy + 1) ?> a <?php echo min($startRow_WADAsoloporhoy + $maxRows_WADAsoloporhoy, $totalRows_WADAsoloporhoy) ?> de un total de <?php echo $totalRows_WADAsoloporhoy ?> "Sólo por hoy".<br> </div> </div> <div class="WADAResultsNavBottom"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable"> <tr valign="middle"> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy > 0) { // Show if not first page ?> <span class="style2" id="First"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, 0, $queryString_WADAsoloporhoy); ?>">Primero.</a></span> <?php } // Show if not first page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy > 0) { // Show if not first page ?> <span class="style2" id="Previous"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, max(0, $pageNum_WADAsoloporhoy - 1), $queryString_WADAsoloporhoy); ?>">Anterior</a> </span> <?php } // Show if not first page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy < $totalPages_WADAsoloporhoy) { // Show if not last page ?> <span class="style2" id="Next"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, min($totalPages_WADAsoloporhoy, $pageNum_WADAsoloporhoy + 1), $queryString_WADAsoloporhoy); ?>">Siguiente</a> </span> <?php } // Show if not last page ?></td> <td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAsoloporhoy < $totalPages_WADAsoloporhoy) { // Show if not last page ?> <span class="style2" id="Last"> <a href="<?php printf("%s?pageNum_WADAsoloporhoy=%d%s", $currentPage, $totalPages_WADAsoloporhoy, $queryString_WADAsoloporhoy); ?>">Ultimo</a> </span> <?php } // Show if not last page ?></td> </tr> </table> </div> </div> </div> </div> <div align="center"> <?php } // Show if recordset not empty ?> <?php if ($totalRows_WADAsoloporhoy == 0) { // Show if recordset empty ?> </div> <div class="WADANoResults style5"> <div> <div align="center">Lo sentimos. No hay resultados. ¡Sigue buscando!</div> </div> <div> </div> </div> <div align="center"> <?php } // Show if recordset empty ?> </div> <hr> <p align="center"><a href="http://soloporhoy.1free.ws" class="style17">Página principal</a></p> </div> </body> </html> <?php mysql_free_result($WADAsoloporhoy); ?> Any help?
  2. Hi Jarvis Im trying to make a search. thanks
  3. Hi, I have a bd with the following fields: Id, state, town, address, day Primary key: id Each field, except id, should has a text field in the php form. Blank inputs are allowed in the form. The search should return the registries that match the inputs in the search. Combining 1 or 2 or 3 fields or alltogether. Can it be done with php?, cause i have been told in a Mysql forum that is better done with php. Thanks.
  4. Hi, I have a table with the following fields. Province, post code, address, day, time. In a web page i want to introduce a search in the database with a text field for every field of the db. The results should be combining the fields (1 or 2 or 3 or 4 or all together). Can it be done with Mysql? In such a case how it should be the sintax? Thanks
  5. 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?
  6. I have created with Phprunner a website that is working find in te local server, but when i tried to upload to the remote server, connects with it a loads the remote mysql database but after a short while the program crahses. I have tried to tweak the php code with the remote database, host, user and password, but i do not where and how to do it, i enclose here the code of dbconnect.php <?php function db_connect() { global $host,$user,$pwd,$errstr,$sys_dbname,$port,$bSubqueriesSupported; $strhost=$host; if($port && $port!=3306) $strhost=$strhost.":".$port; $conn = mysql_connect($strhost,$user,$pwd); if (!$conn || !mysql_select_db($sys_dbname,$conn)) { trigger_error(mysql_error(), E_USER_ERROR); } $mysqlversion = "4"; $res = @mysql_query("SHOW VARIABLES LIKE 'version'",$conn); if($row=@mysql_fetch_array($res,MYSQL_ASSOC)) $mysqlversion = $row["Value"]; if(substr($mysqlversion,0,1)<="4") $bSubqueriesSupported=false; return $conn; } function db_close($conn) { return mysql_close($conn); } function db_query($qstring,$conn) { global $strLastSQL; $strLastSQL=$qstring; if(!($ret=mysql_query($qstring,$conn))) { trigger_error(mysql_error(), E_USER_ERROR); } return $ret; } function db_exec($qstring,$conn) { return db_query($qstring,$conn); } function db_pageseek($qhandle,$pagesize,$page) { db_dataseek($qhandle,($page-1)*$pagesize); } function db_dataseek($qhandle,$row) { mysql_data_seek($qhandle,$row); } function db_numrows($qhandle) { // return only if qhandle exists, otherwise 0 if ($qhandle) { return @mysql_numrows($qhandle); } else { return 0; } } function db_result($qhandle,$row,$field) { return @mysql_result($qhandle,$row,$field); } function db_affected_rows($qhandle) { return @mysql_affected_rows(); } function db_fetch_array($qhandle) { return @mysql_fetch_array($qhandle,MYSQL_ASSOC); } function db_fetch_numarray($qhandle) { return @mysql_fetch_array($qhandle,MYSQL_NUM); } function db_insertid($qhandle) { return @mysql_insert_id($qhandle); } function db_error() { return @mysql_error(); } function parsevalues($enum) { $values=array(); $i=0; $j=0; $inquot=false; while($i<strlen($enum)) { if($enum[$i]=="'") $nquot=!$inquot; else if(!$inquot && $enum[$i]==',') { $val=substr($enum,$j+1,$i-$j-2); $values[]=str_replace("''","'",$val); $j=$i+1; } $i++; } if($i-$j-2>0) { $val=substr($enum,$j+1,$i-$j-2); $values[]=str_replace("''","'",$val); } return $values; } function db_addslashes($str) { return mysql_escape_string($str); } function db_stripslashes($str) { return stripslashes($str); } function db_addslashesbinary($str) { return "'".mysql_escape_string($str)."'"; } function db_stripslashesbinary($str) { return $str; } /* function IsAutoIncrementField($field) { global $strTableName; if(strpos($_SESSION[$strTableName."_fieldinfo"][$field]["extra"],"auto_increment")===FALSE) return false; return true; } */ // adds wrappers to field name if required function AddFieldWrappers($strName) { global $strLeftWrapper,$strRightWrapper; if(substr($strName,0,1)==$strLeftWrapper) return $strName; return $strLeftWrapper.$strName.$strRightWrapper; } function AddTableWrappers($strName) { return AddFieldWrappers($strName); } // removes wrappers from field name if required function RemoveFieldWrappers($strName) { global $strLeftWrapper,$strRightWrapper; if(substr($strName,0,1)==$strLeftWrapper) return substr($strName,1,strlen($strName)-2); return $strName; } function RemoveTableWrappers($strName) { return RemoveFieldWrappers($strName); } function db_upper($dbval) { return "upper(".$dbval.")"; } function db_datequotes($val) { return "'".$val."'"; } function db_numfields($lhandle) { return @mysql_numfields($lhandle); } function db_fieldname($lhandle,$fnumber) { return @mysql_fieldname($lhandle,$fnumber); } function db_fieldtype($lhandle,$fname) { for($i=0;$i<db_numfields($lhandle);$i++) if(db_fieldname($lhandle,$i)==$fname) return db_fieldtypen($lhandle,$i); return ""; } function db_fieldtypen($lhandle,$fnumber) { $type=mysql_fieldtype($lhandle,$fnumber); if($type=="blob") { $flags=mysql_fieldflags($lhandle,$fnumber); if(strpos($flags,"binary")===false) $type="text"; } return $type; } function FieldNeedQuotes($rs,$field) { $type=db_fieldtype($rs,$field); $t=strtoupper($type); if($t=="TINYINT" || $t=="SMALLINT" || $t=="MEDIUMINT" || $t=="INT" || $t=="BIGINT" || $t=="YEAR" || $t=="FLOAT" || $t=="DOUBLE" || $t=="DECIMAL" || $t=="NUMERIC" || $t=="REAL" ) return false; return true; } /* function db_fieldnull($rs,$i) { $flags=mysql_field_flags($rs,$i); if(strpos($flags,"not_null")===false) return true; return false; } function db_fieldlen($rs,$i) { return mysql_field_len($rs,$i); } */ /* function IsBinaryType($t) { $type=strtoupper($t); if($type=="TINYBLOB" || $type=="BLOB" || $type=="MEDIUMBLOB" || $type=="LONGBLOB") return true; return false; } function IsDateFieldType($stype) { $type=strtoupper($stype); if($type=="DATE" || $type=="DATETIME" || $type=="TIME" || $type=="TIMESTAMP") return true; return false; } function IsCharType($stype) { $type=strtoupper($stype); if($type=="STRING" || $type=="CHAR" || $type=="VARCHAR" || $type=="TEXT" || $type=="ENUM" || $type=="SET") return true; return false; } function IsTextType($type) { if(strtoupper($type)=="TEXT") return true; return false; } function GetTableInfo() { global $strTableName,$conn; $strSQL = "SHOW Columns from ".AddTableWrappers($strTableName); $rs = db_query($strSQL,$conn); $_SESSION[$strTableName."_fieldinfo"]=array(); while($data=db_fetch_array($rs)) { $_SESSION[$strTableName."_fieldinfo"][$data["Field"]] = array(); $f = & $_SESSION[$strTableName."_fieldinfo"][$data["Field"]]; $type=$data["Type"]; // remove type modifiers if(substr($type,0,4)=="tiny") $type=substr($type,4); else if(substr($type,0,5)=="small") $type=substr($type,5); else if(substr($type,0,6)=="medium") $type=substr($type,6); else if(substr($type,0,3)=="big") $type=substr($type,3); else if(substr($type,0,4)=="long") $type=substr($type,4); if(substr($type,0,4)=="enum") { $f["values"]=parsevalues(substr($type,5,strlen($type)-6)); $f["type"]="enum"; } else if(substr($type,0,3)=="set") { $f["values"]=parsevalues(substr($type,4,strlen($type)-5)); $f["type"]="set"; } else { if($pos=strpos($type," ")) $type=substr($type,0,$pos); // parse field sizes if($pos=strpos($type,"(")) { if($pos1=strpos($type,",",$pos)) { $f["size"]=(integer)substr($type,$pos+1,$pos1-$pos-1); $f["scale"]=(integer)substr($type,$pos1+1,strlen($type)-$pos1-2); } else { $f["size"]=(integer)substr($type,$pos+1,strlen($type)-$pos-2); $f["scale"]=0; } $type=substr($type,0,$pos); } $f["type"]=$type; } $f["extra"]=@$data["Extra"]; $f["key"]=@$data["Key"]; $f["default"]=@$data["Default"]; $f["null"]=@$data["Null"]; } } */ ?> any help?
  7. Will be so kind anyone of doing the script as suggested by Mr. Violent? I will be very grateful. i have to admit that i do not know how to do it.
  8. Thanks so much PBS. Now is almost solved, the message appears when is typed a search not found in db. But still appears inside the dynamic table, table shouldn´t appear, only message. Any suggestion?
  9. I have this page: <?php require_once('Connections/miconexion.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_miconexion, $miconexion); $query_reuniones = "SELECT reuniones.Población, reuniones.Dirección, reuniones.Día, reuniones.Hora, reuniones.Formato, reuniones.Observaciones FROM reuniones WHERE reuniones.Población LIKE '%".trim($_POST['textfield'])."%'"; $reuniones = mysql_query($query_reuniones, $miconexion) or die(mysql_error()); $row_reuniones = mysql_fetch_assoc($reuniones); $totalRows_reuniones = mysql_num_rows($reuniones); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>resultado de reuniones</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- .color { background-color: #88D9FF; } .style3 {color: #0000FF; font-family: "Courier New", Courier, monospace; } .style5 { color: #0000FF; font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; font-size: 14px; } body { background-image: url(logofondoregion.gif); } .style6 {font-size: 24px} .style13 { font-size: 14; font-family: Georgia, "Times New Roman", Times, serif; } .style14 { font-size: 16; font-family: Georgia, "Times New Roman", Times, serif; } .style16 {color: #0000FF} .style18 {font-family: Georgia, "Times New Roman", Times, serif} .style19 {background-color: #88D9FF; font-family: Georgia, "Times New Roman", Times, serif; } .style20 {font-weight: bold; color: #800040;} .style24 { color: #0000FF; font-size: 16px; font-weight: bold; } .style25 {font-size: 16px} --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body> <p> </p> <div align="center"> <h1 align="center" class="style3 style6 style18">Reuniones en <?php echo $_POST['textfield']; ?></h1> <p align="center" class="style5 style14 style25">Se encontraron <span class="style16"><?php echo $totalRows_reuniones ?></span> reuniones. </p> <table border="1" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop ?> <?php do { ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Observaciones']; ?></div></td> </tr> <?php } while ($row_reuniones = mysql_fetch_assoc($reuniones)); ?> </table> <p align="center"><span class="style18"><a href="index.php"><span class="style24">Nueva búsqueda</span></a></span></p> </div> <a href="index.php"> </a> </body> </html> <?php mysql_free_result($reuniones); ?> Í need that when a user of the webpage types a search that is not in the db. The server should return just a message like "no results found", Now appears the dynamic table empty, that should´t appear either. I've been told that i need to implement it with mysql_num_rows function and If clause. I`ve tried but dont know how to do it. I need someone help me to write it right. Thanks
  10. The code im pasting here is working properly: <?php require_once('Connections/miconexion.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_miconexion, $miconexion); $query_reuniones = "SELECT reuniones.Población, reuniones.Dirección, reuniones.Día, reuniones.Hora, reuniones.Formato, reuniones.Observaciones FROM reuniones WHERE reuniones.Población LIKE '%".trim($_POST['textfield'])."%'"; $reuniones = mysql_query($query_reuniones, $miconexion) or die(mysql_error()); $row_reuniones = mysql_fetch_assoc($reuniones); $totalRows_reuniones = mysql_num_rows($reuniones); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>resultado de reuniones</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- .color { background-color: #88D9FF; } .style3 {color: #0000FF; font-family: "Courier New", Courier, monospace; } .style5 { color: #0000FF; font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; font-size: 14px; } body { background-image: url(logofondoregion.gif); } .style6 {font-size: 24px} .style13 { font-size: 14; font-family: Georgia, "Times New Roman", Times, serif; } .style14 { font-size: 16; font-family: Georgia, "Times New Roman", Times, serif; } .style16 {color: #0000FF} .style18 {font-family: Georgia, "Times New Roman", Times, serif} .style19 {background-color: #88D9FF; font-family: Georgia, "Times New Roman", Times, serif; } .style20 {font-weight: bold; color: #800040;} .style24 { color: #0000FF; font-size: 16px; font-weight: bold; } .style25 {font-size: 16px} --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body> <div align="center"> <h1 align="center" class="style3 style6 style18">Reuniones en <?php echo $_POST['textfield']; ?></h1> <p align="center" class="style5 style14 style25">Se encontraron <span class="style16"><?php echo $totalRows_reuniones ?></span> reuniones. </p> <p align="center" class="style5"> </p> <table border="1" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop ?> <?php do { ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Observaciones']; ?></div></td> </tr> <?php } while ($row_reuniones = mysql_fetch_assoc($reuniones)); ?> </table> <p align="center"><span class="style18"><a href="index.php"><span class="style24">Nueva búsqueda</span></a></span></p> </div> <a href="index.php"> </a> </body> </html> <?php mysql_free_result($reuniones); ?> What i want to implement is that went a user type in the textfield's webpage any word that is not in the database instead empty the dynamic table should appear a message saying something like "NO RESULTS WERE FOUND". And I couldn´t achieve it so far.
  11. This is the code of the whole page: <?php require_once('../Connections/miconexion.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_miconexion, $miconexion); $query_reuniones = "SELECT reuniones.Población, reuniones.Dirección, reuniones.Día, reuniones.Hora, reuniones.Formato, reuniones.Observaciones FROM reuniones WHERE reuniones.Población LIKE '%".trim($_POST['textfield'])."%'"; $reuniones = mysql_query($query_reuniones, $miconexion) or die(mysql_error()); $row_reuniones = mysql_fetch_assoc($reuniones); $totalRows_reuniones = mysql_num_rows($reuniones); Code: [select]<?php //for error reporting, if no errors delete this... ini_set ("display_errors", "1"); error_reporting(E_ALL); $Res = mysql_query($query_reuniones); if(mysql_num_rows($Res)>0){ ?> <table border="1" align="center" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="images/logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop while($otmp = mysql_fetch_object($Res)){ ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Observaciones']; ?></div></td> </tr> <?php } ?> </table> <?php } else{ echo 'NO RESULTS FOUND'; } ?> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>resultado de reuniones</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- .color { background-color: #88D9FF; } .style3 {color: #0000FF; font-family: "Courier New", Courier, monospace; } .style5 { color: #0000FF; font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; font-size: 14px; } body { background-image: url(../logofondoregion.gif); } .style6 {font-size: 24px} .style13 { font-size: 14; font-family: Georgia, "Times New Roman", Times, serif; } .style14 { font-size: 16; font-family: Georgia, "Times New Roman", Times, serif; } .style16 {color: #0000FF} .style18 {font-family: Georgia, "Times New Roman", Times, serif} .style19 {background-color: #88D9FF; font-family: Georgia, "Times New Roman", Times, serif; } .style20 {font-weight: bold; color: #800040;} .style24 { color: #0000FF; font-size: 16px; font-weight: bold; } .style25 {font-size: 16px} --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body> <div align="center"> <h1 align="center" class="style3 style6 style18">Reuniones en <?php echo $_POST['textfield']; ?></h1> <p align="center" class="style5 style14 style25">Se encontraron <span class="style16"><?php echo $totalRows_reuniones ?></span> reuniones. </p> <p align="center" class="style5"> </p> <table border="1" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="../logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop ?> <?php do { ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Observaciones']; ?></div></td> </tr> <?php } while ($row_reuniones = mysql_fetch_assoc($reuniones)); ?> </table> <p align="center"><span class="style18"><a href="../index.php"><span class="style24">Nueva búsqueda</span></a></span></p> </div> <a href="../index.php"> </a> </body> </html> <?php mysql_free_result($reuniones); ?> Error log and line as before. What i want is if someone types in the textfield a registry that is not in the "Población" field of DB, instead the Dynamic table, a "NON RESULTS FOUND" would appear. Thanks
  12. Error log: Parse error: syntax error, unexpected '<' in /****/a9807048/public_html/resultados.php on line 38 This is qhere line 38 begins: <?php //for error reporting, if no errors delete this... ini_set ("display_errors", "1"); error_reporting(E_ALL); His is the whole script: <?php //for error reporting, if no errors delete this... ini_set ("display_errors", "1"); error_reporting(E_ALL); $Res = mysql_query($chainSQL); if(mysql_num_rows($Res)>0){ ?> <table border="1" align="center" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="images/logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop while($otmp = mysql_fetch_object($Res)){ ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $otmp['Observaciones']; ?></div></td> </tr> <?php } ?> </table> <?php } else{ echo 'NO RESULTS FOUND'; } ?>
  13. If i paste the last code posted by wayne remains with same error as before but in the first line of this snippet: <?php //for error reporting, if no errors delete this... ini_set ("display_errors", "1"); error_reporting(E_ALL); I can´t make it work.
  14. Thanks Maq: if i apply your script the server reports this error log: Parse error: syntax error, unexpected '<' in /home/whatever/domains/whatever.com/public_html/results.php on line 45 [<table border="1" align="center" bordercolor="#88D9FF" bgcolor="#D0EEFB">/code] It seems that there is something wrong with '<' Thanks
  15. That has been done but the else clause part of the script remains black, it has to be something else. Any suggestion?
  16. Hi, I have been given this php snippet: $Res = mysql_query($chainSQL); if(mysql_num_rows($Res)>0){ #If results found show list while($otmp = mysql_fetch_object($Res)){} }else{ echo 'NO RESULTS FOUND; } In this script i must introduce the dynamic´s table code in order to get the echo output if the condition is met. Here is where i been told to write the table´s code: if(mysql_num_rows($Res)>0){ //Here introduce tablè's code } Well, my doubt comes to how embed this code into because i wrote it as this but the code remains in black text not changing into colors when the php setence is right: <table border="1" align="center" bordercolor="#88D9FF" bgcolor="#D0EEFB"> <tr background="images/logofondoregion.gif"> <td class="style19"><div align="center" class="style20">Población</div></td> <td class="style19"><div align="center" class="style20">Dirección</div></td> <td class="style19"><div align="center" class="style20">Día</div></td> <td class="style19"><div align="center" class="style20">Hora</div></td> <td class="style19"><div align="center" class="style20">Formato</div></td> <td class="style19"><div align="center" class="style20">Observaciones</div></td> </tr> <?php $contador = 0; //inicializa el contador fuera del loop ?> <?php do { ?> <tr <?php if ($contador++ % 2) {echo 'class="color"';}?>> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Población']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Dirección']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Día']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Hora']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Formato']; ?></div></td> <td class="style18"><div align="center" class="style20"><?php echo $row_reuniones['Observaciones']; ?></div></td> </tr> <?php } while ($row_reuniones = mysql_fetch_assoc($reuniones)); ?> </table> Thanks
  17. Im a newbie. I have two php webpages in one: there is a textfield that shows the data drawn from a mysql database into a dynamic table in the other php page. What simply i want is a syntax that allows any visitor to search single registries of a DB's single field. And the query will show in the dynamic table the registries related to exactly the word written in the textfield. At the moment what i have done is create a form variable this is part of the mysql statement; He creado una variable de formulario y le he aplicado un LIKE así: WHERE database.field LIKE $_POST['textfield'] This only returns all the registries of the db's field regardles of what you type in the textfield. I do not know what to do. I need your help. I hope you understand what i want. I kindly ask you to explain it in a plain and simple manner. Have all a nice day.
×
×
  • 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.