Page 1 sur 1

facture pdf recupéré les id

Posté : 15 avr. 2009, 12:55
par badibad
Bonjour tout le monde

J'ai installer une contrib (fpdf) sur mon site oscommerce ms2 et

j'essaye d'inséré dans ma facture pdf le numéro du client (cID) et la date de commande (date_purchar)dans l'entête .

Après beaucoup d'essai je ni arrive pas voici mon code

Code : Tout sélectionner

<?php /* $Id: create_pdf,v 1.2 2009/04/08 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com modif badier Copyright (c) 2005 osCommerce Released under the GNU General Public License */ define('FPDF_FONTPATH','fpdf/font/'); require('fpdf/fpdf.php'); require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ORDERS_INVOICE); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); include(DIR_WS_CLASSES . 'order.php'); class PDF extends FPDF { //Page header function Header() { //tep_db_query("select customers_id, date_purchased from " . TABLE_ORDERS . " where orders_id ,customers_id = '" . (int)$oID .(int)$customers_id . "'"); global $oID,$cID; $date = strftime(' %d/%m/%Y'); $datecom = tep_date_short($order->info['date_purchased']); //Logo $this->Image('images/invoice_logo.jpg',3,20,90); // Invoice Number and date $this->SetFont('Arial','B',10); $this->SetTextColor(0,102,153); $this->SetY(36); $this->SetX(117); $this->MultiCell(80,3,"FACTURE N°: " . tep_db_input($oID) . " Du " . $date ."\n". "\n"."COMMANDE N°: " . $oID . " Du " . $datecom,0,'C'); $this->SetY(49); $this->SetX(117); tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$cID . "'"); $this->MultiCell(39,3, "CLIENT N°: " . tep_db_input($cID) ,0,'C'); }
Pourriez vous m'aider merci. :oops:

Posté : 15 avr. 2009, 13:15
par stopher
Slt ,

Quand tu dis , "je n'y arrive pas" ... tu veux dire quoi par là ... ?

Tu as une erreur ?
Rien ne s'affiche ?

"FACTURE N°: " s'affiche , mais pas le N° .. bref .. dis toi bien , que nous ne sommes pas devant ton script en entier , et nous ne pouvons pas les tester à distance ...

Donc beaucoup d'infos manquent ..

Dis nous ce qui ne va pas exactement ...

Posté : 15 avr. 2009, 13:15
par doviet
Bonjour,

Qu'est-ce qu'il retourne comme résultat?

merci

Posté : 15 avr. 2009, 13:22
par badibad
merci j'ai ca qui s'affiche


FACTURE N° 7013 du 15/04/2009
COMMANDE N° 7013 DU
CLIENT N°:


j'ai pas la date de la commande ni le numéro du client pour le numéro de facture je ne l'ai pas encore modifier.

Posté : 15 avr. 2009, 13:24
par stopher
et ta variable : tep_db_input($cID) es tu sur qu'elle ne soit pas vide ?

Posté : 15 avr. 2009, 13:29
par badibad
J'ai changer mon code on dirai que c'est un peu mieux (mais pas sur)

Code : Tout sélectionner

global $oID,$cID; $date = strftime(' %d/%m/%Y'); $date_pur = tep_db_query("select date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $customers_id = tep_db_query("select customers_id from orders where orders_id = '" . (int)$oID . "' "); //Logo $this->Image('images/invoice_logo.jpg',3,18,90); // Invoice Number and date $this->SetFont('Arial','B',10); $this->SetTextColor(0,102,153); $this->SetY(32); $this->SetX(117); $this->MultiCell(80,3,"FACTURE N°: " . tep_db_input($oID) . " Du " . $date ."\n". "\n"."COMMANDE N°: " . $oID . " Du " . $date_pur."\n". "\n"."CLIENT N°: " . $customers_id,0,'C');


maintenant ca m'affiche ca

FACTURE N° 7013 du 15/04/2009

COMMANDE N° 7013 du Ressource id#57

CLIENT N° Ressource id#58


Je ne comprend pas vraiment.