Exemple #1
0
 public function listPromo()
 {
     $msg = '';
     $table = "";
     $promotion = new Promotion();
     if ($promotion->access_ModelMember_sessionExists() || $promotion->access_ModelMember_userAdmin()) {
         $list = $promotion->listPromo();
         $table .= '<table id="promo" class="table table-hover">';
         $table .= '<tr>';
         $table .= '<th>Id Promo</th>';
         $table .= '<th class="icon">Code promo</th>';
         $table .= '<th class="icon">Reduction</th>';
         $table .= '<th class="icon">Supprimer</th>';
         $table .= '</tr>';
         foreach ($list as $valeur) {
             $table .= '<tr>';
             $table .= '<td>' . $valeur['id_promo'] . '</td>';
             $table .= '<td class="icon">' . $valeur['code_promo'] . '</td>';
             $table .= '<td class="icon">' . $valeur['reduction'] . '</td>';
             $table .= '<td class="icon"><a href="index.php?controller=promotions&action=deletePromo&id=' . $valeur['id_promo'] . '" title="Supprimer"><i class="fa fa-trash-o fa-2x"></i></a></td>';
             $table .= '</tr>';
         }
         $table .= '</table>';
     } else {
         $msg .= 'Vous n\'avez pas le droit d\'accéder à cette page';
     }
     include "views/promos/listPromo.php";
 }
Exemple #2
0
 public function access_ModelPromo_listPromo()
 {
     include_once 'models/promotion.php';
     $promo = new Promotion();
     $resultat = $promo->listPromo();
     return $resultat;
 }