[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: index.php,v 1.19 2005/09/15 22:45:38 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/comm/mailing/index.php,v $ 21 */ 22 23 /** 24 \file htdocs/comm/mailing/index.php 25 \ingroup mailing 26 \brief Page accueil de la zone mailing 27 \version $Revision: 1.19 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $langs->load("commercial"); 33 $langs->load("orders"); 34 35 $user->getrights("mailing"); 36 37 if (! $user->rights->mailing->lire || $user->societe_id > 0) 38 accessforbidden(); 39 40 41 42 llxHeader('','Mailing'); 43 44 /* 45 * 46 */ 47 48 print_fiche_titre($langs->trans("MailingArea")); 49 50 print '<table class="notopnoleftnoright" width="100%">'; 51 52 print '<tr><td valign="top" width="30%" class="notopnoleft">'; 53 54 55 // Recherche emails 56 $var=false; 57 print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'; 58 print '<table class="noborder" width="100%">'; 59 print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAMailing").'</td></tr>'; 60 print '<tr '.$bc[$var].'><td nowrap>'; 61 print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size="18"></td>'; 62 print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; 63 print '<tr '.$bc[$var].'><td nowrap>'; 64 print $langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>'; 65 66 print "</table></form><br>\n"; 67 68 69 // Affiche stats de tous les modules de destinataires mailings 70 print '<table class="noborder" width="100%">'; 71 print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("TargetsStatistics").'</td></tr>'; 72 73 $dir=DOL_DOCUMENT_ROOT."/includes/modules/mailings"; 74 $handle=opendir($dir); 75 76 $var=True; 77 while (($file = readdir($handle))!==false) 78 { 79 if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') 80 { 81 if (eregi("(.*)\.(.*)\.(.*)",$file,$reg)) 82 { 83 $modulename=$reg[1]; 84 85 // Chargement de la classe 86 $file = $dir."/".$modulename.".modules.php"; 87 $classname = "mailing_".$modulename; 88 require_once($file); 89 $mailmodule = new $classname($db); 90 91 $qualified=1; 92 foreach ($mailmodule->require_module as $key) 93 { 94 if (! $conf->$key->enabled || (! $user->admin && $mailmodule->require_admin)) 95 { 96 $qualified=0; 97 //print "Les prérequis d'activation du module mailing ne sont pas respectés. Il ne sera pas actif"; 98 break; 99 } 100 } 101 102 // Si le module mailing est qualifié 103 if ($qualified) 104 { 105 $var = !$var; 106 107 foreach ($mailmodule->statssql as $sql) 108 { 109 print '<tr '.$bc[$var].'>'; 110 111 $result=$db->query($sql); 112 if ($result) 113 { 114 $num = $db->num_rows($result); 115 116 $i = 0; 117 118 while ($i < $num ) 119 { 120 $obj = $db->fetch_object($result); 121 print '<td>'.img_object('',$mailmodule->picto).' '.$obj->label.'</td><td align="right">'.$obj->nb.'<td>'; 122 $i++; 123 } 124 125 $db->free($result); 126 } 127 else 128 { 129 dolibarr_print_error($db); 130 } 131 print '</tr>'; 132 } 133 } 134 } 135 } 136 } 137 closedir($handle); 138 139 140 141 print "</table><br>"; 142 143 print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; 144 145 146 /* 147 * Liste des derniers mailings 148 */ 149 150 $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut"; 151 $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; 152 $sql .= " LIMIT 10"; 153 $result=$db->query($sql); 154 if ($result) 155 { 156 print '<table class="noborder" width="100%">'; 157 print '<tr class="liste_titre">'; 158 print '<td colspan="2">'.$langs->trans("LastMailings",10).'</td>'; 159 print '<td align="center">'.$langs->trans("NbOfEMails").'</td>'; 160 print '<td align="center">'.$langs->trans("Status").'</td></tr>'; 161 162 $num = $db->num_rows($result); 163 if ($num > 0) 164 { 165 $var = true; 166 $i = 0; 167 168 while ($i < $num ) 169 { 170 $obj = $db->fetch_object($result); 171 $var=!$var; 172 173 print "<tr $bc[$var]>"; 174 print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>'; 175 print '<td>'.$obj->titre.'</td>'; 176 print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>'; 177 $mail=new Mailing($db); 178 print '<td align="center">'.$mail->statuts[$obj->statut].'</td>'; 179 print '</tr>'; 180 $i++; 181 } 182 183 } 184 else 185 { 186 print '<tr><td>'.$langs->trans("None").'</td></tr>'; 187 } 188 print "</table><br>"; 189 $db->free($result); 190 } 191 else 192 { 193 dolibarr_print_error($db); 194 } 195 196 197 198 print '</td></tr>'; 199 print '</table>'; 200 201 $db->close(); 202 203 204 if ($langs->file_exists("html/spam.html",0)) { 205 print "<br><br><br><br>".$langs->trans("Note")."<br>"; 206 print '<div style="padding: 4px; background: #FAFAFA; border: 1px solid #BBBBBB;" >'; 207 $langs->print_file("html/spam.html",0); 208 print '</div>'; 209 210 print '<br>'; 211 } 212 213 214 llxFooter('$Date: 2005/09/15 22:45:38 $ - $Revision: 1.19 $'); 215 216 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |