public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $objects = DAO::getAll("Ticket", "idStatut = '1'\t"); echo "<table class='table table-striped'>"; echo "<thead><tr><th>" . $this->model . "</th></tr></thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td>" . $object->toString() . "</td>"; echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='" . $baseHref . "/frm/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<a class='btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; //echo DAO::$db->query("SELECT COUNT(idStatut) FROM ticket where idStatut<1")->fetchColumn(); }
/** * Affiche la liste des instances de la class du modèle associé $model * @see BaseController::index() */ public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $objects = DAO::getAll($this->model); echo "<table class='table table-striped'>"; echo "<thead><tr> " . $this->model . "</thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td><a href= '" . $baseHref . "/view/" . $object->getId() . "'>{$object}</a> </td>"; if (Auth::isAdmin() == 1) { echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='" . $baseHref . "/frmUpdate/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; } echo "</tr>"; } echo "</tbody>"; echo "</table>"; if (Auth::isAdmin() == 1) { echo "<a class='btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; } }
public function index($message=null){ global $config; $baseHref=get_class($this); if(isset($message)){ if(is_string($message)){ $message=new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $_SESSION['page'] = 1; $_SESSION['nbPerPage'] = 3; if (Auth::isAdmin()) { $_SESSION['condition'] = 'idStatut = 1'; $this->loadView("ticket/vAdmin", array('newTickets' => DAO::count("Ticket", $_SESSION['condition']))); $this->listTickets(); }else{ $_SESSION['condition'] = 'idUser = '******'.link', 'click', ' $(".link").parent().removeClass("active"); $(this).parent().addClass("active")'); }
/** * Affiche la liste des instances de la class du modèle associé $model * @see BaseController::index() */ public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $objects = DAO::getAll($this->model); if ($this->title == "Messages") { echo "<table class='table table-condensed'>"; echo "<thead><tr><th>Mes tickets</th><th>Nombres</th></tr></thead>" . "<tbody><tr class='info'><td>Nouveau</td><td>" . $this->NombreTicketNouveau() . "</td></tr>\n\t\t\t\t<tr class='warning'><td>En attente</td><td>" . $this->NombreTicketAttente() . "</td></tr>\n\t\t\t\t<tr class='active'><td>Attribué</td><td>" . $this->NombreTicketAttribuer() . "</td></tr>\n\t\t\t\t<tr class='success'><td>Résolu</td><td>" . $this->NombreTicketResolu() . "</td></tr></tbody></table>"; } echo "<table class='table table-striped'>"; echo "<thead><tr> " . $this->model . "</thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td><a href= '" . $baseHref . "/view/" . $object->getId() . "'>{$object}</a> </td>"; echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='" . $baseHref . "/frmUpdate/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<a class='btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; }
/** * Affiche la liste des instances de la class du modèle associé $model * @see BaseController::index() */ public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $objects = DAO::getAll($this->model); echo "<table class='table table-striped'>"; echo "<thead><tr> " . $this->model . "</thead>"; echo "<div id='searchbar'>\n\t\t\n <form method='get' action='127.0.0.1/helpdesk/views/faqs/search.php'>\n <input class='champ' type='text' value=''/>\n <input class='bouton' type='button' value='search ' />\n \n </form>\n </div><br>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td><a href= '" . $baseHref . "/view/" . $object->getId() . "'>{$object}</a> </td>"; if (Auth::isAdmin() == 1) { echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='" . $baseHref . "/frmUpdate/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; } echo "</tr>"; } echo "</tbody>"; echo "</table>"; if (Auth::isAdmin() == 1) { echo "<a class='btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; } }
public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $objects = DAO::getAll($this->model); echo "<table class='table table-striped'>"; echo "<thead><tr><th>" . $this->model . "</th></tr></thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td class='titre-faq' style='width:80%'><a href='" . $baseHref . "/frm2/" . $object->getId() . "' style='color:#253939'>" . $object->toString() . "</a></td>"; echo "<td class='td-center'><a class='btn btn-success btn-xs' href='" . $baseHref . "/frm2/" . $object->getId() . "'><span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span></a></td>"; echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='" . $baseHref . "/frm/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<a class='btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; }
public function index($message=null){ global $config; $baseHref=get_class($this); if(isset($message)){ if(is_string($message)){ $message=new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } $categories=DAO::getAll("Categorie"); $auteurs=DAO::getAll("User"); if (Auth::isAdmin()) { $faqs = DAO::getAll($this->model, "idUser="******"Sélectionner l'auteur..."); }else{ $faqs=DAO::getAll($this->model, "published = 1"); $listUser=Gui::select($auteurs,null,"Sélectionner l'auteur..."); } $listCategorie=Gui::select($categories,null,"Sélectionner une catégorie ..."); $this->loadView("faq/vFilter",array("listCategorie"=>$listCategorie,"listUser"=>$listUser)); echo "<div class='list'>"; $this->loadView("faq/vList", array("faqs"=>$faqs)); echo "</div>"; echo JQuery::execute("$('[data-toggle=\"tooltip\"]').tooltip()"); echo Jquery::postFormOn('change', '.search', "Faqs/filter", "searchForm", ".list"); echo Jquery::postFormOn('keyup', '.search', "Faqs/filter", "searchForm", ".list"); echo Jquery::getOn('click', '.suspend', 'Faqs/suspend', '.list'); }
/** * Affiche un message Alert bootstrap * @param DisplayedMessage $message */ public function _showDisplayedMessage($message) { return $message->compile($this->jquery); }
/** * Affiche un message Alert bootstrap * @param DisplayedMessage $message */ public function _showDisplayedMessage($message) { $this->_showMessage($message->getContent(), $message->getType(), $message->getTimerInterval(), $message->getDismissable()); }
public function index($message = null) { global $config; $baseHref = get_class($this); if (isset($message)) { if (is_string($message)) { $message = new DisplayedMessage($message); } $message->setTimerInterval($this->messageTimerInterval); $this->_showDisplayedMessage($message); } if (Auth::isAdmin()) { $objects = DAO::getAll("ticket", "idAdmin=" . Auth::getUser()->getId()); echo "<table class='table table-striped'>"; echo "<thead><tr><th>Mes Tickets</th></tr></thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td class='titre-faq' style='width:80%'><a class=" . $baseHref . "-" . $object->getId() . " href='" . $baseHref . "/frm2/" . $object->getId() . "' style='color:#253939'>" . $object->toString() . "</a></td>"; echo "<td class='td-center'><a class='btn btn-success btn-xs' href='" . $baseHref . "/frm2/" . $object->getId() . "'><span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span></a></td>"; if (Auth::isAdmin()) { echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='tickets/updateStatut/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; } echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<br><br><br>"; $objects = DAO::getAll("Ticket", "idAdmin=0"); echo "<table class='table table-striped'>"; echo "<thead><tr><th>Nouveaux Tickets</th></tr></thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td class='titre-faq' style='width:80%'><a class=" . $baseHref . "-" . $object->getId() . " href='" . $baseHref . "/frm2/" . $object->getId() . "' style='color:#253939'>" . $object->toString() . "</a></td>"; echo "<td class='td-center'><a class='btn btn-success btn-xs' href='" . $baseHref . "/frm2/" . $object->getId() . "'><span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span></a></td>"; if (Auth::isAdmin()) { echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='tickets/updateStatut/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; } echo "</tr>"; } if (count($objects) == 0) { echo "<tr><td>Aucun nouveau ticket</td></tr>"; } echo "</tbody>"; echo "</table>"; } else { $objects = DAO::getAll("ticket", "idUser="******"<table class='table table-striped'>"; echo "<thead><tr><th>Mes Tickets</th></tr></thead>"; echo "<tbody>"; foreach ($objects as $object) { echo "<tr>"; echo "<td class='titre-faq' style='width:80%'><a class=" . $baseHref . "-" . $object->getId() . " href='" . $baseHref . "/frm2/" . $object->getId() . "' style='color:#253939'>" . $object->toString() . "</a></td>"; echo "<td class='td-center'><a class='btn btn-success btn-xs' href='" . $baseHref . "/frm2/" . $object->getId() . "'><span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span></a></td>"; if (Auth::isAdmin()) { echo "<td class='td-center'><a class='btn btn-primary btn-xs' href='tickets/updateStatut/" . $object->getId() . "'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></a></td>" . "<td class='td-center'><a class='btn btn-warning btn-xs' href='" . $baseHref . "/delete/" . $object->getId() . "'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a></td>"; } echo "</tr>"; } if (count($objects) == 0) { echo "<tr><td>Aucun ticket</td></tr>"; } echo "</tbody>"; echo "</table>"; } echo "<a class='ajouter btn btn-primary' href='" . $config["siteUrl"] . $baseHref . "/frm'>Ajouter...</a>"; }
/** * Affiche un message dans une alert Bootstrap * @param String $message * @param String $type Class css du message (info, warning...) * @param number $timerInterval Temps d'affichage en ms * @param string $dismissable Alert refermable * @param string $visible */ public function showMessage($message, $type, $timerInterval = 5000, $dismissable = true, $visible = true) { $message = new DisplayedMessage($message, $type, $timerInterval, $dismissable, $visible); return $message->compile($this->jquery); }