예제 #1
0
     $usuario_controller = new Usuario_controller();
     foreach ($_POST as $array) {
         foreach ($array as $id) {
             if (!$usuario_controller->eliminar_permanente($id)) {
                 header('Location:papelera_usuarios.php?tipo=9&exito=error&accion=borrar');
                 exit;
             }
         }
     }
     header('Location: papelera_usuarios.php?tipo=9&exito=ok&accion=borrar');
     exit;
 } else {
     if (isset($_GET['papelera']) && $_GET['tipo'] == 'contenido' && is_numeric($_GET['id_contenido'])) {
         include_once RUTA_CONTROLLERS . '/Contenido_controller.php';
         $contenido_controller = new ContenidoController();
         $url = $contenido_controller->eliminar_todos_permanente($_GET['id_contenido']) ? 'papelera.php?tipo=' . $_GET['id_contenido'] . '&exito=ok&accion=borrar' : 'papelera.php?&tipo=' . $_GET['id_contenido'] . '&exito=error&accion=borrar';
         header('Location:' . $url);
     } else {
         if (isset($_GET['papelera']) && $_GET['tipo'] == 'usuario') {
             include_once RUTA_CONTROLLERS . '/Usuario_controller.php';
             $usuario_controller = new Usuario_controller();
             $url = $usuario_controller->eliminar_todos_permanente() ? 'papelera_usuarios.php?tipo=9&exito=ok&accion=borrar' : 'papelera_usuarios.php?&tipo=9&exito=error&accion=borrar';
             header('Location:' . $url);
         } else {
             if ($_GET['tipo_contenido'] != 9) {
                 header('Location:todos.php?tipo=' . $_GET['tipo_contenido'] . '&exito=error');
             } else {
                 header('Location:todos_usuarios.php?tipo=' . $_GET['tipo_contenido'] . '&exito=error');
             }
         }
     }