コード例 #1
0
 public function commentdel()
 {
     $this->allowTo('admin');
     $id = $_POST['id_comment'];
     $comment = new \Manager\OpinionManager();
     if ($comment->delete($id)) {
         $string = "Le commentaire vient d'être supprimé avec succès.";
     } else {
         $string = "Impossible de supprimé ce commentaire.";
     }
     $this->show("status/sender", ["string" => $string, "nb" => 3, "link" => "setting_comment"]);
 }
コード例 #2
0
 public function opinion()
 {
     $insert = false;
     $opinionManager = new \Manager\OpinionManager();
     if (isset($_POST['submit'])) {
         $opinion = ["id_logs" => $_SESSION['user']['id'], "datestart" => date('Y/m/d', strtotime($_POST['datestart'])), "dateend" => date('Y/m/d', strtotime($_POST['dateend'])), "room" => $_POST['room'], "rate" => $_POST['rate'], "comment" => $_POST['comment']];
         if ($opinionManager->insert($opinion)) {
             $insert = true;
         }
     }
     $viewall = $opinionManager->viewopinion();
     if (empty($viewall)) {
         $viewall = "Il n'y a actuellement aucun commentaire.";
     }
     if ($insert) {
         $string = "Votre commentaire a bien été enregistré";
         $this->show('status/sender', ['string' => $string, 'link' => 'opinion_show', 'nb' => 4]);
     }
     $this->show('opinion/opinion', ['viewall' => $viewall]);
 }