Tema: Auxilio::::
Ver Mensaje Individual
  #38 (permalink)  
Antiguo 30/09/2010, 10:55
dianays
 
Fecha de Ingreso: agosto-2010
Mensajes: 147
Antigüedad: 14 años
Puntos: 1
Respuesta: Auxilio::::

Mira tengo otro archivo, este me muestra en un combo el folio que existe en la tabla "reporte", y al seleccionar uno y dandole clic en -->Aceptar, me muestra los datos...

He querido hacerlo con usuarios pero no he podido, ademas de que he querido agregarle un rango de fechas como lo hemos estado asiendo...

te agrego el codigo para que lo veas... con respecto a lo demas ps no he podido hacerlo no me ha salido...

<!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" />
<title>***Reporte***</title>
<style type="text/css">
<!--
.Estilo5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
-->
</style>
</head>

<body>
<form id="form2" name="form2" method="post" action="buscar_folio.php">
<table width="75%" border="0">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><p class="Estilo5">&nbsp;</p>
<p class="Estilo5">Seleccione el Folio: </p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><label><br />
Código PHP:
Ver original
  1. <?php
  2.     $CONEXION = mysql_connect("localhost","root","");
  3.     if (!$CONEXION) {
  4.     die("p class='Estilo1' align='center'>LO SIENTO, PERO NO HA PODIDO CONECTARSE A MYSQL: </p>" . mysql_error());
  5.     }
  6.     else{
  7.     mysql_select_db("bd_control", $CONEXION);
  8.     $ARTICULOS=mysql_query("SELECT folio FROM reporte ");
  9.     $ERROR = mysql_error($CONEXION);
  10.     if(empty($ERROR)){
  11.     echo "<select name=ART>";
  12.     echo "<option selected='' value=''> [ Seleccione ] </option>";
  13.     while ($ARTICULO=mysql_fetch_array($ARTICULOS)){
  14.     echo "<option value=".$ARTICULO["folio"].">".$ARTICULO["folio"]."</option>";
  15.     }              
  16.     echo "</select>";
  17.     }
  18.     else{
  19.     $ERROR_CONSULTA="NO SE PUEDEN MOSTRAR LOS DATOS DEBIDO AL SIGUIENTE ERROR: ";
  20.     }
  21.     }
  22. ?>
<input type="submit" name="ACEPTAR" value="ACEPTAR" />
</label></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
Código PHP:
Ver original
  1. <?php
  2. if (isset($_POST["ACEPTAR"])){
  3.     $ART=$_POST["ART"];
  4.     $ART_SEL=mysql_query("SELECT folio, fecha, hora, unidad, nombre FROM reporte , unidades, usuarios WHERE reporte.id_unidad=unidades.id_unidad AND reporte.id_nom=usuarios.id_nom AND reporte.folio=$ART");
  5.     $error=mysql_error($CONEXION); echo $error;
  6.     $fila=mysql_fetch_array($ART_SEL);
  7.     if(mysql_num_rows($ART_SEL)){
  8.     echo "<table width='800' border='1' align='center'>
  9.             <tr>
  10.             <th width='90' scope='col'>FOLIO</th>
  11.             <th width='66' scope='col'>FECHA</th>
  12.        <th width='65' scope='col'>HORA</th>
  13.     <th width='69' scope='col'>UNIDAD</th>
  14.     <th width='66' scope='col'>NOMBRE</th>
  15.             </tr>
  16.             <tr>
  17.             <td>".$fila['folio']."</td>
  18.             <td>".$fila['fecha']."</td>
  19.             <td>".$fila['hora']."</td>
  20.     <td>".$fila['unidad']."</td>
  21.             <td>".$fila['nombre']."</td>
  22.             </tr>
  23. </table>";
  24.     }
  25.     else{
  26.     echo "<div class='Estilo2' align='center'>EL FOLIO NO EXISTE</div>";
  27.     }
  28.     }
  29. ?>
</body>
</html>