Profil_Load(); $BybKnvSession=EshopInit($EshopProfil,0,$EshopContent); //$BybKnvSession=Byb_KnvOpen(VOL_BYBLIOS); ?> EshopClient_StrIbSrc)) print ''; } */ print ' Votre commande'; if (isset($_REQUEST['MODE_PAY']) && $_REQUEST['MODE_PAY']=='PAYCHEQ') print ''; else print ''; print '

'; if (!isset($_REQUEST['REF'])) die('
Pas de reference d\'achat

'); $RefCommande=$_REQUEST['REF']; $IbSrc=$RefCommande % 10000; $BybUnit = $BybKnvSession->BybKnv_SrcOpenByIbSrc($IbSrc); //$BybUnit->BybSrc_WriteSavePrefNb(1);// A RETIRER (conserver dans valid) $xmlHead=$BybUnit->BybPub_GetPropGroupByTag('INDX_ACHATS','COMMANDE'); if ($xmlHead->getAttribute('REF')!=$RefCommande) { if (Admin) { print 'Erreur Num commande Lu:'.$xmlHead->getAttribute('MONTANT').' Attendu:'.$RefCommande ; } else die ('Erreur structure commande'); } if (!isset($_REQUEST['ADMIN'])) { if (isset($EshopClient) && $EshopClient->EShopClient_GetIntIbSrc() !=$xmlHead->getAttribute('CLIENT-IBSRC')) die('
Erreur de contexte

'); } if (isset($_REQUEST['MODE_PAY']) && $_REQUEST['MODE_PAY']=='PAYCHEQ') { print 'Cliquez ici pour imprimer cette commande
et adressez là avec votre réglement à :'; print '
'; print '
'.$EshopProfil->Profil_Get('SIGNAT_SOCIETE'); print '
'.$EshopProfil->Profil_Get('SIGNAT_ADRES1'); print '
'.$EshopProfil->Profil_Get('SIGNAT_ADRES2'); print '
'.$EshopProfil->Profil_Get('SIGNAT_CP_VILLE'); print '



'; } $ESHOP_CB_ID=$EshopProfil->Profil_Get('ESHOP_CB_ID'); $ESHOP_CB_PW=$EshopProfil->Profil_Get('ESHOP_CB_PW'); print '
';////////////////// main transparent //print '
DebugClient'.$xmlHead->getAttribute('CLIENT-IBSRC'); /* $BybPubClient=$BybKnvSession->BybKnv_PubOpenByIbSrc($xmlHead->getAttribute('CLIENT-IBSRC')); $propClient=$BybPubClient->BybPub_GetPropGroupByTag('INDX_CLIENTS','CLIENT'); print '
Commande ref.:'.$RefCommande; print '
Nom : '; print $propClient->getAttribute('NOM').' '.$propClient->getAttribute('PRENOM').' '; print '
Tel: '.$propClient->getAttribute('TEL').'
Email:'.$propClient->getAttribute('EMAIL').'
'; print 'Livraison :
'; print $propClient->getAttribute('ADR1').' '.$propClient->getAttribute('ADR2').'
'; print $propClient->getAttribute('CP').' '.$propClient->getAttribute('VILLE').'

'; unset ($BybPubClient); */ $Doc=$BybUnit->BybPub_GetXmlZone3(); $xmlAchat=$Doc->documentElement; $adresses=$xmlAchat->getElementsByTagName('ADRESSE'); if (!$adresses->length) die('Erreur info client'); $adres=$adresses->item(0); print '
Commande ref.:'.$RefCommande; print '
Nom : '; print $adres->getAttribute('NOM').' '.$adres->getAttribute('PRENOM').' '; print '
Tel: '.$adres->getAttribute('TEL').'
Email:'.$adres->getAttribute('EMAIL').'
'; print 'Livraison :
'; print $adres->getAttribute('ADR1').' '.$adres->getAttribute('ADR2').'
'; print $adres->getAttribute('CP').' '.$adres->getAttribute('VILLE').'

'; print 'Date: '.$xmlHead->getAttribute('HD').'
'; ///////////////////// ////////////////// cloture si CB_transac en cours $paies=$xmlAchat->getElementsByTagName('PAIEMENT'); foreach($paies as $paie) { $CbTransac=$paie->getAttribute('CB-TRANSAC'); $CbStatus=$paie->getAttribute('CB-STATUS'); //print '
Transac:'.$CbTransac.' Stat:'.$CbStatus; //print '
ES_ID:'.$ESHOP_CB_ID.' ES_PW:'.$ESHOP_CB_PW; if ($CbTransac && $CbStatus=='W') { if (!$State = check_payement($ESHOP_CB_ID,$ESHOP_CB_PW, $CbTransac)) print '
Erreur dans la verification d\'une transaction
'; $paie->setAttribute('CB-STATUS',$State); $paie->setAttribute('HD',date(DATE_FORMAT)); if ($State=='S') $xmlHead->setAttribute('STATUS','P'); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); $BybUnit->BybSrc_SavePub(); } } ///////////////// commande d'administration if (isset($_REQUEST['ADMIN_CHEQUE'])) { $paie=$Doc->createElement('PAIEMENT'); $paie->setAttribute('CHEQUE',$_REQUEST['ADMIN_CHEQUE']); $paie->setAttribute('HD',date(DATE_FORMAT)); $xmlAchat->appendChild($paie); $xmlHead->setAttribute('STATUS','P'); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); $BybUnit->BybSrc_SavePub(); unset($_REQUEST['ADMIN_CHEQUE']); } if (isset($_REQUEST['ADMIN_BT'])) { $livr=$Doc->createElement('LIVRAISON'); $livr->setAttribute('TRANSPORTEUR','COLISSIMO'); $livr->setAttribute('NUM_BT',$_REQUEST['ADMIN_BT']); $livr->setAttribute('HD',date(DATE_FORMAT)); $xmlAchat->appendChild($livr); $xmlHead->setAttribute('STATUS','T'); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); $BybUnit->BybSrc_SavePub(); unset($_REQUEST['ADMIN_BT']); } if (isset($_REQUEST['ADMIN_INFOFACT'])) { $infofact=$Doc->createElement('INFO-FACT'); $infofact->setAttribute('HD',date(DATE_FORMAT)); $xmlAchat->appendChild($infofact); $textn=$Doc->createTextNode($_REQUEST['ADMIN_INFOFACT']); $infofact->appendchild($textn); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); $BybUnit->BybSrc_SavePub(); unset($_REQUEST['ADMIN_INFOFACT']); } if (isset($_REQUEST['ADMIN-VALID-FACT'])) { $BybUnitFact = $BybKnvSession->BybKnv_SrcOpenByTag('INDX-FACTURES-BYBLIOS'); $IdFact=$BybUnitFact->BybPub_ReadPropUniq('NUMEROTATION','LAST-NUM'); $BybUnitFact->BybSrc_WritePropUniq('NUMEROTATION','LAST-NUM',++$IdFact); unset($BybUnitFact); $fact=$Doc->createElement('FACTURE'); $fact->setAttribute('HD',date(DATE_FORMAT)); $fact->setAttribute('NUM-FACT',$IdFact); $xmlAchat->appendChild($fact); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); $BybUnit->BybSrc_SavePub(); unset($_REQUEST['ADMIN-VALID-FACT']); } /////////////////////// ?>


getElementsByTagName('LIGNE'); $totalht=0; $totaltva=0; foreach($Lignes as $Ligne) { $puht=$Ligne->getAttribute('PUHT'); $tva=$puht*$Ligne->getAttribute('TVA'); $qty=$Ligne->getAttribute('QTY'); print ''; //"bgcolor="#e0e0e0">'; print ''; $totalht+=($qty*$puht); $totaltva+=($qty*$tva); } print ''; print '
Quantité Ref Designation Prix unit. HT Prix total TTC
 
' . $qty. ' ' . $Ligne->getAttribute('REF'). ' ' . $Ligne->getAttribute('DESCRIPT'). ' ' . sprintf("%01.2f", $puht). ' ' . sprintf("%01.2f", $qty*($puht+$tva)). '
 
'; print '
'; print '
Total HT '; print '
Total TVA '; print '
Frais de port '; print '
Total '; print '
'; print '
: '.sprintf("%01.2f", $totalht).' Euros '; print '
: '.sprintf("%01.2f", $totaltva).' Euros '; $livraisons=$xmlAchat->getElementsByTagName('LIVRAISON'); if ($livraisons->length) $livraison=$livraisons->item(0); print '
'.$livraison->getAttribute('ZONE').': '.$livraison->getAttribute('PX').' Euros '; print '
: '.$xmlHead->getAttribute('MONTANT').' Euros TTC

'; print '
'; $Cheque=""; $bt=""; switch($xmlHead->getAttribute('STATUS')) { case 'C': if (isset($_REQUEST['ADMIN'])) { print '
Fonction paiement non active pour ADMIN
'; } else { if (isset($_REQUEST['MODE_PAY'])) switch ($_REQUEST['MODE_PAY']) { case 'PAYCB': print '

'; if (!$transac = payement($ESHOP_CB_ID,$ESHOP_CB_PW, "Cliquez ici pour effectuer votre règlement CB sur notre site sécurisé", $EshopClient->Nom, 'http://www.byblios.fr/eshop/byb-eshop-achat.php?REF='.$RefCommande.'&session=', "byblios.fr", $RefCommande, $xmlHead->getAttribute('MONTANT'), 978, "fr")) { print '

Serveur de paiement non disponible. Retour liste des achats

'; } else { $paie=$Doc->createElement('PAIEMENT'); $paie->setAttribute('CB-TRANSAC',$transac); $paie->setAttribute('CB-STATUS','W'); $paie->setAttribute('CLIENT-IP', $_SERVER['REMOTE_ADDR']); $xmlAchat->appendChild($paie); $BybUnit->BybSrc_SetXmlZone3($Doc,$xmlAchat); /*$str=$Doc->saveXml($xmlAchat); $BybUnit->BybSrc_WriteZone3($str); $BybUnit->BybSrc_SetSizeZone3(strlen($str));*/ $BybUnit->BybSrc_SavePub(); } print '
'; print '
'; break; case 'PAYCHEQ': break; } else { print '
'; print ''; print ''; print '
'; } } break; case 'T': case 'P': /* P : En attente : Ceci signifie qu’il n’y a pas eu de tentative de payement pour cette transaction. S : Succès : Le payement a été validé par la banque et crédité sur votre compte. F : Échec : Le payement a été refusé par la banque. T : Échec : Le client a saisi de mauvaises informations trois fois de suite. C : Annulation : Le client a cliqué sur le bouton “Annuler” (ou “Cancel”) de la page de payement. X : Erreur : Une erreur s’est produite lors du payement. */ $paies=$xmlAchat->getElementsByTagName('PAIEMENT'); foreach($paies as $paie) { if ($paie->getAttribute('CB-STATUS')=='S') { $HD=$paie->getAttribute('HD'); print '
Paiement éffectué par carte bancaire le '.$HD.''; break; } $Cheque=$paie->getAttribute('CHEQUE'); if (strlen($Cheque)) { $HD=$paie->getAttribute('HD'); print '
Paiement enregistré. Chèque :'.$Cheque.' Date :'.$HD.''; break; } } //break; break; } ///////////////////// $livraisons=$xmlAchat->getElementsByTagName('LIVRAISON'); //$transp=''; //$bt=''; foreach($livraisons as $livraison) { $transp=$livraison->getAttribute('TRANSPORTEUR'); $bt=$livraison->getAttribute('NUM_BT'); //print $transp.' '.$bt; } if (isset($transp) && $transp=='COLISSIMO') { print'
Livraison par COLISSIMO :'; print'
Numéro de Colissimo: '.$bt.'
(Cliquez sur le numéro pour avoir plus d\'infos)
'; } /////////////////////////// // $facture_pdf=sprintf('%s%d.PDF',VOL_FACTURES,$RefCommande); // if (file_exists($facture_pdf)) print ' Facture PDF'; $factures=$xmlAchat->getElementsByTagName('FACTURE'); foreach($factures as $facture) { $IdFact=$facture->getAttribute('NUM-FACT'); //$facture->getAttribute('HD'); } if (isset($IdFact)) { //print '
Facture :'.$IdFact.''; print '
'; if (isset($_REQUEST['ADMIN'])) print ''; print '
'; } ////////////////////////// print '

Profil_Get('URL_BOUTIQUE').'\'>Retourner vers la boutique - Vos achats '; print '
';//////////main transparent; if (isset($_REQUEST['ADMIN'])) { print '
'; print '
Fonctions administration :
'; print '
Saisir paiement cheque

'; print '
Cheque recu :
'; print '
Saisir numero colissimo

'; print '
Numero BT :
'; $InfoFact='?'; foreach ($xmlAchat->childNodes as $infofactelem) { if ($infofactelem->nodeType != XML_ELEMENT_NODE ) continue; if ($infofactelem->nodeName =='INFO-FACT') { foreach($infofactelem->childNodes as $text) $InfoFact=$text->wholeText; } } print '
Informations de livraison (* pour imprimer saut de ligne)
'; print '

'; if (!isset($IdFact)) { print '
Création facture
'; print '
'; } //else print 'Facture n:'.$IdFact.'
'; print '

'; print '
'; } ?>