Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/06/2012, 13:20
hcbosch
 
Fecha de Ingreso: julio-2010
Mensajes: 64
Antigüedad: 13 años, 9 meses
Puntos: 1
Undefined index

Hola tengo un problema que me da como error Undefined index: txt_fecha in....
El caso es que utilizo un calendario js en una pagina para obtener una fecha que luego necesito insertar en una tabla. Una vez que el usuario me ha seleccionado la fecha en un txt_fecha, gaurdo ese valor en una variable php y la inserto, pero no me deja pq me da el error que les comenté. Qué estoy haciendo mal?
Saludos y agradecida de antemano
aqui mi código:

<?php include_once("class/class.bd.php");

if (isset($_POST['lista_grupos']))
{
var_dump($_POST);
$id_grupo=$_POST['lista_grupos'];
$cant_personas=$_POST['txt_cant_personas'];
$id_hotel=$_POST['lista_hotel'];
$contacto_hotel=$_POST['txt_contacto_hotel'];
$tipo_evento=$_POST['lista_tipo_evento'];
$fecha_evento_prime=strtotime($_POST['txt_fecha']);

$d1=date("d",strtotime($fecha_evento_prime));
$m1=date("m",strtotime($fecha_evento_prime));
$y1=date("Y",strtotime($fecha_evento_prime));
$fecha_evento=date("d/m/y",strtotime("$d1/$m1/$y1"));
$lugar_evento=$_POST['txt_lugar_evento'];
$evento=edit_data("INSERT INTO tb_evento(id_grupo, id_hotel, contacto_hotel,fecha_evento, cant_personas, id_estado)VALUES( $id_grupo, $id_hotel, '$contacto_hotel','$fecha_evento_prime','$cant_per sonas', 1)");
//$evento=edit_data("UPDATE tb_evento SET id_hotel=890 WHERE id_hotel=2");
}



?>
<!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=utf-8" />
<title>Entrada de datos de un nuevo evento</title>
<script language='javascript' src="popcalendar.js"></script>
</head>

<body>
<form id="form1" name="form1" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<table width="100%" height="152" border="1">
<tr>
<td colspan="6"><img src="/scenic/images/banner_sarao_scenic.jpg" width="100%" height="73" longdesc="/scenic/images/banner_sarao_scenic.jpg" /></td>
</tr>
<tr>
<td width="299">GRUPO</td>
<td width="144"><label for="lista_grupos"></label>
<select name="lista_grupos" size="1" id="lista_grupos">
<?php $lista_grupos=get_data("SELECT * FROM tb_grupo_hotel");
foreach($lista_grupos as $value){

?>
<option value="<?php echo $value["id_grupo_hotel"]?>"><?php echo $value["nombre_grupo"]?></option>

<?php }?>


</select></td>
<td width="241">FECHA DEL EVENTO</td>
<td><input name="txt_fecha" type="text" id="dateArrival" onclick="popUpCalendar(this, form1.dateArrival, 'dd-mm-yyyy');" size="10"
/></td>
<td width="38">PAX</td>
<td width="149"><label for="txt_cant_personas"></label>
<input type="text" name="txt_cant_personas" id="txt_cant_personas" /></td>
</tr>
<tr>
<td>HOTEL</td>
<td><label for="lista_hotel"></label>
<select name="lista_hotel" size="1" id="lista_hotel">

<?php $hoteles=get_data("SELECT * FROM tb_hotel");
foreach($hoteles as $value){

?>
<option value="<?php echo $value["id_hotel"]?>"><?php echo $value["nombre_hotel"]?></option>

<?php }?>

</select></td>
<td>TIPO DE EVENTO</td>
<td><select name="lista_tipo_evento" size="1" id="lista_tipo_evento">

<?php $tipo_evento=get_data("SELECT * FROM tb_tipo_evento");
foreach($tipo_evento as $value){

?>
<option value="<?php echo $value["id_tipo_evento"]?>"><?php echo $value["tipo_evento"]?></option>

<?php }?>
</select></td>
</tr>
<tr>
<td>CONTACTO DEL HOTEL</td>
<td><label for="txt_contacto_hotel"></label>
<input type="text" name="txt_contacto_hotel" id="txt_contacto_hotel" /></td>
<td>LUGAR DEL EVENTO</td>
<td><label for="txt_lugar_evento"></label>
<input type="text" name="txt_lugar_evento" id="txt_lugar_evento" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="btn_aceptar" id="btn_aceptar" value="Enviar"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>
<input type="hidden" name="MM_insert" value="form1" />
</p>
</form>
</body>
</html>