require_once('../eshop/byb-inc-eshop-session-start.php'); //$EshopProfil->Profil_Load(); $BybKnvSession=EshopInit($EshopProfil,0,$EshopContent); //$BybKnvSession=Byb_KnvOpen(VOL_BYBLIOS); ?> /* //contexte de test function payement($idd,$password,$lien,$client,$url_retour,$nom_site,$numero_commande,$montant,$monnaie,$langue) { print 'PAYEMENT :'.$idd.' '.$password.' '.$lien.' '.$client.' '.$url_retour.' '.$nom_site.' '.$numero_commande.' '.$montant.' '.$monnaie.' '.$langue; return 1234; } function check_payement($idd, $password, $session) { print 'CHEK: '.$idd.' '.$password.' '.$session; return 'S'; } if (!isset($_REQUEST['ADMIN'])) { if (!isset($EshopClient->EshopClient_StrIbSrc)) print ''; } */ 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 ' |
| ';////////////////// 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']); } /////////////////////// ?>
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''; } /////////////////////////// // $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 ''; } ////////////////////////// print ' Profil_Get('URL_BOUTIQUE').'\'>Retourner vers la boutique - Vos achats '; print ' |
| ';
print ' Fonctions administration : '; print ' Saisir paiement cheque '; print ''; print ' Saisir numero colissimo '; print ''; $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 ' |