[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2002-2003 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.24 2005/11/14 21:23:15 tipaul Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fichinter/index.php,v $ 21 */ 22 23 /** 24 \file htdocs/fichinter/index.php 25 \brief Page accueil espace fiches interventions 26 \ingroup ficheinter 27 \version $Revision: 1.24 $ 28 */ 29 30 require ("./pre.inc.php"); 31 require_once (DOL_DOCUMENT_ROOT."/contact.class.php"); 32 require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); 33 34 $langs->load("interventions"); 35 36 if ($user->societe_id > 0) 37 { 38 $socid = $user->societe_id ; 39 } 40 41 llxHeader(); 42 43 $sortorder=$_GET["sortorder"]?$_GET["sortorder"]:$_POST["sortorder"]; 44 $sortfield=$_GET["sortfield"]?$_GET["sortfield"]:$_POST["sortfield"]; 45 $socid=$_GET["socidp"]?$_GET["socidp"]:$_POST["socidp"]; 46 47 if (! $sortorder) $sortorder="DESC"; 48 if (! $sortfield) $sortfield="f.datei"; 49 if ($page == -1) { $page = 0 ; } 50 51 $limit = $conf->liste_limit; 52 $offset = $limit * $page ; 53 $pageprev = $page - 1; 54 $pagenext = $page + 1; 55 56 57 58 $sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.note, f.duree"; 59 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f "; 60 $sql .= " WHERE f.fk_soc = s.idp "; 61 62 63 if ($socid > 0) 64 { 65 $sql .= " AND s.idp = " . $socid; 66 } 67 68 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1 ,$offset); 69 70 $result=$db->query($sql); 71 if ($result) 72 { 73 $fichinter_static=new Fichinter($db); 74 75 $num = $db->num_rows($result); 76 print_barre_liste($langs->trans("ListOfInterventions"), $page, "index.php","&socid=$socid",$sortfield,$sortorder,'',$num); 77 78 $i = 0; 79 print '<table class="noborder" width="100%">'; 80 print "<tr class=\"liste_titre\">"; 81 print_liste_field_titre($langs->trans("Ref"),"index.php","f.ref","","&socid=$socid",'width="15%"',$sortfield); 82 print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","&socid=$socid",'',$sortfield); 83 print '<td>'.$langs->trans("Description").'</td>'; 84 print_liste_field_titre($langs->trans("Date"),"index.php","f.datei","","&socid=$socid",'align="center"',$sortfield); 85 print '<td align="right">'.$langs->trans("Duration").'</td>'; 86 print '<td align="center">'.$langs->trans("Status").'</td>'; 87 print "</tr>\n"; 88 $var=True; 89 $total = 0; 90 while ($i < $num) 91 { 92 $objp = $db->fetch_object($result); 93 $var=!$var; 94 print "<tr $bc[$var]>"; 95 print "<td><a href=\"fiche.php?id=$objp->fichid\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."</a></td>\n"; 96 print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44)."</a></td>\n"; 97 print '<td>'.nl2br($objp->note).'</td>'; 98 print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n"; 99 print '<td align="right">'.price($objp->duree).'</td>'; 100 print '<td align="center">'.$fichinter_static->LibStatut($objp->fk_statut).'</td>'; 101 102 print "</tr>\n"; 103 $total += $objp->duree; 104 $i++; 105 } 106 print '<tr class="liste_total"><td colspan="3"></td><td>'.$langs->trans("Total").'</td>'; 107 print '<td align="right" nowrap>'.price($total).'</td><td></td>'; 108 print '</tr>'; 109 110 print '</table>'; 111 $db->free($result); 112 } 113 else 114 { 115 dolibarr_print_error($db); 116 } 117 118 $db->close(); 119 120 llxFooter('$Date: 2005/11/14 21:23:15 $ - $Revision: 1.24 $'); 121 ?>
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 |
![]() |