![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
16/12/2004, 10:51
|
![Avatar de christopher1979](http://static.forosdelweb.com/customavatars/avatar76859_1.gif) | | | Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 20 años, 4 meses Puntos: 0 | |
este es el codigo <?php
$connection = mysql_connect("localhost","administrador","adminis trador");
mysql_select_db("destajos",$connection);
$clavefrente = mysql_query("SELECT * FROM frentes",$connection);
$presupuesnuevos = mysql_query("SELECT * FROM presupuesto",$connection);
echo "<script type='text/javascript'>
function validacion(){
var clavepresupuesto = document.unionfrente.clavepresupuesto.value.length ;
var descpresupuesto = document.unionfrente.descpresupuesto.value.length;
if (clavepresupuesto < 4){
alert (\"No Contiente los 4 Digitos la CLAVE PRESUPUESTO\");
return false;
}else{
if (descpresupuesto == 0){
alert(\"Nesecita Proporcionar Una DESCRIPCION Para El PRESUPUESTO\");
return false;
}else{
return true;
};
};
};
</script>";
echo "<table>";
echo "<tr><td><font color = \"blue\" size = \"5\" face = \"arial\"><b>PROCESAR PRESUPUESTO</b><br><br></td></tr></table>";
echo "<table>";
echo "<form name = \"unionfrente\" method = \"POST\" action = \"procesarpresupuesto.php\" onSubmit = \"return validacion()\">";
echo "<tr><td><font color = \"blue\" size = \"3\" face = \"times new romans\"><b>Clave Frente:</b></font><td><select name = \"clavefrente\">";
echo "<option>ELIJA FRENTE</option>";
while($rows = mysql_fetch_assoc($clavefrente)){
echo "<option>$rows[clavefrente]-$rows[nombrefrente]</option>";
}
echo "</select></td></tr>";
echo "<tr><td><font color = \"blue\" size = \"3\" face = \"times new romans\"><b>Clave Presupuesto:</b></font><font color = \"green\" size = \"3\" face = \"arial\"><b>*</b></font><td><input type = \"text\" name = \"clavepresupuesto\" size = \"4\" maxlength = \"4\"></td></tr>";
echo "<tr><td><font color = \"blue\" size = \"3\" face = \"times new romans\"><b>Descripcion del Presupuesto:</b></font><font color = \"green\" size = \"3\" face = \"arial\"><b>*</b></font><td><input type = \"text\" name = \"descpresupuesto\" size = \"60\" maxlength = \"60\"></td></tr></table>";
echo "<tr><td><font color = \"blue\" size = \"3\" face = \"times new romans\"><b>Nombre de Presupuesto Nuevos:<font color = \"green\" size = \"3\" face = \"arial\"><b>*</b></font><td></b><select name = \"presupuestosubido\" id=\"nombrepresup\"><br><br>";
echo "<option value = \"\" selected>--->Seleccione Presupuesto<---</option>";
$i=0;
$variable_antigua="";
while($rows = mysql_fetch_assoc($presupuesnuevos)){
if($row[$i]!=$variable_antigua){
$variable=$row[$i];
$variable_antigua=$row[$i];
$i++;
}else{
$variable_antigua=$row[$i];
$i++;
}
}
echo "<option>$variable</option>";
echo "</select></td></tr></table>";
echo "<table>";
echo "<tr><td><input type = \"reset\" value = \"Borrar Datos\"><td>";
echo "<input type = \"submit\" name = \"enviopresupuesto\" value = \"Procesar Datos\"></td></tr>";
echo "</table>";
echo "</form>";
?> |