| [ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: index.php,v 1.3 2005/03/23 09:21:53 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/commande/retour/index.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->lire) accessforbidden(); 25 26 $upload_dir = DOL_DATA_ROOT."/telephonie/ligne/commande/retour"; 27 28 if (! is_dir($upload_dir)) 29 { 30 umask(0); 31 if (! mkdir($upload_dir, 0755)) 32 { 33 print "Impossible de créer $upload_dir"; 34 } 35 } 36 37 if ( $_POST["sendit"] && defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1) 38 { 39 if (is_dir($upload_dir)) 40 { 41 42 $nextname = $upload_dir .'/backup'; 43 44 45 if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'])) 46 { 47 $mesg = "Le fichier est valide, et a été téléchargé avec succès.\n"; 48 } 49 else 50 { 51 $mesg = "Le fichier n'a pas été téléchargé"; 52 } 53 54 } 55 } 56 57 llxHeader('','Telephonie - Ligne - Commande - Retour'); 58 59 /* 60 * 61 * 62 * 63 */ 64 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 65 66 print '<tr><td width="30%" valign="top">'; 67 68 $sql = "SELECT distinct statut, count(*) as cc"; 69 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 70 $sql .= " GROUP BY statut"; 71 72 if ($db->query($sql)) 73 { 74 $num = $db->num_rows(); 75 $i = 0; 76 $ligne = new LigneTel($db); 77 print_titre("Retour Commandes"); 78 79 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 80 print '<tr class="liste_titre"><td>Lignes Statuts</td><td valign="center">Nb</td>'; 81 print "</tr>\n"; 82 $var=True; 83 84 while ($i < min($num,$conf->liste_limit)) 85 { 86 $obj = $db->fetch_object(); 87 $var=!$var; 88 89 print "<tr $bc[$var]>"; 90 print "<td>".$ligne->statuts[$obj->statut]."</td>\n"; 91 print "<td>".$obj->cc."</td>\n"; 92 print "</tr>\n"; 93 $i++; 94 } 95 print "</table>"; 96 $db->free(); 97 } 98 else 99 { 100 print $db->error() . ' ' . $sql; 101 } 102 103 print '<br>'; 104 105 print '<form name="userfile" action="index.php" enctype="multipart/form-data" METHOD="POST">'; 106 print '<input type="hidden" name="max_file_size" value="2000000">'; 107 108 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 109 print '<tr class="liste_titre"><td>Charger un fichier de retour</td></tr>'; 110 111 print "<tr $bc[1]><td>"; 112 print '<input type="file" name="userfile" size="20" maxlength="80"><br />'; 113 print '<input type="submit" value="'.$langs->trans("Upload").'" name="sendit"> '; 114 print '<input type="submit" value="'.$langs->trans("Cancel").'" name="cancelit"><br>'; 115 116 print "</tr>\n"; 117 print '</table></form>'; 118 print '</td><td valign="top">'; 119 120 /* 121 * Seconde colonne 122 * 123 */ 124 125 $sql = "SELECT "; 126 $sql .= " cli,mode,situation,date_mise_service,date_resiliation,motif_resiliation,commentaire,fichier, traite "; 127 128 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_commande_retour"; 129 $sql .= " WHERE traite = 0 AND mode = 'PRESELECTION'"; 130 $sql .= " LIMIT 10"; 131 132 if ($db->query($sql)) 133 { 134 $num = $db->num_rows(); 135 136 if ($num) 137 { 138 139 $i = 0; 140 141 print_titre("Retour"); 142 143 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 144 print '<tr class="liste_titre"><td>Lignes Statuts</td><td align="center">Resultat</td>'; 145 print '<td align="center">Date</td><td>Commentaire</td>'; 146 print "</tr>\n"; 147 $var=True; 148 149 while ($i < $num) 150 { 151 $obj = $db->fetch_object(); 152 $var=!$var; 153 154 $ligne = new LigneTel($db); 155 156 if ( $ligne->fetch($obj->cli) == 1); 157 { 158 print "<tr $bc[$var]><td>"; 159 print '<img src="'.DOL_URL_ROOT.'/telephonie/ligne/graph'.$ligne->statut.'.png"> '; 160 print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->cli.'">'; 161 print $obj->cli."</a></td>\n"; 162 print '<td align="center">'.$obj->situation."</td>\n"; 163 print '<td align="center">'.$obj->date_mise_service."</td>\n"; 164 print '<td>'.$obj->commentaire."</td>\n"; 165 print "</tr>\n"; 166 } 167 $i++; 168 } 169 print "</table><br />"; 170 } 171 $db->free(); 172 } 173 else 174 { 175 print $db->error() . ' ' . $sql; 176 } 177 178 print_titre("Fichiers retour en attente de traitement"); 179 180 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 181 print '<tr class="liste_titre"><td>Fichier</td><td>Taille</td><td>Date</td>'; 182 print "</tr>\n"; 183 $var=True; 184 185 $upload_dir = $upload_dir."/"; 186 187 $handle=opendir($upload_dir); 188 189 while (($file = readdir($handle))!==false) 190 { 191 if (is_readable($upload_dir.$file) && is_file($upload_dir.$file)) 192 { 193 $var=!$var; 194 195 print "<tr $bc[$var]>"; 196 print '<td><a href="'.DOL_URL_ROOT.'/document.php?file='.$upload_dir.$file.'&type=text/plain">'; 197 print $file.'</a></td>'; 198 199 print '<td>'.filesize($upload_dir.$file). ' bytes</td>'; 200 print '<td>'.strftime("%A %d %b %Y %H:%M:%S",filemtime($upload_dir.$file)).'</td>'; 201 202 print '</tr>'; 203 } 204 } 205 206 print "</table>"; 207 208 print '</td></tr>'; 209 print '</table>'; 210 211 $db->close(); 212 213 llxFooter("<em>Dernière modification $Date: 2005/03/23 09:21:53 $ révision $Revision: 1.3 $</em>"); 214 ?>
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 |
|