<?php
$state = false;
if ($_POST['action'] == "add") {
$conexion = mysql_connect("localhost", "mihueb_osmar", "ninguna");
$que = "INSERT INTO guia (guiaderemision, puntodepartida, puntodellegada, fechadeiniciodetraslado, costominimo, nombredeldestinatario, direcciondeldestinatario, rucdeldestinatario, marcaynumerodeplaca, constanciadeinscripcion, licenciadeconducir, nombredetransportes, rucdetransportes, cantidad, descripcion) ";
$que.= "VALUES ('".$_POST['num']."','".$_POST['part']."', '".$_POST['llega']."', '".$_POST['fecha']."', '".$_POST['costo']."', '".$_POST['listap_1']."', '".$_POST['dire']."', '".$_POST['ruc']."', '".$_POST['placa']."', '".$_POST['consta']."', '".$_POST['licen']."', '".$_POST['trans']."', '".$_POST['ructrans']."', '".$_POST['canti']."', '".$_POST['des']."') ";
$state = true;
echo "LOS DATOS QUE SE MOSTRARON SON !!!"; echo "<br>";
echo $_POST['direccion']; echo "<br>";
echo $_POST['ruc']; echo "<br>";
// echo '<pre>';
// var_dump($_POST);
// echo '</pre>';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.:: GUIAS DE REMISION STEEL JRV ::.</title>
<script languaje="javascript">
function lista_cli(lista){
document.form.clientes.value = lista.options[lista.selectedIndex].getAttribute("alt1");
document.form.direccion.value = lista.options[lista.selectedIndex].getAttribute("alt2");
document.form.ruc.value = lista.options[lista.selectedIndex].getAttribute("alt3");
}
</script>
<?php
$var="";
$resu=mysql_query("select * from clientes order by clientes",$conexion);
{
$var.= '<option value="'.$row_cli["codcli"].'" "'.$row_cli["clientes"].'",
alt1="'.$row_cli["codcli"].'",
alt2="'.$row_cli["direccion"].'",
alt3="'.$row_cli["ruc"].'">'.
$row_cli["clientes"].'</option>';
}
?>
<style type="text/css">
<!--
body {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 12px;
color: #333333;
background-image: url(guia.jpg);
background-color: #FFFFFF;
background-repeat: repeat;
}
h2 {
font-size: 16px;
color: #CC0000;
}
input, select {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 11px;
color: #666666;
}
.Estilo34 {color: #FFFFFF}
.Estilo45 {
color: #1A3B5C;
font-family: Arial, Helvetica, sans-serif;
}
.campo {
border: 1px Solid #FFFFFF;
background: #FFFFFF;
}
.campo1 {border: 2px;
background: 888888;
}
-->
</style>
</head>
<body>
<form id="form" name="form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<table width="724" border="0">
<tr>
<td height="803" align="left" valign="top" background="jrv-p3-1.jpg">
<form action="#" onsubmit="return validate_form();" method="post" id="enquiryform">
<br />
<br />
<br />
<br />
<br />
<br />
<form id="insertar" name="insertar" method="post" action=""><div align="center">
<table width="713" height="42" border="0">
<tr>
<td width="551"><br /></td>
<td width="152"><input name="num" type="text" id="num" class="campo" onclick="if(this.value=='Guía de Remisión Nº')this.value='';" value="Guía de Remisión Nº" size="30" /></td>
</tr>
</table>
<table width="658" height="30" border="0" align="center">
<tr>
<td width="68"> </td>
<td width="255"><input name="part" type="text" id="part" class="campo" onclick="if(this.value=='Punto de Partida')this.value='';" value="Punto de Partida" size="35" /></td>
<td width="7"> </td>
<td width="79"> </td>
<td width="227"><input name="llega" type="text" id="llega" class="campo" onclick="if(this.value=='Punto de Salida')this.value='';" value="Punto de Salida" size="45" /></td>
</tr>
</table>
<table width="665" border="0" align="left">
<tr>
<td width="237"><input name="licen" type="text" id="licen" class="campo" onclick="if(this.value=='Licencia de Conducir')this.value='';" value="Licencia de Conducir" size="30" /></td>
<td width="418"><select name="listap_1" class="campo1" onchange="lista_cli(this)">
<option value="option" id="ruc" >Clientes</option>
<?php echo $var?>
</select></td>
</tr>
<tr>
<td> </td>
<td width="418"><input type="text" id="dire" class="campo1" size="60" name="dire" /></td>
</tr>
<tr>
<td width="237"><input name="costo" type="text" id="costo" class="campo" onclick="if(this.value=='Costo Minimo')this.value='';" value="Costo Minimo" size="30" /></td>
<td width="418"><input type="text" id="ruc" class="campo1" size="20" name="ruc" /></td>
</tr>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<table width="665" border="0" align="left">
<tr>
<td width="219"><input name="placa" type="text" id="placa" class="campo" onclick="if(this.value=='Placa')this.value='';" value="Placa" size="30" /></td>
<td width="436"><input name="trans" type="text" id="trans" class="campo" onclick="if(this.value=='Nombre de Transportes')this.value='';" value="Nombre de Transportes" size="30" /></td>
</tr>
<tr>
<td width="219"><input name="consta" type="text" id="consta" class="campo" onclick="if(this.value=='Constancia de Inscripcion')this.value='';" value="Constancia de Inscripcion" size="30" />
<td width="436"><input name="dire" type="text" id="dire" class="campo" onclick="if(this.value=='Direccion')this.value='';" value="Direccion" size="30" /></td>
</tr>
<tr>
<td width="219"><input name="nombredest" type="text" id="nombredest" class="campo" onclick="if(this.value=='Licencia de Conducir')this.value='';" value="Licencia de Conducir" size="30" /></td>
<td width="436"><input name="ructrans" type="text" id="ructrans" class="campo" onclick="if(this.value=='RUC')this.value='';" value="RUC" size="30" /></td>
</tr>
</table>
<br />
<br />
<span class="Estilo34">..........................</span><br />
<br />
<br />
<br />
<table width="665" border="0" align="left">
<tr>
<td width="215"><input name="canti" type="text" id="canti" class="campo" onclick="if(this.value=='Cantidad')this.value='';" value="Cantidad" size="30" /></td>
<td width="215"><input name="des" type="text" id="des" class="campo" onclick="if(this.value=='Descripcion')this.value='';" value="Descripcion" size="30" /></td>
<td width="163"><input name="nombredest" type="text" id="nombredest" class="campo" onclick="if(this.value=='Precio Unitario')this.value='';" value="Precio Unitario" size="30" /></td>
<td width="219"><input name="nombredest" type="text" id="nombredest" class="campo" onclick="if(this.value=='Total')this.value='';" value="Total" size="30" /></td>
</tr>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<input type="submit" name="Submit" value="Insertar Registro" />
</div>
</form>
</td>
</tr>
</table>
<img name="" src="" width="32" height="32" alt="" />
<h2> </h2>
<p align="center"><em>Registro insertado correctamente</em></p>
</body>
</html>