Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2011, 10:16
Avatar de cadrogui
cadrogui
 
Fecha de Ingreso: junio-2003
Mensajes: 875
Antigüedad: 20 años, 10 meses
Puntos: 5
Soporte me dice q mi php esta mal - PHP Cron

hola gente, tengo este script y si lo llamo desde el browser funciona bien, pero al momento de ponerlo en cronjobs mediante el cpanel, no me funciona, me he puesto en contacto con el soporte tecnico y me dicen q cron funciona y envia la notificacion y que el problema esta en mi php, bueno les dejo el php para saber si es mi php u otra cosa.

gracias.

Código PHP:
<?

include("bd.class.php");

$db = new db_class;
$db->connect();

$sql_tot "SELECT COUNT(*) FROM mensuras";

$total_mensuras $db->select_one($sql_tot);

//$db->print_last_error();

function Enotifica($nombre_concesion$propietario$correo$mje_per){
    
    
$mje "Alerta de Cierre de Ciclo en manifestación: ";
    
$mje .= $nombre_concesion;
    
$mje .= " propiedad de: ";
    
$mje .= $propietario;
    
$mje .= "\r\n";    
    
$mje .= "\r\n";    
    
$mje .= $mje_per;    
    
    
$headers "From: Alerta <[email protected]>\r\n";
    
    
$sujeto "Alerta en " .$nombre_concesion;
    
    
mail($correo$sujeto$mje$headers);
}

for (
$i=1$i<=$total_mensuras$i++):

    
$sql "SELECT * FROM mensuras WHERE id = '" .$i ."' AND flag = 1";
    
$consulta $db->select($sql);
    
$muestro_data $db->get_row($consulta'MYSQL_BOTH');
    
    
$Alerta = array();
    
$Alerta[] = "ALRE_" .$muestro_data['alerta_resolucion'];
    
$Alerta[] = "INPA_" .$muestro_data['inscribir_pagar'];
    
    
$Alerta[] = "SME1_" .$muestro_data['solicitud_mensura_1'];
    
$Alerta[] = "SME2_" .$muestro_data['solicitud_mensura_2'];
    
    
$Alerta[] = "ALOP_" .$muestro_data['alerta_oposicion'];
    
    
$Alerta[] = "AFM1_" .$muestro_data['alerta_finmensura_1'];
    
$Alerta[] = "AFM2_" .$muestro_data['alerta_finmensura_2'];
    
$Alerta[] = "AFM3_" .$muestro_data['alerta_finmensura_3'];
    
$Alerta[] = "AFM4_" .$muestro_data['alerta_finmensura_4'];

    
$total_alertas count($Alerta);

    for(
$a=0$a<=$total_alertas$a++):
    
        if (
substr($Alerta[$a], -5) != "00-00"):
    
            
$Alerta_Exp explode("_"$Alerta[$a]);
            
            
$Alerta_Nom $Alerta_Exp[0];
            
$Alerta_Fech $Alerta_Exp[1];

            if(
$Alerta_Fech == date("Y-m-j")):
            
                switch(
$Alerta_Nom):
                
                    case (
"ALRE"):
                        
$mje_per "Se notifica sobre el evento: Resolución judicial";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"INPA"):
                        
$mje_per "Se notifica sobre el evento: Incribir, Públicar en boletín,  y pago tasa fiscal";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"SME1"):
                        
$mje_per "Se notifica sobre el evento: Solicitud Mensura (Día 200), entregar expediente y solicitud de mensura";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"SME2"):
                        
$mje_per "Se notifica sobre el evento: Solicitud Mensura (Día 210), entregar expediente y solicitud de mensura";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"ALOP"):
                        
$mje_per "Se notifica sobre el evento: Verificar Posible Oposición";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"AFM1"):
                        
$mje_per "Se notifica sobre el evento: Fin Mensura (Mes 12)";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"AFM2"):
                        
$mje_per "Se notifica sobre el evento: Fin Mensura (Mes 13)";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"AFM3"):
                        
$mje_per "Se notifica sobre el evento: Fin Mensura (Mes 14)";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;
                    
                    case (
"AFM4"):
                        
$mje_per "Se notifica sobre el evento: Fin Mensura (Mes 15)";
                        
Enotifica($muestro_data['nombre_concesion'], $muestro_data['propietario'], $muestro_data['destino_alerta'], $mje_per);
                    break;                
                endswitch;            
            endif;
        endif;
    endfor;
endfor;

?>
__________________
La mejor manera de aprender es por medio de un aprendizaje significativo....

http://www.cocert.cl