Al final creo que lo he conseguido haciendo " a mi manera" pongo el código a ver que os parece... igual es malo a rabiar y me gustaría le sacais pegas (por dios tampoco me hagais llorar ahora
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
)
La parte del formulario (tengo que poner bien tamaños y demás):
Cita:
echo "<form name='calendario' method='post' action='guardarfechas.php'>";
echo "<input type='text' name='fecha' value='$fecha' size='10'>";
echo "<input type='submit' value='ok'>";
echo "Fecha Entrega Prevista";
echo "<input type='text' name='fecha2' value='$fecha2' size='10'>";
echo "<input type='submit' value='ok'>";
Donde graba las fechas:
Cita: <?php
session_start();
include_once "conexion.php";
$fecha = $_POST["fecha"];
$fecha2 = $_POST["fecha2"];
$ipw = $_SESSION["ipw"];
function cambiarFormatoFecha($fecha){
list($anio,$mes,$dia)=explode("/",$fecha);
return $dia."-".$mes."-".$anio;
}
if($fecha!="")
{
$fecha = cambiarFormatoFecha($fecha);
$sql="UPDATE pediweb_cab SET fecha = '$fecha' WHERE id_pediweb_cab = $ipw";
conexion($sql);
}
if ($fecha2!="")
{
$fecha2 = cambiarFormatoFecha($fecha2);
$sql="UPDATE pediweb_cab SET fecentrega = '$fecha2' WHERE id_pediweb_cab = $ipw";
conexion($sql);
}
?>
<script>
window.location.href = "nuevo_pedido.php?ped=2";
</script>