Esempio n. 1
0
 public function roomsAction()
 {
     require_once 'models/homeModel.php';
     $model = new homeModel();
     if ($_POST['send'] == "addroom") {
         $newRoom = $model->insertRoom($_POST);
     }
     if ($_POST['send'] == "editroom") {
         $editRoom = $model->updateRoom($_POST);
     }
     $rooms = $model->getAllRooms();
     $this->_view->title = TITEL_ROOMS;
     $this->_view->rooms = $rooms;
     $this->_view->display('rooms/index.tpl.php');
 }
 public function render($tpl)
 {
     $cc = $this->_cconfig->read();
     extract($this->_vars);
     ob_start();
     if ($this->_login->is_login() == true or $cc['login'] == false) {
         require_once 'models/homeModel.php';
         $intern = new homeModel();
         $rooms = $intern->getAllRooms();
         $weather = $intern->getWeather();
         $settings = $intern->settings();
         $userdata = $intern->getUser($_SESSION[user_id]);
         include 'views/intern/header.tpl.php';
         include 'views/' . $tpl;
         include 'views/intern/footer.tpl.php';
     } else {
         include 'views/extern/header.tpl.php';
         include 'views/' . $tpl;
         include 'views/extern/footer.tpl.php';
     }
     return ob_get_clean();
 }
Esempio n. 3
0
 public function userAction()
 {
     require_once 'models/homeModel.php';
     $model = new homeModel();
     if ($_POST['send'] == "adduser") {
         # make password
         $_POST['pass'] = $model->makeApiKey("7");
         # make apikey
         $_POST['apikey'] = $model->makeApiKey("32");
         # add user in db
         $newUser = $model->insertUser($_POST);
     }
     if ($_POST['send'] == "edituser") {
         $editUser = $model->updateUser($_POST);
     }
     $rooms = $model->getAllRooms();
     $users = $model->getAllUsers();
     $this->_view->title = TITEL_USER;
     $this->_view->users = $users;
     $this->_view->display('user/index.tpl.php');
 }