petites améliorations(revue du code)
This commit is contained in:
parent
5998598645
commit
b6b7e32526
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
|
* Copyright (C) 2003-2005 Éric Seigne <eric.seigne@ryxeo.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -24,18 +24,9 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
if ($action == 'addga') {
|
|
||||||
$client = new Client($db);
|
|
||||||
|
|
||||||
$client->linkga($id, $ga);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'update' && !$cancel) {
|
if ($action == 'update' && !$cancel) {
|
||||||
$client = new Client($db);
|
$client = new Client($db);
|
||||||
|
|
||||||
$client->nom = $nom;
|
$client->nom = $nom;
|
||||||
|
|
||||||
$client->update($id, $user);
|
$client->update($id, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,72 +34,72 @@ if ($action == 'update' && !$cancel) {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
if ($_GET['id'])
|
||||||
|
{
|
||||||
|
|
||||||
|
$client = new Client($db);
|
||||||
|
$result = $client->fetch($_GET['id']);
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
print '<div class="titre">Fiche Client : '.$client->name.'</div><br>';
|
||||||
|
|
||||||
if ($id)
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
{
|
print "<tr>";
|
||||||
|
print '<td width="20%">Nom</td><td width="80%">'.$client->name.'</td></tr>';
|
||||||
$client = new Client($db);
|
print "</table>";
|
||||||
$result = $client->fetch($id);
|
|
||||||
|
|
||||||
if ( $result )
|
/*
|
||||||
{
|
* Commandes
|
||||||
|
*
|
||||||
print '<div class="titre">Fiche Client : '.$client->name.'</div><br>';
|
*/
|
||||||
|
$sql = "SELECT o.orders_id, o.customers_id,".$db->pdate("date_purchased")." as date_purchased, t.value as total";
|
||||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
$sql .= " FROM ".DB_NAME_OSC.".orders as o, ".DB_NAME_OSC.".orders_total as t";;
|
||||||
print "<tr>";
|
$sql .= " WHERE o.customers_id = " . $client->id;
|
||||||
print '<td width="20%">Nom</td><td width="80%">'.$client->name.'</td></tr>';
|
$sql .= " AND o.orders_id = t.orders_id AND t.class = 'ot_total'";
|
||||||
|
if ( $db->query($sql) )
|
||||||
|
{
|
||||||
|
$num = $db->num_rows();
|
||||||
|
$i = 0;
|
||||||
|
print '<table class="noborder" width="50%">';
|
||||||
|
print "<tr class=\"liste_titre\"><td>Commandes</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
$var=True;
|
||||||
|
while ($i < $num) {
|
||||||
|
$objp = $db->fetch_object();
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche"> ';
|
||||||
|
|
||||||
|
print strftime("%d %B %Y",$objp->date_purchased)."</a>\n";
|
||||||
|
print $objp->total . "</a></TD>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
$db->free();
|
||||||
|
|
||||||
/*
|
|
||||||
* Commandes
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$sql = "SELECT orders_id, customers_id,".$db->pdate("date_purchased")." as date_purchased";
|
|
||||||
$sql .= " FROM ".DB_NAME_OSC.".orders";
|
|
||||||
$sql .= " WHERE customers_id = " . $client->id;
|
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
|
||||||
{
|
|
||||||
$num = $db->num_rows();
|
|
||||||
$i = 0;
|
|
||||||
print '<table class="noborder" width="50%">';
|
|
||||||
print "<tr class=\"liste_titre\"><td>Commandes</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num) {
|
|
||||||
$objp = $db->fetch_object();
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche"></a> ';
|
|
||||||
|
|
||||||
print "<a href=\"".DOL_URL_ROOT."/boutique/commande/fiche.php?id=$objp->orders_id\">".strftime("%d %B %Y",$objp->date_purchased)."</a></TD>\n";
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
$db->free();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
print "<p>ERROR 1</p>\n";
|
||||||
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "Error";
|
print "<p>ERROR 1</p>\n";
|
||||||
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<p>ERROR 1</p>\n";
|
||||||
|
print "Error";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
|
* Copyright (C) 2003-2005 Éric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -33,15 +33,14 @@ llxHeader();
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($id)
|
if ($_GET['id'])
|
||||||
{
|
{
|
||||||
|
|
||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$result = $commande->fetch($id);
|
$result = $commande->fetch($_GET['id']);
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<div class="titre">Fiche Commande : '.$commande->id.'</div><br>';
|
print '<div class="titre">Fiche Commande : '.$commande->id.'</div><br>';
|
||||||
|
|
||||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
@ -83,9 +82,9 @@ if ($id)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td align="left" width="40%">';
|
print '<td align="left" width="40%">';
|
||||||
print '<a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
|
print '<a href="fiche.php?id='.$objp->products_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
|
||||||
|
|
||||||
print '<a href="fiche.php?id='.$objp->rowid.'">'.$objp->products_name.'</a>';
|
print '<a href="fiche.php?id='.$objp->products_id.'">'.$objp->products_name.'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user