
06/03/2006, 09:25
|
 | | | Fecha de Ingreso: abril-2002
Mensajes: 43
Antigüedad: 22 años, 10 meses Puntos: 0 | |
Re: pedido.php 2. pedido.php: <html>
<body>
<?php
die($_POST["txtItems3"]);
include("../lib3.inc");
if ($_POST["comboItems1"]!=0 && $_POST["comboItems1"]!=-1 && $_POST["txtQ1"]>0)
$permiso_para_agregar[0]=1;
else
$permiso_para_agregar[0]=0;
if ($_POST["comboItems2"]!=0 && $_POST["comboItems2"]!=-1 && $_POST["txtQ2"]>0)
$permiso_para_agregar[1]=1;
else
$permiso_para_agregar[1]=0;
if (strlen($_POST["txtQ3"])>0 && strlen($_POST["txtItems3"])>0 )
$permiso_para_agregar[2]=1;
else
$permiso_para_agregar[2]=0;
$sql="select count(req_id) as numregs from costos_requerimiento";
$exec=odbc_exec($conn, $sql);
$num=odbc_result($exec, "numregs");
$fecha=date(d."/".m."/".Y);
$sql2="insert into costos_requerimiento values(" . $num+1 . "," . $_POST["comboSolicitante"] . "," .
$_POST["comboJefeArea"] . "," . $fecha . ",";
for($a=0; $a<=2; $a++)
{
switch ($a)
{
case 0:
if($permiso_para_agregar[0])
$sql2.=$_POST["txtQ1"] . "," . $_POST["comboItems1"];
break;
case 1:
if($permiso_para_agregar[1])
$sql2.="," . $_POST["txtQ2"] . "," . $_POST["comboItems2"];
break;
case 2:
if($permiso_para_agregar[2])
$sql2.="," . $_POST["txtQ3"] . "," . $_POST["txtItems3"];
break;
}
}
if(strlen($_POST["txtJustificacion"]))
$sql2.="," . $_POST["txtJustificacion"] . ")";
die($sql2);
?>
<form id="form1" name="form1" method="post" action="requerim.php">
<div align="center">
<input type="submit" name="Submit" value="Volver" />
</div>
</form>
</body>
</html> |