Ver Mensaje Individual
  #11 (permalink)  
Antiguo 01/12/2005, 03:05
Avatar de refineriaweb
refineriaweb
 
Fecha de Ingreso: junio-2004
Ubicación: Palma de Mallorca
Mensajes: 196
Antigüedad: 19 años, 10 meses
Puntos: 1
yo consegui una busqueda por fecha

Hola, yo consegui modificando un codigo y con ayuda de Seppo (forista) crear una busqueda por fecha. Tengo en el form de submit un checkbox que escribiendo en el input type text ej: 2005-12-01

me saca los resultados de mi campo de la tabla de la base de datos (sentdate), pero y los que son iguales a la fecha que busco me los marca en rojo, pero me los lista todos :(

Estoy mirando que los resultados solo sean los que busco. Asi que si alguien se anima.

Te pongo aqui el codigo por si algo te sirve:
Código PHP:
if (isset($_GET['search_in_sentdate'])) 
            { 
                
// show user results 
                
$sentdate_output join (''file (SCRIPT_PATH.'modules/admin/search/templates/functions/search_results_sentdate.tpl')); 
                
$this->query_result $db->db_query('SELECT id,user,category,subject,sentdate FROM tickets WHERE (sentdate >= "%'.$_GET['search'].'%") OR (sentdate <= "%'.$_GET['search'].'%")'); 
                
$numrows $db->db_num_rows($this->query_result); 
                
$i 0
                while (
$row $db->db_fetch_array($this->query_result)) 
                { 
                    
$row['user'] = eregi_replace($_GET['search'],'<font color="red"><b>'.$_GET['search'].'</b></font>',$row['user']); 
                    
$row['subject'] = eregi_replace($_GET['search'],'<font color="red"><b>'.$_GET['search'].'</b></font>',$row['subject']); 
                    
$row['sentdate'] = eregi_replace($_GET['search'],'<font color="red"><b>'.$_GET['search'].'</b></font>',$row['sentdate']); 
                    
$row['category'] = eregi_replace($_GET['search'],'<font color="red"><b>'.$_GET['search'].'</b></font>',$row['category']); 
                     
                     
                    
$sentdate_results[$i] = $sentdate_output
                    
$sentdate_results[$i] = str_replace('{ID}',$row['id'],$sentdate_results[$i]); 
                    
$sentdate_results[$i] = str_replace('{USER}','<a href="'.$_SERVER['PHP_SELF'].'?tpl=tickets_show_ticket&lang='.LANGUAGE.'&id='.$row['id'].'">'.$row['user'].'</a>',$sentdate_results[$i]); 
                    
$sentdate_results[$i] = str_replace('{SUBJECT}','<a href="'.$_SERVER['PHP_SELF'].'?tpl=tickets_show_ticket&lang='.LANGUAGE.'&id='.$row['id'].'">'.$row['subject'].'</a>',$sentdate_results[$i]); 
                    
$sentdate_results[$i] = str_replace('{CATEGORY}','<a href="'.$_SERVER['PHP_SELF'].'?tpl=tickets_show_ticket&lang='.LANGUAGE.'&id='.$row['id'].'">'.$row['category'].'</a>',$sentdate_results[$i]); 
                    
$sentdate_results[$i] = str_replace('{SENTDATE}','<a href="'.$_SERVER['PHP_SELF'].'?tpl=tickets_show_ticket&lang='.LANGUAGE.'&id='.$row['id'].'">'.$row['sentdate'].'</a>',$sentdate_results[$i]); 
                    
$i++; 
                } 
                if (
$numrows == 0
                { 
                    
$sentdate_results = array(); 
                } 
                
$output str_replace('{RESULTS_SENTDATE}',$numrows.' {LANG_SEARCH_SENTDATE_RESULTS}<br>'.implode('',$sentdate_results),$output); 

Última edición por Cluster; 01/12/2005 a las 05:32