Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/12/2008, 12:33
machg
 
Fecha de Ingreso: septiembre-2008
Mensajes: 3
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: Falla al recargar pagina despues de haber enviado datos con java en pagina

y este codigo es el de la popup
<body>
<? require_once("../mantenimiento/aut_config.inc.php");
require_once("../mantenimiento/Libreria.php");

$conec=mysql_connect("$sql_host","$sql_usuario","$ sql_pass");
mysql_select_db("clsocios",$conec);
$dato_prom=mysql_query("select nom_prom,val_prom,moneda,punto_prom from promociones where id_prom='$var'",$conec);
$resul=mysql_affected_rows($conec);
if($resul>0)
{
$nom_pro=mysql_result($dato_prom,0,"nom_prom");
$imp=mysql_result($dato_prom,0,"val_prom");
$rb=mysql_result($dato_prom,0,"moneda");
$punto=mysql_result($dato_prom,0,"punto_prom");
}
$dato_cambio=mysql_query("select tipcam from tipocambio where fechacam='$var1'",$conec);
$tip=mysql_affected_rows($conec);
if($tip>0)
{
$tip_cam=mysql_result($dato_cambio,0,"tipcam");
}
if($var2==0)
{$estado="hidden";
msgbox("Socio no tiene saldo para canje de la"." ".$nom_pro);}
else
{$estado="text";}

if($var2!="")
{
$punto_cli=mysql_query("select puntos from acupuntos where codtipo='$var3' and numdoc='$var4'",$conec);
$k=mysql_affected_rows($conec);
if($k>0)
{
$tot_pun_1=mysql_result($punto_cli,0,"puntos");
$tot_pun=$tot_pun_1;
}
$punto_pre=mysql_query("select punto_prom from promociones where id_prom='$var'",$conec);
$n=mysql_affected_rows($conec);
if($n>0)
{
$pun_pro_1=mysql_result($punto_pre,0,"punto_prom") ;
$pun_pro=$pun_prom+$pun_pro_1;
}
$saldo_1=$tot_pun_1-$pun_pro_1;
$saldo=$saldo_1;
}

if($ok=="Grabar")
{
$mov_pro=("insert into movpro (id_prom,fecha_mov,punto_mov,tip_moneda,imp_mov,ob servacion,tipcam,punt_acu,numdoc,codtipo) values('$var','$fec1','$punto','$rb','$imp','$obs' ,'$tip_cam','','$var3','$var4')");
$info=mysql_affected_rows($conec);
if($info>0)
{msgbox("Canje de la promocion"." ".$nom_pro." "."realizado");}
}
?>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<div align="center">
<table width="484" height="181" border="1">
<tr>
<th width="74" scope="col">fecha</th>
<th width="144" scope="col"><label>
<input name="fecha" type="<? echo $estado?>" id="fecha" value="<?php echo date("d/m/Y")?>" size="12" />
<input name="fec1" type="hidden" id="fec1" value="<?php echo date("Y/m/d")?>" />
<br />
</label></th>
<th width="72" scope="col">importe</th>
<th width="166" scope="col"><label>
<input name="imp" type="<? echo $estado?>" id="imp" value="<?php echo $imp?>" size="10" />
</label></th>
</tr>
<tr>
<th colspan="2" scope="row"><p>&nbsp;</p>
<p>moneda </p>
<p>
<label></label>
</p></th>
<td colspan="2"><p>
<label></label>
<label></label>
</p>
<div align="left">
<p>
<label>
<input name="rb" type="radio" value="SOLES" <? if ($rb=="SOLES") {echo "checked='checked'";} ?> />
</label>
soles </p>
<p>
<label>
<input name="rb" type="radio" value="DOLARES" <? if ($rb=="DOLARES") {echo "checked='checked'";} ?>/>
</label>
dolares </p>
</div></td>
</tr>
<tr>
<th scope="row">puntos</th>
<td><label>
<input name="punto" type="<? echo $estado?>" id="punto" value="<?php echo $punto?>" />
</label></td>
<td><strong>t/cambio</strong></td>
<td><label>
<input name="tip_cam" type="<? echo $estado?>" id="tip_cam" value="<?php echo $tip_cam?>" size="10" />
</label></td>
</tr>
<tr>
<th scope="row">comentario</th>
<td colspan="3"><label>
<input name="obs" type="text" id="obs" value="<?php echo $obs?>" size="60" />
</label></td>
</tr>
<tr>
<th colspan="2" scope="row"><label>
<div align="center">
<input name="ok" type="submit" id="ok" value="Grabar"/>
<label>
<input type="submit" name="Submit" onclick="javascript:window.opener.location.reload( )" value="Enviar" />
</label>
</div>

</label></th>
<td colspan="2"><label>
<div align="center">
<input name="Submit" type="submit" id="Submit" value="Cancelar" onclick="self.close()" />
</div>
</label></td>
</tr>
</table>
<table width="238" border="0">
<tr>
<th width="174" scope="col">total puntos</th>
<th width="115" scope="col"><label>
<input name="tot_pun" type="text" id="tot_pun" disabled="disabled" value="<?php echo $tot_pun?>" size="10" />
<input name="tot_pun_1" type="hidden" id="tot_pun_1" value="<?php echo $tot_pun_1?>" />
</label></th>
</tr>
<tr>
<th scope="row">puntos promo</th>
<th scope="row"><label>
<input name="pun_pro" type="text" id="pun_pro" disabled="disabled" value="<?php echo $pun_pro?>" size="10" />
<input name="pun_pro_1" type="hidden" id="pun_pro_1" value="<?php echo $pun_pro_1?>" />
</label></th>
</tr>

<tr>
<th scope="row">saldo </th>
<th scope="row"><label>
<input name="saldo" type="text" id="saldo" disabled="disabled" value="<?php echo $saldo?>" size="10" />
<input name="saldo_1" type="hidden" id="saldo_1" value="<?php echo $saldo_1?>" />
</label></th>
</tr>
</table>
</div>
</form>
</body>