root/alternc-sympa/trunk/bureau/admin/lst_affsub.php

Revision 1432, 7.2 kB (checked in by benjamin, 6 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /*
3  $Id$
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  GNU General Public License for more details.
23
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Louis Sylvain
27  Purpose of file: show and delete subscribers in the mailing-list
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31
32 include("head.php");
33
34 $r=$sympa->get_ml($id);
35
36 $u=$sympa->get_ml_users($id,$offset);
37
38 $count=$u["affiche"]; // nombre de mail à afficher
39 ?>
40 </head>
41     <body>
42
43     <div align="center"><h3><?php printf(_("Mailing list %s"),$r["list"]); ?></h3></div>
44
45     <hr>
46     <?php
47         // test pour que l'affichage du nombre de mail, ne dépasse le total des inscrits
48         if ($offset+$count>$u["count"])
49             $top=$u["count"];
50         else
51             $top=$offset+$count;
52
53         // test pour afficher un lien pour afficher tous les inscrits s'il sont supérieurs au nombre affiché
54         if ($u["count"]>$count)
55             $lien="<a href='lst_affallsub.php?id=".$id."'>"._("Show all subscribed emails")."</a>";
56         else
57             $lien="";
58
59         // affichage de la position où l'on se trouve dans le tableau
60         printf(_("From %s to %s sur %s"),($offset+1),$top,$u["count"]);
61         echo "&nbsp;&nbsp;".$lien;
62     ?>
63     <br>
64     <!-- Affichage des boutons de navigation dans un tableau (en haut de page)-->
65     <table cellspacing="0" cellpadding="4" border="0" cols="4" width="140">
66     <tr valign="top">
67     <td align="center" width="35">
68         <?php
69         if ($offset>0) { // Bouton Début si il y a besoin
70         ?>
71 <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=0">
72 <input type="submit" class="inb" name="precedent" value="<< ">
73 </form>
74         <?php
75         } else {
76             echo "&nbsp;";
77         }
78         ?>
79     </td>
80     <td width="35" align="center">
81         <?php
82         if ($offset>0) { // Bouton précedent si il y a besoin
83         ?>
84 <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $offset-$count; ?>">
85 <input type="submit" class="inb" name="precedent" value=" < ">
86 </form>
87         <?php
88         } else {
89             echo "&nbsp;";
90         }
91         ?>
92     </td><td width="35" align="center">
93         <?php
94         if ($offset+$count<$u["count"]) { // Bouton suivant si il y a besoin
95         ?>
96             <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $offset+$count; ?>">
97             <input type="submit" class="inb" name="precedent" value=" > ">
98             </form>
99         <?php
100         } else {
101             echo "&nbsp;";
102         }
103         ?>
104     </td>
105     <td align="center" width="30">
106     <?php
107         if ($offset+$count<$u["count"]) { // Bouton Fin si il y a besoin
108             // Calcul de $fin argh, la boucle for !
109             for ($i=0;$i<$u["count"];$i+=$count){
110                 $fin=$i;
111             }
112             ?>
113             <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $fin; ?>">
114             <input type="submit" class="inb" name="precedent" value=" >>">
115             </form>
116             <?php
117         } else {
118             echo "&nbsp;";
119         }
120             ?>
121     </td></tr>
122     </table>
123
124     <!-- Tableau affichant la liste des mails inscrits -->
125     <table cellspacing="0" cellpadding="4" border="0" cols="4">
126     <tr>
127     <form method="post" action="lst_delsub.php?id=<?php echo $id ?>&offset=<?php echo $offset ?>">
128     <th width="35"><?php __("Delete"); ?></th><th><?php __("Email address"); ?></th><th><?php __("Name"); ?></th><th>&nbsp;</th></tr>
129     <?php
130         $col=1;
131         for($i=0;$i<count($u["mail"]);$i++) {
132             $c=$u["mail"][$i];
133             $d=$u["nom"][$i];
134             $col=3-$col;
135             echo "<tr class=\"lst$col\"><td align=\"center\"><input type=\"checkbox\" class=\"inc\" name=\"del_".$i."\"     value=\"".$c."\"></td>";
136             echo "<td>".$c."</td>";
137             echo "<td>".$d."</td>";
138             echo "<td align=\"center\"><a href='lst_editsub.php?id=".$id."&mail=".$c."&name=".$d."&offset=".$offset."'>"._("Edit")."</a></td></tr>";
139         } // fin for
140     ?>
141     <tr valign="top">
142     <td align="left" colspan="4">
143         <input type="submit" class="inb" name="submit" value="<?php __("Delete the checked subscribers"); ?>">
144         </form></td>
145     </tr>
146     </table>
147
148     <!-- Affichage des boutons de navigation dans un tableau (en bas de page)-->
149     <table cellspacing="0" cellpadding="4" border="0" cols="4" width="140">
150     <td valign="top">
151
152         <?php
153         if ($offset>0) { // Bouton Début si il y a besoin
154         ?>
155 <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=0">
156 <input type="submit" class="inb" name="precedent" value="<< ">
157 </form>
158         <?php
159         } else {
160             echo "&nbsp;";
161         }
162         ?>
163     </td>
164     <td width="35" align="center">
165         <?php
166         if ($offset>0) { // Bouton précedent si il y a besoin
167         ?>
168 <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $offset-$count; ?>">
169 <input type="submit" class="inb" name="precedent" value=" < ">
170 </form>
171         <?php
172         } else {
173             echo "&nbsp;";
174         }
175         ?>
176     </td><td width="35" align="center">
177         <?php
178         if ($offset+$count<$u["count"]) { // Bouton suivant si il y a besoin
179         ?>
180             <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $offset+$count; ?>">
181             <input type="submit" class="inb" name="precedent" value=" > ">
182             </form>
183         <?php
184         } else {
185             echo "&nbsp;";
186         }
187         ?>
188     </td>
189     <td align="center" width="30">
190     <?php
191         if ($offset+$count<$u["count"]) { // Bouton Fin si il y a besoin
192             // Calcul de $fin argh, la boucle for ! on teste ca pour voir...
193             $fin=($count*intval($u["count"]/$count))+1;
194             ?>
195             <form method="post" action="lst_affsub.php?id=<?php echo $id ?>&offset=<?php echo $fin; ?>">
196             <input type="submit" class="inb" name="precedent" value=" >>">
197             </form>
198             <?php
199         } else {
200             echo "&nbsp;";
201         }
202             ?>
203     </td></tr>
204     </table>
205     <br>
206     <!-- Liens pour passer d'une table à l'autre en se basant sur le nom -->
207     <?php
208     // Condition pour savoir s'il y a plus d'une page à afficher
209     $u=$sympa->get_ml_all_users($id);
210     if ($u["count"]>$count) {
211         echo "<p>"._("To access directly a page from a mail address:")."<br>";
212         for ($i=0;$i<$u["count"];$i+=$count){
213             if ($i+$count<$u["count"]) {
214                 // $requete="SELECT mail FROM subscribers LIMIT $j,1";
215                 $j=$i+$count-1;
216                 echo _("From ")."<a href='lst_affsub.php?id=".$id."&offset=".$i."'>".$u["mail"][$i]."</a> "._("to")." <a href='lst_affsub.php?id=".$id."&offset=".$i."'>".$u["mail"][$j]."</a><br>";
217             }
218             else { // dernier liens à la fin
219                 // $j=$total-1;
220                 // $requete="SELECT mail FROM subscribers LIMIT $j,1";
221                 $j=$u["count"]-1;
222                 echo _("From ")."<a href='lst_affsub.php?id=".$id."&offset=".$i."'>".$u["mail"][$i]."</a> "._("to")." <a href='lst_affsub.php?id=".$id."&offset=".$i."'>".$u["mail"][$j]."</a><br>";
223             }
224         } // fin for
225     } // fin if
226 ?>
227     <hr>
228     <a href="lst_subscribers.php?id=<?php echo $id; ?>"><?php __("Back to the subscription page"); ?></a>
229 </body>
230 </html>
Note: See TracBrowser for help on using the browser.