linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file list.php

Documentation is available at list.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage yellowpages
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
  20. ////////////
  21.  
  22. if(!isset($_GET['statut']|| $_GET['statut']==-1$statut=-1;
  23. elseif($_GET['statut']!=-1{
  24.   $statut=$_GET['statut'];
  25.   $alphabeta=-1;
  26. }
  27.  
  28. if(!isset($_GET['alphabeta']|| $_GET['alphabeta']==-1$alphabeta=-1;
  29. elseif($_GET['alphabeta']!=-1{
  30.   $alphabeta=$_GET['alphabeta'];
  31.   $statut=-1;
  32. }
  33.  
  34. if(!isset($_GET['debut'])) $debut=0;
  35. else $debut=$_GET['debut'];
  36.  
  37. $mask_statut_1='';
  38. $mask_statut_2='';
  39. $mask_statut_3='';
  40.  
  41. if($statut=='P'$mask_statut_1='selected="selected"';
  42. if($statut=='AA'$mask_statut_2='selected="selected"';
  43. if($statut=='D'$mask_statut_3='selected="selected"';
  44.  
  45.  
  46. // Nombre d'enregistrement total dans la bdd
  47. $result_nb_req=$sql_object->DBSelect($req_count_yp);
  48. $bdd_nb_yp=$result_nb_req[0]['num_rows'];
  49. $bdd_nb_yp_display $bdd_nb_yp." "._t('yp','nb_total')."<br />\n";
  50.  
  51. if($statut!=-|| $alphabeta!=-1{
  52.   $link_back="<div class=\"filter\"><a href=\"".$rub_link."&amp;todo=list\">"._t('yp','all')."</a></div>";
  53.  
  54.   if($statut!=-1{
  55.     $req_count_yp=SQL_getCountypList($statut);
  56.     $result_nb_req=$sql_object->DBSelect($req_count_yp);
  57.     $count_request=$result_nb_req[0]['num_rows'];
  58.     $req_list_yp=SQL_getypList($debutSELECT_LIMIT$statut);
  59.     $result_yp_list=$sql_object->DBSelect($req_list_yp);
  60.   }
  61.  
  62.   if($alphabeta!=-1{
  63.     $req_count_yp=SQL_getCountypList('ALPHA'$alphabeta);
  64.     $result_nb_req=$sql_object->DBSelect($req_count_yp);
  65.     $count_request=$result_nb_req[0]['num_rows'];
  66.     $req_list_yp=SQL_getypList($debutSELECT_LIMIT'ALPHA'$alphabeta);
  67.     $result_yp_list=$sql_object->DBSelect($req_list_yp);
  68.   }
  69.  
  70. else {
  71.   $link_back='';
  72.   $count_request=$bdd_nb_yp;
  73.   $req_list_yp=SQL_getypList($debutSELECT_LIMIT$statut);
  74.   $result_yp_list=$sql_object->DBSelect($req_list_yp);
  75. }
  76.  
  77. if($count_request<=1$count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','record')."<br />\n";
  78. else $count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','records')."<br />\n";
  79.  
  80.  
  81. $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  82. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  83. $link_det=$rub_link."&amp;todo=det&amp;id=";
  84. $link_statut=$rub_link."&amp;todo=list&amp;statut=";
  85. $link_list_alphabetical=$rub_link."&amp;todo=list&amp;alphabeta=";
  86. //&amp;groupe=".$groupe."&amp;alphabeta=".$alphabeta;"
  87. $link_self=$link_statut.$statut."&amp;alphabeta=".$alphabeta;
  88.  
  89.  
  90. // Liste des statuts disponible
  91. $select_statut="<select name=\"statut_filter\" id=\"statut_filter\">\n";
  92. $select_statut.="<option value=\"-1\">"._t('divers','select_choice2')."</option>\n";
  93. $select_statut.="<option value=\"".$link_statut."D\"".$mask_statut_3.">"._t('yp','preinscription')."</option>\n";
  94. $select_statut.="<option value=\"".$link_statut."P\"".$mask_statut_1.">".display_statut('P')."</option>\n";
  95. $select_statut.="<option value=\"".$link_statut."AA\"".$mask_statut_2.">".display_statut('AA')."</option>\n";
  96. $select_statut.="</select>\n";
  97.  
  98. $js "    $('#statut_filter').change(function() {
  99.                     window.location = $(this).val();
  100.                 });";
  101.  
  102.  
  103. // Liste alphabetique
  104. $result_alphabetical=$sql_object->DBSelect($req_alphabetical);
  105. $select_alphabetical="<select name=\"alhpabetical_filter\" id=\"alhpabetical_filter\">\n";
  106. $select_alphabetical.="<option value=\"-1\">"._t('yp','alphabetical')."</option>\n";
  107. for($i=0$i<count($result_alphabetical)$i++)  {
  108.   if($alphabeta==$result_alphabetical[$i]['first_letter']$mask=" selected=\"selected\""else $mask='';
  109.   $select_alphabetical.="\t<option value=\"".$link_list_alphabetical.$result_alphabetical[$i]['first_letter']."\"".$mask.">".$result_alphabetical[$i]['first_letter']."</option>\n";
  110. }
  111. $select_alphabetical.="</select>\n";
  112.  
  113. $js "    $('#alhpabetical_filter').change(function() {
  114.                     window.location = $(this).val();
  115.                 });";
  116.  
  117.  
  118. ?>
  119. <div id="chemin">
  120. <ul>
  121.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  122.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','yellowpages')?></a></li>
  123.     <li><span><?php echo _t('yp','list'?></span></li>
  124. </ul>
  125. </div>
  126. <!--end barre haute -->
  127. <?php
  128. include_once(THEME_ADMIN_PATH."quickicons.php");
  129. ?>
  130. <div class="contentcontainer"><?php    include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));    ?>
  131. <div id="content"><?php
  132. echo $link_back;
  133. ?>
  134. <div class="filterselect"><?php
  135. echo $select_statut;
  136. echo $select_alphabetical;
  137. ?></div>
  138. <p><?php
  139. echo $bdd_nb_yp_display;
  140. echo $count_request_display;
  141. ?></p>
  142. <?php
  143. echo linkin_page($link_self$count_request$debut);
  144.  
  145. if($result_yp_list!=0{
  146.   echo "<table cellspacing=\"0\" cellpadding=\"3\" class=\"multisort\">\n";
  147.   echo "<thead>\n";
  148.   echo "<tr>\n";
  149.   echo "<td style=\"width:40%\">".mb_ucfirst(_t('yp','name2'))."</td>\n";;
  150.   echo "<td>".mb_ucfirst(_t('divers','date_crea'))."</td>\n";
  151.   echo "<td class=\"sorter-false\">&nbsp;<span class=\"semnone\">".mb_ucfirst(_t('divers','actions'))."</span></td>\n";
  152.   echo "</tr>\n";
  153.   echo "</thead>\n";
  154.   echo "<tbody>\n";
  155.  
  156.  
  157.   for($i=0$i<count($result_yp_list)$i++{
  158.     $yp_title=formatText($result_yp_list[$i]['yellowp_name']'2HTML');
  159.     $yp_title=cutText($yp_title351);
  160.     echo "<tr>\n";
  161.     echo "<td><a href=\"".$link_det.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','det')."\">".$yp_title."</a></td>\n";
  162.     echo "<td>".$result_yp_list[$i]['yellowp_date_crea_display']."</td>\n";
  163.     echo "<td><div class=\"iconetab\"><a href=\"".$link_sup.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','sup')."\" class=\"ico_sup\"><i class=\"icon-trash\"></i><span>" _t('yp','sup'"</span></a>";
  164.     echo "<a href=\"".$link_mod.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','mod')."\" class=\"ico_mod\"><i class=\"icon-pencil\"></i><span>" _t('yp','mod'"</span></a></div></td>\n";
  165.     echo "</tr>\n";
  166.   }
  167.  
  168.   echo "</tbody>";
  169.   echo "</table>";
  170.  
  171. else {
  172.   echo "<div class=\"info\">"._t('yp','noresult')."</div>";
  173. }
  174. echo linkin_page($link_self$count_request$debut);
  175.  
  176. ?>
  177. </div>
  178. <?php
  179. // Ability to sort table
  180. addDynamicCSS('../lib/js/jquery.tablesorter/theme.default.css');
  181. footerAddJS('../lib/js/jquery.tablesorter/jquery.tablesorter.min.js');
  182. $str '$("table.multisort").tablesorter({    });';
  183.  
  184. include_once(override($dir.'/help.php'THEME_ADMIN_PATH));
  185. ?>
  186. </div>

Documentation generated on Thu, 20 Mar 2014 16:48:37 +0100 by phpDocumentor 1.4.1