[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-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.22.2.1 2005/12/20 23:10:31 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/expedition/index.php,v $ 21 */ 22 23 /** 24 \file htdocs/expedition/index.php 25 \ingroup expedition 26 \brief Page accueil du module expedition 27 \version $Revision: 1.22.2.1 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $langs->load("sendings"); 33 34 llxHeader('',$langs->trans("Sendings"),'ch-expedition.html',$form_search); 35 36 print_fiche_titre($langs->trans("SendingsArea")); 37 38 print '<table class="notopnoleftnoright" width="100%">'; 39 print '<tr><td valign="top" width="30%" class="notopnoleft">'; 40 41 $var=false; 42 print '<table class="noborder" width="100%">'; 43 print '<form method="post" action="liste.php">'; 44 print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchASending").'</td></tr>'; 45 print '<tr '.$bc[$var].'><td>'; 46 print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; 47 print "</form></table><br />\n"; 48 49 /* 50 * Expeditions à valider 51 */ 52 $sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id"; 53 $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; 54 $sql.= " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp AND e.fk_statut = 0"; 55 if ($socidp) 56 { 57 $sql .= " AND c.fk_soc = $socidp"; 58 } 59 $resql=$db->query($sql); 60 if ($resql) 61 { 62 $num = $db->num_rows($resql); 63 if ($num) 64 { 65 print '<table class="noborder" width="100%">'; 66 print '<tr class="liste_titre">'; 67 print '<td colspan="3">'.$langs->trans("SendingsToValidate").'</td></tr>'; 68 $i = 0; 69 $var = True; 70 while ($i < $num) 71 { 72 $var=!$var; 73 $obj = $db->fetch_object($resql); 74 print "<tr $bc[$var]><td width=\"20%\"><a href=\"fiche.php?id=$obj->rowid\">$obj->ref</a></td>"; 75 print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>'; 76 print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$obj->commande_id.'">'.$obj->commande_ref.'</a></td></tr>'; 77 $i++; 78 } 79 print "</table><br>"; 80 } 81 } 82 83 84 /* 85 * Commandes à traiter 86 */ 87 $sql = "SELECT c.rowid, c.ref, s.nom, s.idp"; 88 $sql.= " FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; 89 $sql.= " WHERE c.fk_soc = s.idp AND c.fk_statut = 1"; 90 $sql.= " ORDER BY c.rowid ASC"; 91 92 $resql=$db->query($sql); 93 if ($resql) 94 { 95 $num = $db->num_rows($resql); 96 if ($num) 97 { 98 $langs->load("orders"); 99 100 $i = 0; 101 print '<table class="noborder" width="100%">'; 102 print '<tr class="liste_titre">'; 103 print '<td colspan="2">'.$langs->trans("OrdersToProcess").'</td></tr>'; 104 $var = True; 105 while ($i < $num) 106 { 107 $var=!$var; 108 $obj = $db->fetch_object($resql); 109 print "<tr $bc[$var]><td width=\"33%\">"; 110 print "<a href=\"commande.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'; 111 print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.dolibarr_trunc($obj->nom,20).'</a></td></tr>'; 112 $i++; 113 } 114 print "</table><br>"; 115 } 116 } 117 118 119 /* 120 * 121 */ 122 print '</td><td valign="top" width="70%">'; 123 124 125 /* 126 * Commandes en traitement 127 */ 128 $sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; 129 $sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 2"; 130 $resql = $db->query($sql); 131 if ( $resql ) 132 { 133 $langs->load("orders"); 134 135 $num = $db->num_rows($resql); 136 if ($num) 137 { 138 $i = 0; 139 print '<table class="noborder" width="100%">'; 140 print '<tr class="liste_titre">'; 141 print '<td colspan="2">'.$langs->trans("OrdersInProcess").'</td></tr>'; 142 $var = True; 143 while ($i < $num) 144 { 145 $var=!$var; 146 $obj = $db->fetch_object($resql); 147 print "<tr $bc[$var]><td width=\"30%\"><a href=\"commande.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order").' '; 148 print $obj->ref.'</a></td>'; 149 print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>'; 150 $i++; 151 } 152 print "</table><br>"; 153 } 154 } 155 156 157 /* 158 * Expeditions à valider 159 */ 160 $sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id"; 161 $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; 162 $sql.= " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp AND e.fk_statut = 1"; 163 $sql .= " ORDER BY e.date_expedition DESC"; 164 $sql .= $db->plimit(5, 0); 165 166 $resql = $db->query($sql); 167 if ($resql) 168 { 169 $num = $db->num_rows($resql); 170 if ($num) 171 { 172 $i = 0; 173 print '<table class="noborder" width="100%">'; 174 print '<tr class="liste_titre">'; 175 print '<td colspan="3">'.$langs->trans("LastSendings",$max).'</td></tr>'; 176 $var = True; 177 while ($i < $num) 178 { 179 $var=!$var; 180 $obj = $db->fetch_object($resql); 181 print "<tr $bc[$var]><td width=\"20%\"><a href=\"fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowSending"),"sending").' '; 182 print $obj->ref.'</a></td>'; 183 print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; 184 print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$obj->commande_id.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->commande_ref.'</a></td></tr>'; 185 $i++; 186 } 187 print "</table><br>"; 188 } 189 $db->free($resql); 190 } 191 192 print '</td></tr></table>'; 193 194 $db->close(); 195 196 llxFooter('$Date: 2005/12/20 23:10:31 $ - $Revision: 1.22.2.1 $'); 197 198 ?>
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 |
![]() |