Ver Mensaje Individual
  #4 (permalink)  
Antiguo 07/03/2010, 11:25
NaikiOwned
 
Fecha de Ingreso: agosto-2009
Mensajes: 110
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: problemas con el submit T_T HELP

=( hice lo que recomendaste y nada waaaa!!!!

Código PHP:
<?php
require('Connections/db-cnx.php');

   
$not_ID $_GET['not_ID']; 
   
     
$row=mysql_fetch_array(mysql_query("select * from apuesta where id_a='".$not_ID."'"));
       
$bet1 $row['bet1'];
       
$bet2 $row['bet2'];
       
$empate $row['empate'];
       
$fec_fin $row['fec_fin'];
    
    
$fecha = new DateTime();
    
$actual $fecha->format('Y/m/d h:i:s');
//si la hora actual ya paso el tiempo final    
if($fec_fin $actual){
    
$raw=mysql_fetch_array(mysql_query("select * from detalle_a where id_a='".$not_ID."'"));
        
$cant $raw['cantidad'];
        
$id $raw['id'];
        
        if(
$_GET['do']=='pagar')
        {
            
$gano $_POST['radio'];

            if(
$gano == "local")
            {
            
$win floor(((($bet2+$empate)/$bet1)*$cant)+$cant);
            
$q "update tz_members set puntos = puntos + ".$win." where id='".$id."' and apuesta = 'local'"
                
mysql_query($q) or die(mysql_error());
            }
            if(
$gano == "visita")
            {
            
$win floor(((($bet1+$empate)/$bet2)*$cant)+$cant);
            
$q "update tz_members set puntos = puntos + ".$win." where id='".$id."' and apuesta = 'visita'"
                
mysql_query($q) or die(mysql_error());
            }
            if(
$gano == "empate")
            {
            
$win floor(((($bet1+bet2)/$empate)*$cant)+$cant);
            
$q "update tz_members set puntos = puntos + ".$win." where id='".$id."' and apuesta = 'empate'"
                
mysql_query($q) or die(mysql_error());
            }
            
            
            
$qq "update apuesta set estado = 1 where id_a='".$not_ID."'"
                
mysql_query($qq) or die(mysql_error());
            
$qqq "update detalle_a set ganancia = ".$win." where id_a='".$not_ID."' and id='".$id."'"
                
mysql_query($qqq) or die(mysql_error());
                
                echo 
"<script> alert (\"Las Apuestas fueron Pagadas.\"); </script>";
                echo 
"<script language=Javascript> location.href=\"panel_apuesta.php\"; </script>";
            
            }
        
?>
        <form action="?do=pagar" method="post">
        <input type="radio" name="radio" value="local" /><?php echo $row['equipo1']; ?><br />
        <input type="radio" name="radio" value="visita" /><?php echo $row['equipo2']; ?><br />
        <input type="radio" name="radio" value="empate" /> EMPATE !<br />
        <input type="submit" name="submit" value="pagar" />
        </form>
<?php
}else 
echo 
"Todavia no finaliza el Partido";


?>