2003-03-14 01:17:54 +01:00
|
|
|
|
<?PHP
|
|
|
|
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
*
|
|
|
|
|
|
* $Id$
|
|
|
|
|
|
* $Source$
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
require("./pre.inc.php");
|
|
|
|
|
|
|
|
|
|
|
|
llxHeader();
|
|
|
|
|
|
|
2003-11-03 09:40:18 +01:00
|
|
|
|
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td valign="top" width="30%">';
|
|
|
|
|
|
/*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($sortfield == "")
|
|
|
|
|
|
{
|
2003-03-14 01:17:54 +01:00
|
|
|
|
$sortfield="o.orders_status ASC, o.date_purchased";
|
|
|
|
|
|
}
|
2003-11-03 09:40:18 +01:00
|
|
|
|
if ($sortorder == "")
|
|
|
|
|
|
{
|
2003-03-14 01:17:54 +01:00
|
|
|
|
$sortorder="DESC";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($page == -1) { $page = 0 ; }
|
|
|
|
|
|
$limit = $conf->liste_limit;
|
|
|
|
|
|
$offset = $limit * $page ;
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".DB_NAME_OSC.".orders as o";
|
|
|
|
|
|
|
|
|
|
|
|
$sql .= " ORDER BY $sortfield $sortorder ";
|
2003-08-28 21:05:51 +02:00
|
|
|
|
$sql .= $db->plimit($limit + 1,$offset);
|
2003-03-14 01:17:54 +01:00
|
|
|
|
|
2003-08-28 21:05:51 +02:00
|
|
|
|
if ( $db->query($sql) )
|
|
|
|
|
|
{
|
2003-03-14 01:17:54 +01:00
|
|
|
|
$num = $db->num_rows();
|
2003-08-28 21:05:51 +02:00
|
|
|
|
|
|
|
|
|
|
print_barre_liste("Liste des Commandes",$page,$PHP_SELF,"",$sortfield,$sortorder,'',$num);
|
|
|
|
|
|
|
2003-03-14 01:17:54 +01:00
|
|
|
|
$i = 0;
|
2003-11-03 09:40:18 +01:00
|
|
|
|
print '<p><table class="liste" width="100%" cellspacing="0" cellpadding="4">';
|
|
|
|
|
|
print '<tr class="liste_titre"><td>';
|
2003-03-14 01:17:54 +01:00
|
|
|
|
print_liste_field_titre("Client",$PHP_SELF, "p.ref");
|
|
|
|
|
|
print "</td>";
|
|
|
|
|
|
print "<td></td>";
|
2003-11-03 09:40:18 +01:00
|
|
|
|
print "</tr>\n";
|
2003-03-14 01:17:54 +01:00
|
|
|
|
$var=True;
|
2003-08-28 21:05:51 +02:00
|
|
|
|
while ($i < min($num,$limit))
|
|
|
|
|
|
{
|
|
|
|
|
|
$objp = $db->fetch_object( $i);
|
2003-11-03 09:40:18 +01:00
|
|
|
|
$var=!$var;
|
|
|
|
|
|
print "<tr $bc[$var]>";
|
|
|
|
|
|
print "<td><a href=\"fiche.php?id=$objp->orders_id\">$objp->customers_name</a></TD>\n";
|
|
|
|
|
|
print "<td>$objp->orders_status</TD>\n";
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
}
|
2003-03-14 01:17:54 +01:00
|
|
|
|
print "</TABLE>";
|
|
|
|
|
|
$db->free();
|
|
|
|
|
|
}
|
2003-11-03 09:40:18 +01:00
|
|
|
|
/*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
print '</td><td valign="top" width="70%">';
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Propales <EFBFBD> facturer
|
|
|
|
|
|
*/
|
|
|
|
|
|
if ($user->comm > 0 && $conf->commercial )
|
|
|
|
|
|
{
|
|
|
|
|
|
$sql = "SELECT p.rowid, p.ref, s.nom, s.idp FROM llx_propal as p, llx_societe as s";
|
|
|
|
|
|
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = 2";
|
|
|
|
|
|
if ($socidp)
|
|
|
|
|
|
{
|
|
|
|
|
|
$sql .= " AND p.fk_soc = $socidp";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( $db->query($sql) )
|
|
|
|
|
|
{
|
|
|
|
|
|
$num = $db->num_rows();
|
|
|
|
|
|
if ($num)
|
|
|
|
|
|
{
|
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
|
|
|
|
|
print "<tr class=\"liste_titre\">";
|
|
|
|
|
|
print '<td colspan="2">'.translate("Propositions commerciales sign<67>es").'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
|
{
|
|
|
|
|
|
$var=!$var;
|
|
|
|
|
|
$obj = $db->fetch_object($i);
|
|
|
|
|
|
print "<tr $bc[$var]><td width=\"20%\"><a href=\"propal.php?propalid=$obj->rowid\">$obj->ref</a></td>";
|
|
|
|
|
|
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
print "</table><br>";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-14 01:17:54 +01:00
|
|
|
|
|
2003-11-03 09:40:18 +01:00
|
|
|
|
print '</td></tr></table>';
|
2003-03-14 01:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
|
|
|
|
|
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
|
|
|
|
|
?>
|