private function header() { if (!RequestUtils::isAjax()) { $this->loadView("main/vHeader", array("infoUser" => Auth::getInfoUser())); echo "<div class='container'>"; echo "<h1>" . $this->title . "</h1>"; } }
public function finalize() { if (!RequestUtils::isAjax()) { echo "</div>"; $this->loadView("main/vFooter"); $all=ob_get_contents(); ob_end_clean(); echo $all; } }
public function updateTitre() { if (RequestUtils::isPost()) { $faq = DAO::getOne("Faq", $_POST["id"]); $faq->setTitre($_POST["titre"]); if (DAO::update($faq)) { $this->messageInfo($faq . " modifié", "5000"); Jquery::get("sample/liste", "#liste"); Jquery::doJquery(".alert", "hide", "3000"); echo Jquery::compile(); } } }
public function update(){ if(RequestUtils::isPost()){ parent::updateNotForward(); $ticket = DAO::getOne("Ticket",$_POST['idTicket']); $messages = DAO::getAll("Message", 'idTicket = '.$_POST['idTicket']); $users = array(); foreach ($messages as $message) { $user = $message->getUser()->getId(); if (!in_array($user, $users) && $user != Auth::getUser()->getId() ) { array_push($users, $message->getUser()->getId()); } $message->setUser(DAO::getAll("User", "id=".$message->getUser()->getId())[0]); } $message = DAO::getOne("Message", "idUser="******" ORDER BY date DESC"); foreach ($users as $user) { if (DAO::getOne("Notification", 'idUser = '******' AND idTicket = '.$ticket->getId()) == null) { $user = DAO::getOne("User", $user); $notif = new Notification(); $notif->setUser($user); $notif->setTicket($ticket); $notif->setMessage($message); DAO::insert($notif); } } $this->loadView("ticket/vMessage",array("messages"=>$messages, "ticket" => $ticket)); Jquery::execute("CKEDITOR.replace('contenu');"); Jquery::executeOn('.submitMessage', "click", " for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); "); Jquery::postFormOn("click",".submitMessage","messages/update","frm",".contentMessages"); echo Jquery::compile(); } }
public function finalize() { if (!RequestUtils::isAjax()) { echo "</div>"; $this->loadView("main/vFooter"); } }
public function update() { if (RequestUtils::isPost()) { $className = $this->model; $object = new $className(); $this->setValuesToObject($object); if ($_POST["id"]) { try { DAO::update($object); $msg = new DisplayedMessage($this->model . " `{$object->toString()}` mis à jour"); /* ICI JE CREE UN MESSAGE */ } catch (Exception $e) { $msg = new DisplayedMessage("Impossible de modifier l'instance de " . $this->model, "danger"); } } else { try { DAO::insert($object); $msg = new DisplayedMessage("Instance de " . $this->model . " `{$object->toString()}` ajoutée"); } catch (Exception $e) { $msg = new DisplayedMessage("Impossible d'ajouter l'instance de " . $this->model, "danger"); } } $this->forward(get_class($this), "index", $msg); } }
public function post() { if (RequestUtils::isPost()) { echo "<div id='result'>" . $_POST['text'] . "</div>"; } }