![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
07/07/2009, 08:14
|
| | Fecha de Ingreso: septiembre-2007
Mensajes: 318
Antigüedad: 17 años, 4 meses Puntos: 1 | |
Respuesta: Methodo GET/ POST Ok buenisimo el codigo esta un poco largo y lo corte un poco para poder mostrarlo
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function Abre_ventana (pagina){
ventana=window.open(pagina,"","toolbar=no,location =no,directories=no,status=yes,menubar=no,scrollbar s=yes,resizable=yes,width=450,height=300");
}
</script>
</head>
<body>
<p align="center"><font color="#000000" size="5" face="Verdana, Arial, Helvetica, sans-serif"><strong>Control de Expedientes: </strong></font></p>
<p align="left"><strong><font color="#000000" size="5"></font></strong></p>
<div align="left">
<table width="100%" border="0">
<tr>
<td width="10" height="135"> </td>
<td width="1005" align="center" valign="top">
<table border="3" width="100%" height="22">
<tr bgcolor="#CCCCCC">
<td width="15%">
<select onChange="window.location =this.options[this.selectedIndex].value; return true;" name="id">
<option selected>Despliegue y Seleccione</option>
<option value="?id=0">Todos</option>
<option value="?id=1">Cliente</option>
<option value="?id=2">Expedientes</option>
<option value="?id=3">Factura</option>
<option value="?id=4">Fecha</option>
<option value="?id=5">Status</option>
</select>
</td>
<td width="85%" valign="top">
<?php
$selector=$_GET["id"];
if($selector=='1'){
?>
<select onChange="window.location =this.options[this.selectedIndex].value; return true;" name="idclavecliente">
<?
include "conexion.php";
$sql1= mysql_query("SELECT * FROM clientes ORDER BY cliente") or die ("NO EMCONTRO");
?>
<option selected>Despliegue y Seleccione El Cliente</option>
<?php
while($result1 = mysql_fetch_array($sql1))
{
?>
<option value="?idclavecliente=<?=$result1[1]?>"<? if($idclavecliente==$result1[1]){?>selected<?} ?>><?=$result1[2]?></option>
<?
}
?>
</select>
<?
$idclavecliente=$_GET["idclavecliente"];
}
?>
<?php
if($selector=='2'){
?>
<select onChange="window.location =this.options[this.selectedIndex].value; return true;" name="idexpediente">
<?
include "conexion.php";
$sql2= mysql_query("SELECT * FROM expedientes ORDER BY nexpediente") or die ("NO EMCONTRO");
?>
<option selected>Despliegue y Seleccione El N° de Expediente</option>
<?php
while($result2 = mysql_fetch_array($sql2))
{
?>
<option value="?idexpediente=<?=$result2[1]?>"<? if($idexpediente==$result2[1]){?>selected<?} ?>><?=$result2[1]?></option>
<?
}
?>
</select>
<?
}
?>
</td>
</tr>
</table>
<?
if($idclavecliente==NULL && $idexpediente==NULL ){
?>
<table border="1" width="100%" height="22">
<tr bgcolor="#CCCCCC">
<td><div align="center"><strong>Clientes </strong></div></td>
<td><div align="center"><strong>N° Expediente</strong></div></td>
<td><div align="center"><strong>BL</strong></div></td>
<td><div align="center"><strong>O/E</strong></div></td>
<td><div align="center"><strong>N°Factura</strong></div></td>
<td><div align="center"><strong>Fecha1</strong></div></td>
<td><div align="center"><strong>Fecha2</strong></div></td>
<td><div align="center"><strong>Status Aduana</strong></div></td>
<td><div align="center"><strong>Status Cadivi</strong></div></td>
</tr>
<?php
include "conexion.php";
$busca= mysql_query("SELECT * FROM vista_maestra ORDER BY cliente") or die ("NO EMCONTRO");
while($row = mysql_fetch_array($busca)){
echo "<tr>";
echo "<td>".$row['cliente']."</td>";
echo "<td>"?><a href="javascript:Abre_ventana('expedientes.php?id= " <?php echo"".$row['nexpediente'].""; ?> "')"> <?php echo"".$row['nexpediente'].""; ?> </a> <?php "</td>";
echo "<td>".$row['bl']."</td>";
echo "<td>".$row['oe']."</td>";
echo "<td>".$row['factura']."</td>";
echo "<td>".$row['fecha1']."</td>";
echo "<td>".$row['fecha2']."</td>";
echo "<td><a href=\"http://cadivi.php?cadivi=".$row['nsolicitudcadivi']."&clave=".$row['clave']."\">".$row['nsolicitudcadivi']."</a></td>";
echo "<td>No Aplica</td>";
echo "</tr>";
}
?>
</table>
<?
}
else{
?>
<table border="1" width="100%" height="22">
<tr bgcolor="#CCCCCC">
<td><div align="center"><strong>Clientes </strong></div></td>
<td><div align="center"><strong>N° Expediente</strong></div></td>
<td><div align="center"><strong>BL</strong></div></td>
<td><div align="center"><strong>O/E</strong></div></td>
<td><div align="center"><strong>N°Factura</strong></div></td>
<td><div align="center"><strong>Fecha1</strong></div></td>
<td><div align="center"><strong>Fecha2</strong></div></td>
<td><div align="center"><strong>Status Aduana</strong></div></td>
<td><div align="center"><strong>Status Cadivi</strong></div></td>
</tr>
<?php
include "conexion.php"; $idclavecliente=$_GET["idclavecliente"];
$busca1= mysql_query("SELECT * FROM vista_maestra WHERE vista_maestra.clave='$cod'") or die ("NO EMCONTRO");
if($row = mysql_fetch_array($busca1)){
echo "<tr>";
echo "<td>".$row['cliente']."</td>";
echo "<td><a href=\"http://expedientes.php?id=".$row['nexpedientes']."&clave=".$row['clave']."\">".$row['nexpediente']."</a></td>";
echo "<td>".$row['bl']."</td>";
echo "<td>".$row['oe']."</td>";
echo "<td>".$row['factura']."</td>";
echo "<td>".$row['fecha1']."</td>";
echo "<td>".$row['fecha2']."</td>";
echo "<td><a href=\"http://cadivi.php?cadivi=".$row['nsolicitudcadivi']."&clave=".$row['clave']."\">".$row['nsolicitudcadivi']."</a></td>";
echo "<td>No Aplica</td>";
echo "</tr>";
} $idexpediente=$_GET["idexpediente"];
$busca2= mysql_query("SELECT * FROM vista_maestra WHERE vista_maestra.nexpediente='$idexpediente'") or die ("NO EMCONTRO");
if($row = mysql_fetch_array($busca2)){
echo "<tr>";
echo "<td>".$row['cliente']."</td>";
echo "<td><a href=\"http://expedientes.php?id=".$row['nexpedientes']."&clave=".$row['clave']."\">".$row['nexpediente']."</a></td>";
echo "<td>".$row['bl']."</td>";
echo "<td>".$row['oe']."</td>";
echo "<td>".$row['factura']."</td>";
echo "<td>".$row['fecha1']."</td>";
echo "<td>".$row['fecha2']."</td>";
echo "<td><a href=\"http://cadivi.php?cadivi=".$row['nsolicitudcadivi']."&clave=".$row['clave']."\">".$row['nsolicitudcadivi']."</a></td>";
echo "<td>No Aplica</td>";
echo "</tr>";
}
}
?>
</table>
</td>
<td width="13"> </td>
</tr>
</table>
</div>
</body>
</html>
Estoy llamando las variables con el methodo GET y aun asi no me funsiona pero en lo cal si me funsiona perfectamente
Última edición por banrey; 07/07/2009 a las 08:16
Razón: mejor comprencion
|