Example #1
0
    header("Location: ../masterPage.php");
    if (!empty($_POST['cboTiemposPresupuesto'])) {
        if (empty($nombre_presupuesto)) {
            $_SESSION['alerta-contenido'] = "Debe agregar el nombre del presupuesto";
            exit;
        }
        $resultado = $db->agregarPresupuesto($nombre_presupuesto, $codigo, $tiempo_presupuesto, $tiempo_sobrante);
        if ($resultado === FALSE) {
            $_SESSION['alerta-contenido'] = "Error al agregar el presupuesto";
            exit;
        } else {
            $_SESSION['alerta'] = 2;
            $_SESSION['alerta-contenido'] = "Presupuesto agregado";
            ///////////// registro de actividad //////////
            $descripcionRegistroActividad = "Se agregó el presupuesto: " . $nombre_presupuesto . " con " . $_POST['cboTiemposPresupuesto'] . " tiempos.";
            $dbRegistroActividad->agregarRegistroActividad($utc, $fecha, $usuario, $descripcionRegistroActividad);
            /////////////////////////////////////////////
        }
    }
    exit;
}
//////////////// ELIMINAR /////////////////////////////////////////////////
if (isset($_POST['btnEliminarPresupuesto'])) {
    $_SESSION['alerta'] = 1;
    header("Location: ../masterPage.php");
    if (empty($id_presupuesto)) {
        $_SESSION['alerta-contenido'] = "Se debe seleccionar un presupuesto";
        exit;
    }
    //////// Verifica que el presupuesto no este siendo usado ///
    /// De proyectos