Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/03/2006, 09:25
Avatar de AmericoOnL
AmericoOnL
 
Fecha de Ingreso: abril-2002
Mensajes: 43
Antigüedad: 22 años
Puntos: 0
Re: Requerim.php

Amigo Cluster, aqui esta la totalidad de las dos paginas:
Nota: Corte la seccion styles por espacio...
1. Requerim.php:
<?php
include("../lib3.inc");
?>
<html>
<body>
<div id="Layer1">
<form action="requerim.php" method="post">
<select name="comboSolicitante" id="comboSolicitante">
<option value="0" selected="selected">Elejir Solicitante...</option>
<?php
$sql="select cuenta, razon_social from socios where tipo_trab='05' order by razon_social";
$exec = odbc_exec($conn,$sql);
while(odbc_fetch_row($exec))
{
echo "<option ";
if($_POST["comboSolicitante"]==odbc_result($exec,"CUENTA")) echo " selected ";
echo " value=" . odbc_result($exec,"CUENTA") . ">" . odbc_result($exec,"RAZON_SOCIAL");
}
?>
</select>
<input type="submit" name="Submit" value="Ok" />
</form>
</div>
<?php
// Paso1: Chequear si el solicitante es Jefe de Area o No
if(isset($_POST["comboSolicitante"]))
{
$sql2="select jefe_area from socios where cuenta='" . $_POST["comboSolicitante"] . "'";
$exec2 = odbc_exec($conn,$sql2);
$es_jefe=odbc_result($exec2,"JEFE_AREA");
if($es_jefe)
{
echo "<div id=Layer11>";
echo " <form name=formx method=post action=abc.php>";
echo " <div align=center>";
echo " <input type=submit name=Submit2 value=\"Ver Pedidos del Area\">";
echo " </div>";
echo " </form>";
echo "</div>";
}
// Paso2: Obtener el Area del Solicitante
$sql3="select area_trabajador from socios where cuenta='" . $_POST["comboSolicitante"] . "'";
$exec3 = odbc_exec($conn,$sql3);
$area_solicit=odbc_result($exec3,"AREA_TRABAJADOR" );
// Paso3: Obtener la Cuenta del Jefe del Area
if($es_jefe) $cta_jefe=$_POST["comboSolicitante"];
else
{
$sql4="select CUENTA from socios where jefe_area='1' and area_trabajador='" . $area_solicit . "'";
$exec4 = odbc_exec($conn,$sql4);
$cta_jefe=odbc_result($exec4,"CUENTA");
}
//Paso4: Buscar el Nombre del Jefe
$sqlx="select razon_social from socios where cuenta='" . $cta_jefe . "'";
$execx = odbc_exec($conn,$sqlx);
$nombre_jefe=odbc_result($execx,"razon_social");
}
?>
<form action="requerim.php" method="post">
<input type=hidden name="comboSolicitante" value=<?php echo $_POST["comboSolicitante"]; ?>>
<div id="Layer2">
<select name="comboJefeArea" id="comboJefeArea">
<option value="0" selected="selected">Elejir Jefe Inmediato Superior...</option>
<?php
echo "<option ";
if($_POST["comboJefeArea"]==$cta_jefe) echo " selected ";
echo " value=" . $cta_jefe . ">" . $nombre_jefe;
?>
</select>
</div>
<div id="Layer3">
<input name="txtQ1" type="text" id="txtQ1" value="1" size="4" maxlength="4" />
</div>
<div id="Layer4">
<select name="comboItems1" id="comboItems1">
<option value="0" selected>Seleccionar Items...</option>
<?php
$sqlitems1="select item_id, item_nombre from costos_item order by item_nombre";
$execitems1 = odbc_exec($conn,$sqlitems1);
while(odbc_fetch_row($execitems1))
{
$itemid1=odbc_result($execitems1,"item_id");
$itemnombre1=odbc_result($execitems1,"item_nombre" );
echo "<option ";
if($_POST["comboItems1"]==$itemid1) echo " selected ";
echo " value=" . $itemid1 . ">" . $itemnombre1;
}
?>
</select>
</div>
<div id="Layer5">
<input name="txtQ2" type="text" id="txtQ2" value="1" size="4" maxlength="4" />
</div>
<div id="Layer6">
<select name="comboItems2" id="comboItems2">
<option value="0" selected>Seleccionar Items...</option>
<?php
$sqlitems2="select item_id, item_nombre from costos_item order by item_nombre";
$execitems2 = odbc_exec($conn,$sqlitems2);
while(odbc_fetch_row($execitems2))
{
$itemid2=odbc_result($execitems2,"item_id");
$itemnombre2=odbc_result($execitems2,"item_nombre" );
echo "<option ";
if($_POST["comboItems2"]==$itemid2) echo " selected ";
echo " value=" . $itemid2 . ">" . $itemnombre2;
}
?>
</select>
</div>
<div id="Layer7">
<input name="txtQ3" type="text" id="txtQ3" size="4" maxlength="4" />
</div>
<div id="Layer8">
<input name="txtItems3" type="text" id="txtItems3" size="30" maxlength="30" />
</div>
<div id="Layer9">
<textarea name="txtJustificacion" cols="60" rows="5" id="txtJustificacion"></textarea>
</div>
<div id="Layer10">
<div align="center">
<input name="btnSubmit" type="submit" id="btnSubmit" value="Aceptar" />
</div>
</div>
</form>
<div align="center"><img src="images/requerimiento.jpg" alt="requerim" />
</div>
<?php
if(!isset($_POST["comboSolicitante"]))
{
echo "<center><textarea cols=50>Seleccione su nombre de la lista</textarea></center>";
}
if(isset($_POST["comboSolicitante"]))
{
if (!$_POST["comboJefeArea"])
{
echo "<center><textarea cols=50>Seleccione al Jefe de Area en el Segundo Combo.</textarea></center>";
exit;
}

if ((!$_POST["comboItems1"]) && ($_POST["comboItems1"]!='-1'))
{
echo "<center><textarea cols=50>No selecciono Items para su solicitud en el Combo.</textarea></center>";
exit;
}
}
if(isset($_POST["btnSubmit"]))
{
?>
<center>
<form id="form1" name="form1" method="post" action="pedido.php">
<input type=hidden name="comboSolicitante" value=<?php echo $_POST["comboSolicitante"]; ?>>
<input type=hidden name="comboJefeArea" value=<?php echo $_POST["comboJefeArea"]; ?>>
<input type=hidden name="txtQ1" value=<?php echo $_POST["txtQ1"]; ?>>
<input type=hidden name="comboItems1" value=<?php echo $_POST["comboItems1"]; ?>>
<input type=hidden name="txtQ2" value=<?php echo $_POST["txtQ2"]; ?>>
<input type=hidden name="comboItems2" value=<?php echo $_POST["comboItems2"]; ?>>
<input type=hidden name="txtQ3" value=<?php echo $_POST["txtQ3"]; ?>>
<input type=hidden name="txtItems3" value=<?php echo $_POST["txtItems3"]; ?>>
<table width="443" border="0">
<tr bgcolor="#CCCCCC">
<th colspan="3" scope="col"><div align="left"><span class="style1">Consolidado de Requerimiento - </span>
<?php
$sql0="select area_trabajador from socios where cuenta='" . $_POST["comboSolicitante"] . "'";
$exec0=odbc_exec($conn, $sql0);
$areaid=odbc_result($exec0,"area_trabajador");
$sql00="select area_nombre from area where area_id='" . $areaid . "'";
$exec00=odbc_exec($conn, $sql00);
echo odbc_result($exec00,"area_nombre");
?>
</div></th>
</tr>
<tr>
<td width="157"><span class="style1">[-] Solicitante:</span></td>
<td colspan="2">
<?php
$sql="select ape_pat, ape_mat, nombres from socios where cuenta='" . $_POST["comboSolicitante"] . "'";
$exec=odbc_exec($conn, $sql);
echo "<b>" . odbc_result($exec,"ape_pat") . "</b> " . odbc_result($exec,"ape_pat") . ", " . odbc_result($exec,"nombres");
?></td>
</tr>
<tr>
<td><span class="style1">[-]Al Jefe de Area:</span></td>
<td colspan="2">
<?php
$sql="select ape_pat, ape_mat, nombres from socios where cuenta='" . $_POST["comboJefeArea"] . "'";
$exec=odbc_exec($conn, $sql);
echo "<b>" . odbc_result($exec,"ape_pat") . "</b> " . odbc_result($exec,"ape_pat") . ", " . odbc_result($exec,"nombres");
?>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="3"><span class="style1"><strong>Detalle de Pedido </strong></span></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<?php
if($_POST["comboItems1"]!='-1') echo $_POST["txtQ1"];
?></div></td>
<td width="275"><div align="left"><?php
if($_POST["comboItems1"]!='-1')
{
$sql000="select item_nombre from costos_item where item_id='" . $_POST["comboItems1"] . "'";
$exec000=odbc_exec($conn,$sql000);
echo odbc_result($exec000,"item_nombre");
}
?></div></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<?php
if($_POST["comboItems2"]>0)
{
if($_POST["comboItems1"]!='-1') echo $_POST["txtQ2"];
}
?>
</div></td>
<td>
<div align="left">
<?php
if($_POST["comboItems1"]!='-1')
{
$sql001="select item_nombre from costos_item where item_id='" . $_POST["comboItems2"] . "'";
$exec001=odbc_exec($conn,$sql001);
echo odbc_result($exec001,"item_nombre");
}
?>
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<?php
if(strlen($_POST["txtQ3"])>0)
{
echo $_POST["txtQ3"];
}
?>
</div></td>
<td>
<?php
if(strlen($_POST["txtQ3"])>0)
{
echo $_POST["txtItems3"];
}
?></td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<input name="btnHacerPedido" type="submit" id="btnHacerPedido" value="Hacer Pedido" />
</div>
</form>
<div align="left"></div></td>
</tr>
</center>
<?php
}
?>
</table>
</body>
</html>
---------------
El archivo pedido.php lo inserto en otro post, porke excede los 10000 caracteres...