Exemplo n.º 1
0
 protected function Index()
 {
     //If user isn't logged in redirect to login,
     //if user is logged in check permissions for controller
     parent::CheckLoggedIn();
     $model = new DashboardModel("Index");
     $model->setPageTitle('Dashboard');
     $this->ReturnViewByName("index", $model->view, "layout");
 }
 public function addPhotoToOeuvre()
 {
     //Auth::checkSupervisorAuthentication();
     $oeuvre_id = $_POST['oeuvre_id'];
     DashboardModel::addPhotoToOeuvre($oeuvre_id);
     Redirect::to('dashboard/index');
 }
Exemplo n.º 3
0
 * User: Adrien
 * Date: 30/12/2014
 * Time: 17:05
 */
//////////////////////////////
// CONTROLLER dashboard.php //
//////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
// Appel aux classes de Model pour récupérer les données
include_once __DIR__ . "/../model/DashboardModel.php";
/////////////////////////////////////////////////////////////////////////////////////////
// Traitement des données et des informations diverses
// Variable de session
$userid = $_SESSION['userid'];
// Instanciation de l'objet dashboard
$dashboard = new DashboardModel();
// Récupération des information de la machine
$sysname = $dashboard->getSysName();
$sysdescrip = $dashboard->getSysDesc();
$sysuptime = $dashboard->getSysUpTime();
$systime = $dashboard->getSysTime();
// Génération des graphiques de RRDTOOLS
$dashboard->setRrdGraph('cpu');
$dashboard->setRrdGraph('ram');
$dashboard->setRrdGraph('hdd');
$dashboard->setRrdGraph('sis0');
$dashboard->setRrdGraph('sis1');
$dashboard->setRrdGraph('sis2');
$dashboard->setRrdGraph('sis3');
$dashboard->setRrdGraph('sis4');
// Récipération des adresses MAC des interfaces
Exemplo n.º 4
0
 public function Profile()
 {
     $history = $this->model->getHistory($this->route['user'], 50);
     $record = $this->model->getRecord($this->route['user']);
     if ($this->route['user'] == _ControllerFront::$session->u_id) {
         $user_data = $this->model->u_row;
     } else {
         $user_data = null;
     }
     $this->loadModel('Dashboard');
     $m = new DashboardModel();
     $this->view(array('data' => array('history' => $history, 'record' => $record, 'name_space' => 'user', 'user_data' => $user_data, 'chart_edits' => $m->getChartEdits($this->route['user']), 'chart_tables' => $m->getChartTables($this->route['user']))));
 }
 public function deletePhotoOeuvre($oeuvre_photo_id)
 {
     // All methods inside this controller are only accessible for admins (= users that have role type 7)
     //Auth::checkSupervisorAuthentication();
     DashboardModel::deletePhotoOeuvre($oeuvre_photo_id);
     Redirect::to('dashboard/index');
 }
Exemplo n.º 6
0
Arquivo: test.php Projeto: aramisf/-
<?php

/**
 * Created by PhpStorm.
 * User: Adrien
 * Date: 12/01/2015
 * Time: 15:58
 */
include_once __DIR__ . "/../model/dashboardModel.php";
$dashboard = new DashboardModel();
$infoifsis0 = $dashboard->getInfoIf('sis0');
var_dump($infoifsis0);
Exemplo n.º 7
0
 public function Index()
 {
     $this->loadModel('Dashboard');
     $m = new DashboardModel();
     $this->view(array('data' => array('users' => $m->getUsers(), 'groups' => $this->model->getGroups())));
 }
 /**
  * Get a single note
  * @param int $oeuvre_id id of the specific oeuvre
  * @return object a single object (the result)
  */
 public static function getAllPhotoOeuvreByUserId()
 {
     $database = DatabaseFactory::getFactory()->getConnection();
     $sql = "SELECT op.oeuvre_photo_id, op.oeuvre_has_photoOeuvre\n                   FROM oeuvres AS o, oeuvres_photos AS op WHERE o.user_id = :user_id AND o.oeuvre_id = op.oeuvre_id AND o.supervisor_id = op.employee_id";
     $query = $database->prepare($sql);
     $query->execute(array(':user_id' => Session::get('user_id')));
     $all_oeuvrePhotos = array();
     foreach ($query->fetchAll() as $oeuvrePhoto) {
         // all elements of array passed to Filter::XSSFilter for XSS sanitation, have a look into
         // application/core/Filter.php for more info on how to use. Removes (possibly bad) JavaScript etc from
         // the oeuvrePhoto's values
         array_walk_recursive($oeuvrePhoto, 'Filter::XSSFilter');
         $all_oeuvrePhotos[$oeuvrePhoto->oeuvre_photo_id] = new stdClass();
         $all_oeuvrePhotos[$oeuvrePhoto->oeuvre_photo_id]->oeuvre_photo_id = $oeuvrePhoto->oeuvre_photo_id;
         $all_oeuvrePhotos[$oeuvrePhoto->oeuvre_photo_id]->oeuvrePhoto_photoOeuvre_link = DashboardModel::getPublicPhotoOeuvreFilePathOfOeuvre($oeuvrePhoto->oeuvre_has_photoOeuvre, $oeuvrePhoto->oeuvre_photo_id);
     }
     return $all_oeuvrePhotos;
 }