Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/11/2013, 11:46
Avatar de rachpts
rachpts
 
Fecha de Ingreso: febrero-2012
Mensajes: 117
Antigüedad: 12 años, 2 meses
Puntos: 0
Pregunta Que tengo mal en este codigo

amigos eh intentado ya varias formas y no logro encontrar cual es mi problema en este codigo espero me puedan ayudar
Código PHP:
<?php

    $dia 
$_REQUEST['dia']; 
        
$subdepto $_REQUEST['subdepto'];
                
               
                include 
"conexion.php";
                
                echo 
$dia;
                echo 
$subdepto;
                
                if(
$subdepto== "CAPTURA") {
    
        
        
$query1 "select `fecha` , `subdepto`  as doc FROM turnos_generales WHERE `fecha`='$dia' AND `subdepto`='CAPTURA'";
        
$result1 mysql_query($query1) or die("Imposible verificar al usuario por el error: " mysql_error());
        
$dato1 mysql_fetch_array($result1);
        
    if(
mysql_num_rows($result1) == 1){
    
        
session_start();
                
                
$_SESSION["autentificado"]= "SI"
        
$_SESSION["fecha"]= $dato1['fecha'];
        
$_SESSION["doc"]= $dato1['doc']; 
                
                
                
$_SESSION["ultimoacceso"]= date("Y-n-j H:i:s"); 
                
                
header ("Location: consulta_licencias.php"); 
        
}else { 
    
//si no existe le mando otra vez a la portada 
     
        
echo "<script language=\"JavaScript\">";
        echo 
"alert(\"NO HAY RESULTADOS.\");";
        echo(
"location.href='productividad_licencias.php'");
        echo 
"</script>";
}
}



if(
$subdepto=="ORDEN DE PAGO") {
        
$dia $_REQUEST['dia']; 
        
        
$query2 "select `fecha` ,  `subdepto`  as dic FROM turnos_generales WHERE fecha ='$dia' AND subdepto ='ORDEN DE PAGO'";
        
$result2 mysql_query($query2) or die("Imposible verificar al usuario por el error: " mysql_error());
        
$dato2 mysql_fetch_array($result2);
        
    if(
mysql_num_rows($result2) == 1){
        
//usuario y contraseña válidos 
    
        
       
session_start();
        
$_SESSION["fecha"]= $dato2['fecha'];
        
$_SESSION["dic"]= $dato2['dic']; 
                
                
header ("Location: consulta_licenciasO.php"); 
        
}else { 
    
//si no existe le mando otra vez a la portada 
     
        
echo "<script language=\"JavaScript\">";
        echo 
"alert(\"NO.\");";
        echo(
"location.href='productividad_licencias.php'");
        echo 
"</script>";
}
}

  
?>

Última edición por gnzsoloyo; 12/11/2013 a las 12:30