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 (!function_exists('AuthenthificationProcess')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. if(!isset($_GET['statut']|| $_GET['statut']==-1$statut=-1;
  19. elseif($_GET['statut']!=-1{
  20.   $statut=$_GET['statut'];
  21.   $alphabeta=-1;
  22. }
  23.  
  24. if(!isset($_GET['alphabeta']|| $_GET['alphabeta']==-1$alphabeta=-1;
  25. elseif($_GET['alphabeta']!=-1{
  26.   $alphabeta=$_GET['alphabeta'];
  27.   $statut=-1;
  28. }
  29.  
  30. if(!isset($_GET['debut'])) $debut=0;
  31. else $debut=$_GET['debut'];
  32.  
  33. $mask_statut_1='';
  34. $mask_statut_2='';
  35. $mask_statut_3='';
  36.  
  37. if($statut=='P'$mask_statut_1='selected="selected"';
  38. if($statut=='AA'$mask_statut_2='selected="selected"';
  39. if($statut=='D'$mask_statut_3='selected="selected"';
  40.  
  41.  
  42. // Nombre d'enregistrement total dans la bdd
  43. $result_nb_req=$sql_object->DBSelect($req_count_yp);
  44. $bdd_nb_yp=$result_nb_req[0]['num_rows'];
  45. $bdd_nb_yp_display $bdd_nb_yp." "._t('yp','nb_total')."<br />\n";
  46.  
  47. if($statut!=-|| $alphabeta!=-1{
  48.   $link_back="<div class=\"filter\"><a href=\"".$rub_link."&amp;todo=list\">"._t('yp','all')."</a></div>";
  49.  
  50.   if($statut!=-1{
  51.     $req_count_yp=SQL_getCountypList($statut);
  52.     $result_nb_req=$sql_object->DBSelect($req_count_yp);
  53.     $count_request=$result_nb_req[0]['num_rows'];
  54.     $req_list_yp=SQL_getypList($debutSELECT_LIMIT$statut);
  55.     $result_yp_list=$sql_object->DBSelect($req_list_yp);
  56.   }
  57.  
  58.   if($alphabeta!=-1{
  59.     $req_count_yp=SQL_getCountypList('ALPHA'$alphabeta);
  60.     $result_nb_req=$sql_object->DBSelect($req_count_yp);
  61.     $count_request=$result_nb_req[0]['num_rows'];
  62.     $req_list_yp=SQL_getypList($debutSELECT_LIMIT'ALPHA'$alphabeta);
  63.     $result_yp_list=$sql_object->DBSelect($req_list_yp);
  64.   }
  65.  
  66. else {
  67.   $link_back='';
  68.   $count_request=$bdd_nb_yp;
  69.   $req_list_yp=SQL_getypList($debutSELECT_LIMIT$statut);
  70.   $result_yp_list=$sql_object->DBSelect($req_list_yp);
  71. }
  72.  
  73. if($count_request<=1$count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','record')."<br />\n";
  74. else $count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','records')."<br />\n";
  75.  
  76.  
  77. $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  78. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  79. $link_det=$rub_link."&amp;todo=det&amp;id=";
  80. $link_statut=$rub_link."&amp;todo=list&amp;statut=";
  81. $link_list_alphabetical=$rub_link."&amp;todo=list&amp;alphabeta=";
  82. //&amp;groupe=".$groupe."&amp;alphabeta=".$alphabeta;"
  83. $link_self=$link_statut.$statut."&amp;alphabeta=".$alphabeta;
  84.  
  85.  
  86. // Liste des statuts disponible
  87. $select_statut="<select name=\"statut_filter\" id=\"statut_filter\"  onchange=\"ChangeLocation(this)\">\n";
  88. $select_statut.="<option value=\"-1\">"._t('divers','select_choice2')."</option>\n";
  89. $select_statut.="<option value=\"".$link_statut."D\"".$mask_statut_3.">"._t('yp','preinscription')."</option>\n";
  90. $select_statut.="<option value=\"".$link_statut."P\"".$mask_statut_1.">".display_statut('P')."</option>\n";
  91. $select_statut.="<option value=\"".$link_statut."AA\"".$mask_statut_2.">".display_statut('AA')."</option>\n";
  92. $select_statut.="</select>\n";
  93.  
  94. // Liste alphabetique
  95. $result_alphabetical=$sql_object->DBSelect($req_alphabetical);
  96. $select_alphabetical="<select name=\"alhpabetical_filter\" id=\"alhpabetical_filter\" onchange=\"ChangeLocation(this)\">\n";
  97. $select_alphabetical.="<option value=\"-1\">"._t('yp','alphabetical')."</option>\n";
  98. for($i=0$i<count($result_alphabetical)$i++)  {
  99.   if($alphabeta==$result_alphabetical[$i]['first_letter']$mask=" selected=\"selected\""else $mask='';
  100.   $select_alphabetical.="\t<option value=\"".$link_list_alphabetical.$result_alphabetical[$i]['first_letter']."\"".$mask.">".$result_alphabetical[$i]['first_letter']."</option>\n";
  101. }
  102. $select_alphabetical.="</select>\n";
  103.  
  104. ?>
  105. <div id="chemin">
  106. <ul>
  107.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a>
  108.     </li>
  109.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  110.         class="chemin_rub"><?php echo _t('menu','yellowpages')?></a></li>
  111.     <li><span><?php echo _t('yp','list'?></span></li>
  112. </ul>
  113. </div>
  114. <!--end barre haute -->
  115. <?php
  116. include_once(THEME_ADMIN_PATH."quickicons.php");
  117. ?>
  118. <div class="contentcontainer"><?php    include_once($dir."/menurub.php");    ?>
  119. <div id="content"><?php
  120. echo $link_back;
  121. ?>
  122. <div class="filterselect"><?php
  123. echo $select_statut;
  124. echo $select_alphabetical;
  125. ?></div>
  126. <p><?php
  127. echo $bdd_nb_yp_display;
  128. echo $count_request_display;
  129. ?></p>
  130. <?php
  131. echo linkin_page($link_self$count_request$debut);
  132.  
  133. if($result_yp_list!=0{
  134.   echo "<table cellspacing=\"0\" cellpadding=\"3\">\n";
  135.   echo "<thead>\n";
  136.   echo "<tr>\n";
  137.   echo "<td style=\"width:40%\">"._t('yp','name2')."</td>\n";;
  138.   echo "<td>"._t('divers','date_crea')."</td>\n";
  139.   echo "<td>&nbsp;<span class=\"semnone\">"._t('divers','actions')."</span></td>\n";
  140.   echo "</tr>\n";
  141.   echo "</thead>\n";
  142.   echo "<tbody>\n";
  143.  
  144.  
  145.   for($i=0$i<count($result_yp_list)$i++{
  146.     $yp_title=formatText($result_yp_list[$i]['yellowp_name']'2HTML');
  147.     $yp_title=cutText($yp_title351);
  148.     echo "<tr>\n";
  149.     echo "<td><a href=\"".$link_det.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','det')."\">".$yp_title."</a></td>\n";
  150.     echo "<td>".$result_yp_list[$i]['yellowp_date_crea_display']."</td>\n";
  151.     echo "<td><div class=\"iconetab\"><a href=\"".$link_sup.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','sup')."\" class=\"ico_sup\"></a>";
  152.     echo "<a href=\"".$link_mod.$result_yp_list[$i]['yellowp_id']."\" title=\""._t('yp','mod')."\" class=\"ico_mod\"></a></div></td>\n";
  153.     echo "</tr>\n";
  154.   }
  155.  
  156.   echo "</tbody>";
  157.   echo "</table>";
  158.  
  159. else {
  160.   echo "<div class=\"info\">"._t('yp','noresult')."</div>";
  161. }
  162. echo linkin_page($link_self$count_request$debut);
  163.  
  164. ?></div>
  165. <?php include_once($dir."/help.php")?></div>

Documentation generated on Thu, 03 May 2012 15:05:55 +0200 by phpDocumentor 1.4.1