Exemple #1
0
                    $toshow = $pro->getNombre();
                    break;
                case 'estado':
                    if ($t[$c] == 1) {
                        $toshow = "<div class='text-center estado'><i class='fa fa-cog fa-spin'></i></div>";
                    } else {
                        $toshow = "<div class='text-center estado'><i class='fa fa-cog'></i></div>";
                    }
                    break;
                default:
                    $toshow = $t[$c];
                    break;
            }
            echo "<td>" . $toshow . "</td>";
        }
        $job = new Tarea($t['id']);
        echo "<td class='tiempodedicado'>" . secondsToHuman($job->getTiempos($_SESSION['idusuario'])) . "</td>";
        echo "<td class='acciones'>";
        if ($job->estado == 0) {
            echo "<div class='empezarparar text-center'><button class='empezar' rel='" . $t['id'] . "'><i class='fa fa-play'></i></button></div>";
        } else {
            echo "<div class='empezarparar text-center'><button class='parar' rel='" . $t['id'] . "'><i class='fa fa-stop'></i></button></div>";
        }
        echo "</td>";
        echo "</tr>";
    }
    ?>
		</table>
		<?php 
}
include_once 'footer.php';
Exemple #2
0
//ini_set("display_errors", 1);
include_once "../config/configuration.php";
include_once "../clases/conexion.php";
include_once "../clases/1modelo.php";
include_once "../clases/tareas.php";
include_once "../clases/tiempo.php";
include_once "../clases/usuario_tarea.php";
include_once "../funciones/funciones.php";
if (isset($_POST['accion'])) {
    $tarea = new Tarea($_POST['id']);
    switch ($_POST['accion']) {
        case 'empezar':
            echo $tarea->start();
            break;
        case 'parar':
            echo secondsToHuman($tarea->stop());
            //echo "parar: " . $_POST['id'];
            break;
        case 'getall':
            break;
        case 'crear':
            $resultado = crearTarea();
            break;
        default:
            //print_r(json_encode($tarea));
            break;
    }
} else {
    echo json_encode("Error: falta campo acción.");
}
/***