Ver Mensaje Individual
  #7 (permalink)  
Antiguo 05/10/2009, 13:46
Avatar de ajstyleprogramming
ajstyleprogramming
 
Fecha de Ingreso: enero-2009
Mensajes: 43
Antigüedad: 15 años, 3 meses
Puntos: 0
Respuesta: dos formularios una pagina

este es el codigo
<div id="wb_" style="position:absolute; left:157px; top:272px; width:600px; height:300px; z-index:13" align="justify">
<?
include ("conexion.php");
$con=Conectarse();
$idproducto=$_REQUEST['idprod'];
$Descrip=$_REQUEST['Descripcion'];
$carga=$_REQUEST['carga'];
$_SESSION['idproduct']=$idproducto;
$_SESSION['Descripcion']=$Descrip;
?>
<form name="form1" action="http://www.topserviceweb.com/equipoideal/SeleccionaProductos.php" method="post">
<table width="555" border="0">
<tr>
<td><strong>ID Producto </strong></td>
<td><strong>Descripcion</strong></td>
<td><strong>Cantidad</strong></td>
<td><strong>Plazo</strong></td>
</tr>
<tr>
<td>
<?
if (isset($_SESSION['idproduct']))
{
echo $_SESSION['idproduct'];
}
?></td>
<td>
<?
if (isset($_SESSION['Descripcion']))
{
echo $_SESSION['Descripcion'];
}
?>
</td>

<td width="193"><input name="Can" type="text" id="Can" value="1"></td>
<td width="62"><label>
<select name="selectpl">
<?
if ($carga==1)
{
$strQueryplaz="SELECT a.*, b.* FROM `Monto` as a inner join `plazo` as b on (a.`id_plazo` = b.`id_plazo`) where a.`id_prod`='$idproducto' and a.`status`= 1";
$dat=mysql_query($strQueryplaz,$con);
while($datos2=mysql_fetch_array($dat))
{
echo '<option value="'.$datos2["id_prod"].'">'.$datos2["Descripcion"].'</option>';
}
}
?>

</select>
</label></td>
</tr>
<tr>
<td><input name="Buscar" type="submit" id="Buscar" value="Buscar"></td>
<td width="86">&nbsp;</td>
<td width="186">&nbsp;</td>
<td><label></label></td>

</tr>
</table>

</form>
<?
if ($carga==2)
{
$ciclo=2;
}
else
{
$ciclo==1;
}
$plas=$_GET['selectpl'];
$Cant=$_GET['Can'];
?>
<form <? echo 'action="http://www.topserviceweb.com/equipoideal/InsertarDetalle.php?ciclo='.$ciclo.'&Can='.$Cant.' "'?> method="post">
<input name="GuardarVenta" type="submit" id="GuardarVenta" value="Agregar a Venta">
</form>
<?
$strquerydet="SELECT MAX(`id_Detalle`) as ultimo from `Detalle`";
if ($carga==2)
{
$resul1=mysql_query($strquerydet,$con);
$total_registros = mysql_num_rows($resul1);
echo $total_registros;
}
?>
<table width="599" border="1">
<tr>
<td width="89"><strong>ID Producro </strong></td>
<td width="147"><strong>Descripcion</strong></td>
<td width="55"><strong>Cantidad</strong></td>
<td width="139"><strong>Plazo</strong></td>
<td width="135"><strong>Monto</strong></td>
</tr>
<?

if($total_registros !=0)
{
$idvent=$_SESSION['idvend'];
$datos2=mysql_fetch_array($resul1);
$Detalle=$datos2['ultimo'];
$strquerytab="SELECT a.*, b.*, c.*, d.* FROM `Detalle` as a inner join `Monto` as b on (a.`id_prod`=b.`id_prod`) right join `plazo`as c on(b.`id_plazo`=c.`id_plazo`) left join `Productos` as d on (a.`id_prod`=d.`id_prod`) where a.`id_Detalle`='$Detalle' and `id_Venta`='$idvent' ";
$resul2=mysql_query($strquerytab,$con);
while ($datostab1=mysql_fetch_array($resul2))
{
$total=$datostab1[10]*$datostab1[6];
echo '<tr><td>'.$datostab1[1].'</td><td>'.$datostab1[13].'</td><td>'.$datostab1[2].'</td><td>'.$datostab1[9].'</td><td>'.$total.'</td></tr>';
}
}

?>
</table>
<br>
<br>
<br>
</div>