Esempio n. 1
0
 function scroll($params)
 {
     $sess =& $_SESSION["dashboard"];
     $dashboard = new Model_Dashboard();
     $listevents = $dashboard->getEventsWithoutSess();
     if (is_array($listevents)) {
         $list = null;
         foreach ($listevents as $event) {
             echo $this->view->render("dashboard_events_event", array("event" => $event));
         }
     } else {
         echo 'end';
     }
 }
Esempio n. 2
0
 public function index()
 {
     if (isset($_GET["clear"])) {
         unset($_SESSION["dashboard"]);
     }
     $this->view->setTitle("Dashboard");
     $dashboard = new Model_Dashboard();
     $sess =& $_SESSION["dashboard"];
     if (isset($sess["date"])) {
         $date = date("m/d/y", strtotime($sess["date"]));
         $formatDate = date("d F Y", strtotime($sess["date"]));
     } else {
         $date = date("m/d/y");
         $formatDate = date("d F Y");
     }
     $this->view->setLeftContent($this->view->render("left_dashboard", array("notify" => $dashboard->getNotify(), "date" => $date, "formatDate" => $formatDate)));
     if (isset($_GET["page"])) {
         if (is_numeric($_GET["page"])) {
             if (!$dashboard->setPage($_GET["page"])) {
                 $this->__call("tt", "index");
             }
         }
     }
     $dashboard->links = "/";
     $list = null;
     if (!isset($this->args[0]) or $this->args[0] == "page") {
         $listevents = $dashboard->getEvents();
         if (count($listevents) == 0) {
             $list = "Событий нет";
         }
         foreach ($listevents as $event) {
             $list .= $this->view->render("events_event", array("event" => $event));
         }
         $this->view->dashboard(array("list" => $list));
         //Отобразим пейджер
         if (count($dashboard->pager) != 0) {
             $this->view->pager(array("pages" => $dashboard->pager));
         }
     }
     $this->view->showPage();
 }
Esempio n. 3
0
 private function dashboard()
 {
     $ui = new Model_Ui();
     $dashboard = new Model_Dashboard();
     $dash["events"] = $dashboard->findEvents();
     if ($dashboard->getServiceVar()) {
         $dash["service"] = true;
     }
     $dash["notify"] = $dashboard->getnumEventsVar();
     if (count($dash["events"]) == 0) {
         $dash["events"] = "<p id='emptyEvents'>Новых событий нет</p>";
     }
     if (isset($this->registry["module_chat"])) {
         $chat = $this->registry["module_chat"];
         $rooms = $chat->getChatsRoom();
         $dash["rooms"] = $chat->getRenderRooms();
         $dash["numChats"] = count($rooms);
     }
     $dash = json_encode($dash);
     $this->view->setBottomPanel($this->view->render("fastmenu_dashboard", array("dash" => $dash)), 0);
 }
Esempio n. 4
0
 private function _dashboard()
 {
     if (isset($this->args[1]) and is_string($this->args[1])) {
         $dashboard = new Model_Dashboard();
         if ($this->args[1] == "today") {
             $this->args[1] = date("Ymd");
         }
         $session =& $_SESSION["dashboard"];
         $session["date"] = $this->args[1];
         $listevents = $dashboard->getEvents();
         $list = null;
         if (count($listevents) == 0) {
             $list = "Событий нет";
         }
         foreach ($listevents as $event) {
             $list .= $this->render("event", array("event" => $event));
         }
         $this->result = $list;
     } else {
         $this->result = "Usage: dashboard date [date format: 'Y-m-d' or 'Ymd']";
     }
     return true;
 }