예제 #1
0
 /**
  * Methode zum anzeigen des Contents.
  *
  * @return String Content der Applikation.
  */
 public function display()
 {
     $view = new View();
     switch ($this->template) {
         case 'createTables':
             $view->setTemplate('createTables');
             $oApi = new api();
             $aResult = $oApi->createDatabase();
             $view->assign('state', $aResult);
             break;
         case 'config':
             $view->setTemplate('config');
             if (!empty($this->sleep)) {
                 Model::setConfigSleepData($this->sleep);
             }
             $aConfigData = Model::getConfigSleepData();
             $view->assign('config', $aConfigData);
             break;
         case 'report':
             $view->setTemplate('report');
             $view->assign('state', $this->state);
             $aReportData = Model::getReportData();
             $view->assign('data', $aReportData);
             if (!empty($this->request['a'])) {
                 switch ($this->request['a']) {
                     case 1:
                         break;
                     case 2:
                         $view->assign('users', Model::getUser());
                         if ($this->user) {
                             $view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', $this->user));
                         } else {
                             $view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', '%%'));
                         }
                         break;
                     case 3:
                         $view->assign('reportDataApps', Model::getReportDataByApps());
                         break;
                     case 4:
                         $view->assign('reportDataMac', Model::getReportDataByParams('reportMac', '%%'));
                         break;
                     default:
                 }
             }
             break;
         default:
             $view->setTemplate('start');
     }
     return $view->loadTemplate();
 }
 public function save()
 {
     $obj = new asistenciaalumno();
     if ($_POST['identificador_editar'] == true) {
         $p = $obj->update($_POST);
         if ($p[0]) {
             die("<script> window.location='index.php?controller=asistenciaalumno'; </script>");
         } else {
             $data = array();
             $view = new View();
             $data['msg'] = $p[1];
             $data['url'] = 'index.php?controller=asistenciaalumno';
             $view->setData($data);
             $view->setTemplate('../view/_Error_App.php');
             $view->setLayout('../template/Layout.php');
             $view->render();
         }
     } else {
         $p = $obj->insert($_POST);
         if ($p[0]) {
             header('Location:index.php?controller=asistenciaalumno');
         } else {
             $data = array();
             $view = new View();
             $data['msg'] = $p[1];
             $data['url'] = 'index.php?controller=asistenciaalumno';
             $view->setData($data);
             $view->setTemplate('../view/_Error_App.php');
             $view->setLayout('../template/Layout.php');
             $view->render();
         }
     }
 }
 public function config()
 {
     $view = new View();
     $view->setTemplate('../view/_PanelConfig.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
예제 #4
0
 /**
  * Default action
  * @param $args array
  */
 public function index(array $args = array())
 {
     $hooks = array();
     \View::set('registerLayoutHooks', $hooks);
     \View::set('username', isset($_POST['username']) ? $_POST['username'] : '');
     \View::set('email', isset($_POST['email']) ? $_POST['email'] : '');
     \View::set('password', isset($_POST['password']) ? $_POST['password'] : '');
     \View::set('pageTitle', 'Register');
     $auth = $this->app->getModel('player');
     if (isset($_POST['register'])) {
         $insert = array();
         $insert['username'] = $_POST['username'];
         $insert['email'] = $_POST['email'];
         $insert['password'] = $_POST['password'];
         $insert['confirm_password'] = $_POST['password2'];
         try {
             /* Attempt to register the account */
             $register = $auth->create($insert);
         } catch (\Exception $e) {
             $message = '<strong>You could not be registered:</strong><ul>';
             foreach (unserialize($e->getMessage()) as $prev) {
                 $message .= '<li>' . $prev->getMessage() . '</li>';
             }
             $message .= '</ul>';
             \View::setMessage($message, 'warn');
         }
         /* If the account is active, redirect the user to the login page */
         if (isset($register['active']) && $register['active'] == '1') {
             \View::setMessage('Your accounts was successfully created. You may now log in.', 'success');
         } elseif (isset($register['active']) && $register['active'] == '0') {
             \View::setMessage('Your account has been created, but requires activation.', 'success');
             \View::setTemplate('Index.twig');
         }
     }
 }
 public function display()
 {
     $view = new View();
     $view->setTemplate('header');
     $view->assign('title', 'openmuseum');
     return $view->loadTemplate();
 }
 public function index()
 {
     if (!isset($_GET['p'])) {
         $_GET['p'] = 1;
     }
     if (!isset($_GET['q'])) {
         $_GET['q'] = "";
     }
     if (!isset($_GET['criterio'])) {
         $_GET['criterio'] = "evento.tema";
     }
     $obj = new eventoT();
     $data = array();
     $semestre_ultimo = $this->mostrar_semestre_ultimo();
     if ($_SESSION['cargo'] == 'Presidente' && $_SESSION['comicion'] == 'COMISION ESPECIAL DE TUTORIA') {
         $presidente = true;
     }
     $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio'], $semestre_ultimo, $_SESSION['idusuario']);
     $data['query'] = $_GET['q'];
     $cols = array("CODIGO", "Tema", "Tipo Evento", "Fecha", "Hora");
     $opt = array("evento.Tema" => "Tema", "evento.fecha" => "Fecha ", "evento.hora" => "Hora");
     $data['grilla'] = $this->grilla("eventoT", $cols, $data['data']['rows'], $opt, $data['pag'], FALSE, FALSE, false, false, false, false, $presidente);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/eventoT/_Index.php');
     $view->setLayout('../template/Layout3.php');
     $view->render();
 }
 public function index()
 {
     if (!isset($_GET['p'])) {
         $_GET['p'] = 1;
     }
     if (!isset($_GET['q'])) {
         $_GET['q'] = "";
     }
     if (!isset($_GET['criterio'])) {
         $_GET['criterio'] = "descripcion";
     }
     $obj = new plancursos();
     $data = array();
     $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio']);
     //SI EXISTE CRITERIO QUE BUSQUE
     $data['query'] = $_GET['q'];
     $data['pag'] = $this->Pagination(array('rows' => $data['data']['rowspag'], 'url' => 'index.php?controller=plancursos&action=index', 'query' => $_GET['q']));
     $cols = array("CODIGO", "Curso", "HP", "HT", "ESCUELA", "FACULTAD");
     //CABECERA DE LOS CAMPOS DE GRILLA
     $opt = array("idplan" => "CODIGO PLAN");
     //BUSQUEDA DE CAMPOS
     $data['plancurricular'] = $this->Select(array('id' => 'CodigoPlan', 'name' => 'CodigoPlan', 'table' => 'v_plan', 'code' => $obj->CodigoPlan));
     $data['grilla'] = $this->grilla("plancursos", $cols, $data['data']['rows'], $opt, $data['pag'], true, true);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/plancursos/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
예제 #8
0
 /**
  *
  * @param Resource $resource
  * @param Request $request
  */
 public function __construct(Resource $resource, Request $request)
 {
     $this->resource = $resource;
     $this->request = $request;
     $viewClass = $resource->getViewType() == null ? Registry::get("DEFAULT_VIEW") : $resource->getViewType();
     $this->view = new $viewClass($request->debug);
     if ($resource->getViewTemplate() != null) {
         $this->view->setTemplate($resource->getViewTemplate());
     }
     if (Registry::get("COMPRESS_OUTPUT")) {
         ob_start("ob_gzhandler");
     }
     if (!headers_sent()) {
         session_start();
     }
 }
예제 #9
0
 /**
  * Default action.
  *
  * @param $args array
  */
 public function index(array $args = array())
 {
     $error = null;
     $playerModel = \App::getModel('Player');
     $session = \App::getModel('Session');
     if (empty($_POST['username']) || empty($_POST['password'])) {
         $error = 'Please enter your username and password!';
     } else {
         try {
             $player = $playerModel->authenticate($_POST['username'], $_POST['password']);
         } catch (\Exception $e) {
             $error = 'Invalid username and/or password.';
             if (\Config::get('security.login.showInvalidLoginReason')) {
                 $error = $e->getMessage();
             }
         }
     }
     if (isset($error)) {
         $session->clear();
         $error = '<strong>Sorry, you could not be logged in...</strong><br />' . $error;
         \View::setMessage($error, 'fail');
         /* Changed from a header to just grabbing the view itself */
         \View::setTemplate('Index.twig');
         \View::set('credentials', array('username' => \Config::get('security.login.returnUsernameOnFailure') ? isset($_POST['username']) ? $_POST['username'] : '' : ''));
     }
 }
 public function display()
 {
     $view = new View();
     $view->setTemplate('navBar');
     $view->assign('active', $this->active);
     return $view->loadTemplate();
 }
 public function index()
 {
     //        if (!isset($_GET['p'])) {
     //            $_GET['p'] = 1;
     //        }
     //        if (!isset($_GET['q'])) {
     //            $_GET['q'] = "";
     //        }
     //        if (!isset($_GET['criterio'])) {
     //            $_GET['criterio'] = "detalle_asignacion_tutoria.CodigoSemestre";
     //        }
     //         $obj = new asignaciontutoria();
     //        $data = array();
     //        $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio']);
     //        $data['query'] = $_GET['q'];
     //        $data['pag'] = $this->Pagination(array('rows' => $data['data']['rowspag'], 'url' => 'index.php?controller=alumno&action=index', 'query' => $_GET['q']));
     //        $cols = array("CODIGO", "Docente");
     //         $opt = array("" => "------","CodigoSemestre" => "Semestre");
     //
     //         $data['facultades'] = $this->Select(array('id' => 'CodigoFacultad', 'name' => 'CodigoFacultad', 'table' => 'facultades', 'code' => $obj->CodigoFacultad));
     //         $data['semestreacademico'] = $this->SelectActual(array('id' => 'CodigoSemestre', 'name' => 'CodigoSemestre', 'table' => 'semestreacademico', 'code' => $obj->CodigoSemestre));
     $data['contenido'] = $this->grilla_informativo();
     //        $data['grilla'] = $this->grilla("asignaciontutoria", $cols, $data['data']['rows'], $data['pag'], false, false);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/contenido/_Index.php');
     $view->setLayout('../template/LayoutInformativo.php');
     $view->render();
 }
예제 #12
0
 public function display()
 {
     $view = new View();
     // äussere View
     $contentView = new View();
     $this->daten['menu'] = Model::getMenu();
     switch ($this->action) {
         case "liste":
             // Methode aus Model wird aufgerufen
             // ohne Instanz
             $this->daten['content'] = Model::getDaten();
             $contentView->setDaten($this->daten['content']);
             // gibt Daten an Innerview
             $contentView->setTemplate("liste");
             // gibt Template an Innerview
             break;
         case "inputform":
             $contentView->setTemplate("inputform");
             break;
         case "inputformprocessing":
             $z = Model::setDaten($_REQUEST['vorname'], $_REQUEST['nachname'], $_REQUEST['alter']);
             $this->daten['content'] = Model::getDataset($z);
             $contentView->setDaten($this->daten['content']);
             $contentView->setTemplate("oneDataset");
             // gibt Template an Innerview
             break;
         case "delete":
             echo "delete";
             break;
         default:
             // Template "home" mit Text für Default
             // Textausgaben: "Programm zur Datenverwaltung
             $contentView->setTemplate("home");
             break;
     }
     // wir laden das Template der inneren View und schieben
     // die entstandenen Daten in die äußeren View
     $view->setDaten(array("content" => $contentView->loadTemplate(), "menu" => $this->daten['menu']));
     // wir laden das Template der äußeren View
     $output = $view->loadTemplate();
     if ($output) {
         echo $output;
     } else {
         echo "Fehler";
     }
 }
예제 #13
0
 /**
  * Default action
  */
 public function index()
 {
     if (!headers_sent()) {
         header('HTTP/1.1 404 Not Found');
         header('Status: 404 Not Found');
     }
     \View::setTemplate('Error.twig');
 }
 public function create()
 {
     $b = $_POST['a'];
     $data = array();
     $view = new View();
     //$data['comision'] = $this->Select(array('id' => 'idcomision', 'name' => 'idcomision', 'table' => 'comision_cca', 'code' => $obj->idcomision));
     $data['docente'] = $this->Select(array('id' => 'iddocente', 'name' => 'iddocente', 'table' => 'docente_cca', 'code' => $obj->iddocente));
     $view->setData($data);
     if (isset($b)) {
         $view->setTemplate('../view/asignatura_cca/_Form.php');
         $view->setLayout('../template/List.php');
         return $view->render();
     } else {
         $view->setTemplate('../view/asignatura_cca/_Form.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
 public function index()
 {
     $data['semestreacademico'] = $this->cinco_ultimos_semestres(array('id' => 'CodigoSemestre', 'name' => 'CodigoSemestre', 'table' => 'semestreacademico', 'code' => $obj->CodigoSemestre));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/misasistenciasAlumno/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
예제 #16
0
파일: Controll.php 프로젝트: seishinsan/LDM
 public function display()
 {
     $view = new View();
     switch ($this->template) {
         default:
             $view->setTemplate('default');
     }
     return $view->loadTemplate();
 }
 public function index()
 {
     $data = array();
     $data['sucursal'] = $this->Select(array('id' => 'idsucursal', 'name' => 'idsucursal', 'table' => 'sucursal'));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/_seleccion.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
 public function index()
 {
     $obj = new reporteasistencias();
     $data = array();
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/reporteasistencias/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
 public function index()
 {
     $data = array();
     $data['semestreacademico'] = $this->Select1(array('id' => 'semestreacademico', 'name' => 'semestreacademico', 'filtro' => $_SESSION['idusuario']));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/alumnoproyecto/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
 public function insertarDetalle_asistencia_alumnos()
 {
     $obj = new solicitudes_ps();
     $obj->InsertDet_asistencia_alumnos($_REQUEST);
     header('Location: index.php?controller=solicitudes_ps');
     $data = array();
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/_Error_App.php');
     echo $view->renderPartial();
 }
 public function verBiblio($p)
 {
     $bib = new bibliografia();
     $data = array();
     $data['rows2'] = $bib->getBibliografia($_POST);
     $data['rows5'] = $bib->getTipoBibliografia();
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/bibliografia/_biblio.php');
     echo $view->renderPartial();
 }
 public function Index()
 {
     $Index = new Index();
     $data = array();
     $data['html'] = $Index->index();
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
예제 #23
0
 public function Modulos()
 {
     $data = array();
     $objpermisos = new Permisos();
     $data['mod'] = $objpermisos->Modulos($_GET['idperfil']);
     $data['idperfil'] = $_GET['idperfil'];
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/Permisos/_Modulos.php');
     echo $view->renderPartial();
 }
 public function delete()
 {
     $obj = new evento_proyeccion_social();
     $p = $obj->delete($_GET['id']);
     if ($p[0]) {
         header('Location: index.php?controller=evento_proyeccion_social');
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=evento_proyeccion_social';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
 public function save()
 {
     $obj = new asistenciaalumnoGeneral();
     $p = $obj->update($_REQUEST['idevento'], $_REQUEST['codigoalumno'], $_SESSION['idusuario'], $_REQUEST['asistencia']);
     if ($p[0]) {
         die("<script> window.location='index.php?controller=asistenciaalumnoGeneral'; </script>");
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=asistenciaalumnoGeneral';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout3.php');
         $view->render();
     }
 }
 public function save()
 {
     $obj = new solicitudes();
     $p = $obj->update($_POST);
     if ($p[0]) {
         header('Location: index.php?controller=solicitudes');
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=solicitudes';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
 public function mostrar_alumnos()
 {
     $obj = new asistenciaalumno();
     $data = array();
     $semestre_ultimo = $this->mostrar_semestre_ultimo();
     $detector = $obj->detectando($_REQUEST['idevento'], $_SESSION['idusuario']);
     if (empty($detector)) {
         $datos_alumnos = $obj->alumnos_de_profe($semestre_ultimo, $_SESSION['idusuario']);
         $llenar = $obj->insert($_REQUEST['idevento'], $_SESSION['idusuario'], $datos_alumnos);
     }
     $data['alumno_evento'] = $obj->lista_alumnos($_REQUEST['idevento'], $_SESSION['idusuario'], $semestre_ultimo);
     $data['idevento'] = $_REQUEST['idevento'];
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/asistenciaalumno/lista_alumnos_asistencia.php');
     echo $view->renderPartial();
 }
 public function save()
 {
     echo "<script>alert('Se ha enviado la solicitud');</script>";
     echo header("Location: index.php?controller=listaproyecto");
     $obj = new listaproyecto();
     $p = $obj->insert($_POST);
     if ($p[0]) {
         die("<script>alert()</script>");
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=listaproyecto';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
예제 #29
0
 /**
  * setPassword
  */
 public function setpassword()
 {
     if ($_POST['username'] && $_POST['password']) {
         $playerModel = \App::getModel('Player');
         $playerModel->safeMode = false;
         $player = $playerModel->find($_POST['username'], 'username');
         if ($player !== false) {
             $id = $player['player_id'];
             $password = password_hash($_POST['password'], PASSWORD_BCRYPT);
             $playerModel->save(array('player_id' => $id, 'password' => $password));
             \View::setMessage('Old Password Has: ' . $player['password'], 'info');
             \View::setMessage('New Password Set: ' . $password, 'success');
         } else {
             \View::setMessage('Username Not Found', 'warn');
         }
         \View::setTemplate('DevTools.twig');
     }
     $this->index();
 }
 public function insertar_pagos($_G)
 {
     $monto = $_GET['monto'];
     $fecha_p = $_GET['fecha_p'];
     $alumno = $_GET['alumno'];
     $fecha_r = $_GET['fecha_r'];
     $voucher = $_GET['voucher'];
     $idusuario = $_GET['idusuario'];
     //        var_dump($_GET['fechacrono']);
     $obj = new pagos_cca();
     $p = $obj->insert($_GET);
     if ($p[0]) {
         header('Location:index.php?controller=pagos_cca');
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=alumno_cca';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }