Mise en prod

This commit is contained in:
Rodolphe Quiedeville 2003-03-27 17:41:13 +00:00
parent 19d2c0ca5a
commit 87abfb2f51
5 changed files with 106 additions and 30 deletions

View File

@ -108,12 +108,23 @@ class Auteur {
*
*
*/
Function liste_livre()
Function liste_livre($id_type='', $status=0)
{
$ga = array();
$sql = "SELECT a.rowid, a.title FROM llx_livre as a, llx_livre_to_auteur as l";
if ($id_type == 'oscid')
{
$sql = "SELECT a.oscid, ";
}
else
{
$sql = "SELECT a.rowid, ";
}
$sql .= " a.title FROM llx_livre as a, llx_livre_to_auteur as l";
$sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id;
if ($status)
{
$sql .= " AND a.status = 1";
}
$sql .= " ORDER BY a.title";
if ($this->db->query($sql) )
@ -125,9 +136,9 @@ class Auteur {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$row = $this->db->fetch_row($i);
$ga[$obj->rowid] = $obj->title;
$ga[$row[0]] = $row[1];
$i++;
}
}

View File

@ -32,6 +32,9 @@ class Commande {
$this->billing_adr = New Address();
$this->delivry_adr = New Address();
$this->total_ot_subtotal = 0;
$this->total_ot_shipping = 0;
}
/*
*
@ -49,13 +52,54 @@ class Commande {
if ( $result )
{
$result = $this->db->fetch_array();
$array = $this->db->fetch_array();
$this->id = $result["orders_id"];
$this->client_id = stripslashes($result["customers_id"]);
$this->client_name = stripslashes($result["customers_name"]);
$this->id = $array["orders_id"];
$this->client_id = stripslashes($array["customers_id"]);
$this->client_name = stripslashes($array["customers_name"]);
$this->delivery_adr->name = stripslashes($array["delivery_name"]);
$this->delivery_adr->street = stripslashes($array["delivery_street_address"]);
$this->delivery_adr->cp = stripslashes($array["delivery_postcode"]);
$this->delivery_adr->city = stripslashes($array["delivery_city"]);
$this->delivery_adr->country = stripslashes($array["delivery_country"]);
$this->billing_adr->name = stripslashes($array["billing_name"]);
$this->billing_adr->street = stripslashes($array["billing_street_address"]);
$this->billing_adr->cp = stripslashes($array["billing_postcode"]);
$this->billing_adr->city = stripslashes($array["billing_city"]);
$this->billing_adr->country = stripslashes($array["billing_country"]);
$this->db->free();
/*
* Totaux
*/
$sql = "SELECT value, class ";
$sql .= " FROM ".DB_NAME_OSC.".orders_total WHERE orders_id = $id";
$result = $this->db->query($sql) ;
if ( $result )
{
$num = $this->db->num_rows();
while ($i < $num)
{
$array = $this->db->fetch_array($i);
if ($array["class"] == 'ot_total')
{
$this->total_ot_total = $array["value"];
}
$i++;
}
}
else
{
print $this->db->error();
}
}
else
{

View File

@ -44,8 +44,16 @@ if ($id)
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>";
print '<td width="20%">Numéro</td><td width="80%">'.$commande->id.'</td></tr>';
print '<td width="20%">Client</td><td width="80%"><a href="/boutique/client/fiche.php?id='.$commande->client_id.'">'.$commande->client_name.'</a></td></tr>';
print '<td width="20%">Numéro</td><td width="80%" colspan="2">'.$commande->id.'</td></tr>';
print '<td width="20%">Client</td><td width="80%" colspan="2"><a href="/boutique/client/fiche.php?id='.$commande->client_id.'">'.$commande->client_name.'</a></td></tr>';
print "<tr><td>Adresses</td><td>Livraison</td><td>Facturation</td></tr>";
print "<td>&nbsp;</td><td>".$commande->delivery_adr->name."<br>".$commande->delivery_adr->street."<br>".$commande->delivery_adr->cp."<br>".$commande->delivery_adr->city."<br>".$commande->delivery_adr->country."</td>";
print "<td>".$commande->billing_adr->name."<br>".$commande->billing_adr->street."<br>".$commande->billing_adr->cp."<br>".$commande->billing_adr->city."<br>".$commande->billing_adr->country."</td>";
print "</tr>";
print "</table>";
/*
@ -60,12 +68,10 @@ if ($id)
{
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\"><td>Produit</td>";
print "<td>Nombre</td>";
print "<td>Prix</td>";
print '<td>Prix final</td>';
print "</TR>\n";
print "<p><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre"><td>Produits</td>';
print '<td align="center">Nombre</td><td>Prix</td><td>Prix final</td>';
print "</tr>\n";
$var=True;
while ($i < $num) {
$objp = $db->fetch_object( $i);
@ -76,7 +82,7 @@ if ($id)
print "<a href=\"fiche.php?id=$objp->rowid\">$objp->products_name</a></TD>\n";
print "<TD><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";
print "<TD><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
print "<TD><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
@ -91,6 +97,16 @@ if ($id)
print $db->error();
}
/*
*
*
*/
print "<br />";
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>";
print '<td width="20%">Total</td><td width="80%"><a href="/boutique/client/fiche.php?id='.$commande->client_id.'">'.price($commande->total_ot_total).'</a></td></tr>';
print "</table>";
}

View File

@ -34,18 +34,16 @@ if ($sortorder == "")
$sortorder="DESC";
}
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
print_barre_liste("Liste des commandes", $page, $PHP_SELF);
$sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$db->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value";
$sql .= " FROM ".DB_NAME_OSC.".orders";
$sql = "SELECT o.orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$db->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value, t.value";
$sql .= " FROM ".DB_NAME_OSC.".orders as o, ".DB_NAME_OSC.".orders_total as t";
$sql .= " WHERE o.orders_id = t.orders_id AND t.class = 'ot_total'";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
@ -56,8 +54,9 @@ if ( $db->query($sql) )
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\"><td>Date</td><td>";
print_liste_field_titre("Client",$PHP_SELF, "customers_name");
print "</td><td>Statut";
print '</td><td></td>';
print '</td><td align="right">Total</td>';
// print '<td align="center">Statut</td>';
// print '<td></td>';
print "</TR>\n";
$var=True;
while ($i < $num)
@ -69,9 +68,9 @@ if ( $db->query($sql) )
print '<td><a href="fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche"></a>&nbsp;';
print strftime("%d %B %Y",$objp->date_purchased).'</td>';
print '<TD><a href="../client/fiche.php?id='.$objp->customers_id.'">'.$objp->customers_name."</a></TD>\n";
print '<td>'.$objp->orders_status.'</td>';
print '<td>'.$objp->orders_date_finished.'</td>';
print '<td align="right">'.price($objp->value).'</td>';
// print '<td align="center">'.$objp->orders_status.'</td>';
// print '<td>'.$objp->orders_date_finished.'</td>';
print "</TR>\n";
$i++;
}

View File

@ -86,7 +86,12 @@ if ($action == 'update' && !$cancel) {
$livre->editeurid = $editeurid;
$livre->description = $desc;
if (!$livre->update($id, $user))
if ($livre->update($id, $user))
{
$result = $livre->fetch($id);
$livre->updateosc($user);
}
else
{
$action = 'edit';
}
@ -313,7 +318,8 @@ else
}
print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>';
//print '<td width="20%" align="center">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>';
print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">-</td>';
print '</table><br>';