Example #1
0
$cantidad = sizeof($nId_cron);
for ($i = 0; $i < $cantidad; $i++) {
    error_log("Antes de Operar" . $time . "\n", 3, $log_file);
    if ($nFuncion[$i] == 'crearTramite') {
        error_log("Antes de Operar" . $time . "\n", 3, $log_file);
        // CREO UN OBJETO DE TIPO: Tramite
        $tramite = new Tramite($nId_cron[$i], $nParams[$i], $nFuncion[$i], $nfecha[$i]);
        // CARGAR EL JSON DESDE EL PARAMETRO DEL OBJETO
        $json_decode = json_decode($tramite->getParams());
        // RELLENO LAS VARIABLES
        $id_cron = $tramite->getId_cron();
        $funcion = $tramite->getFuncion();
        $fecha = $tramite->getfecha();
        error_log("Antes de Operar" . $time . "\n", 3, $log_file);
        //OPERAR
        operar($funcion, $json_decode, $id_cron, $fecha, $errores);
        error_log("Despues de Operar" . $time . "\n", 3, $log_file);
    }
}
$fin = strtotime('now');
$duracion = $fin - $inicio;
if ($errores <= 0) {
    $errores = 10;
}
if ($cantidad == 1 && $duracion > 10 || $cantidad > 1) {
    $ARRAY_log['cantidad'] = $cantidad;
    $ARRAY_log['errores'] = $errores;
    $ARRAY_log['origen'] = 'CRON';
    $ARRAY_log['duracion'] = $duracion;
    insertar_lOG($ARRAY_log);
    insertar_lOG($ARRAY_log);
Example #2
0
    if ($hora < 0 || $hora > 23) {
        return "La {$hora} es incorrecta";
    } else {
        if ($hora <= 12) {
            return "Las {$hora} AM";
        } else {
            return "Las {$hora} PM";
        }
    }
}
//////////////////////////////////////////
$mng = "";
if (isset($_POST['operacion'])) {
    extract($_POST);
    //$numA,$numB,$operacion
    $mng = operar($numA, $numB, $operacion);
}
$mngHora = "";
if (isset($_POST['formHora'])) {
    extract($_POST);
    //$hora
    $mngHora = validarHora($hora);
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>