1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<?php
$vads_trans_date = strftime('%Y-%m-%d %H:%M:%S');
$enrg_com = $bdd->prepare('INSERT INTO odl_commandes (ref_commande,id_membre,total_prod_ht_initial, total_prod_ht,total_prod_ttc_initial, total_prod_ttc,livraison_ht, livraison_ttc,tot_gen_ht_initial,tot_gen_ttc_initial, pourcentage_promo, reduction_ht,reduction_ttc, tot_gen_ht, tot_gen_ttc, time, moyen_paiement, adresse_liv_num) VALUES(:num_transaction,:id_utilisateur,:total_prodht_ini,:tot_ht,:total_prodttc_init,:tot_ttc,:tarif_liv_ht,
:tarif_liv_ttc,:tot_genht_ini,:tot_genttc_ini,:pour_promo,:remise_promo_ht,:remise_promo_ttc,
:gen_ht,:gen_ttc,:vads_trans_date,:type_paiement,:num_adresse)');
$enrg_com->bindValue('num_transaction', $transaction_num, PDO::PARAM_INT);
$enrg_com->bindValue('id_utilisateur', $vads_cust_id, PDO::PARAM_INT);
$enrg_com->bindValue('total_prodht_ini', $tot_ht_ini, PDO::PARAM_STR);
$enrg_com->bindValue('tot_ht', $tot_ht, PDO::PARAM_STR);
$enrg_com->bindValue('total_prodttc_init', $tot_ttc_ini, PDO::PARAM_STR);
$enrg_com->bindValue('tot_ttc', $tot_ttc, PDO::PARAM_STR);
$enrg_com->bindValue('tarif_liv_ht', $tarif_livraison_ht, PDO::PARAM_STR);
$enrg_com->bindValue('tarif_liv_ttc', $tarif_livraison_ttc, PDO::PARAM_STR);
$enrg_com->bindValue('tot_genht_ini', $total_gen_ht_ini, PDO::PARAM_STR);
$enrg_com->bindValue('tot_genttc_ini', $total_gen_ttc_ini, PDO::PARAM_STR);
$enrg_com->bindValue('pour_promo', $promo, PDO::PARAM_STR);
$enrg_com->bindValue('remise_promo_ht', $remise_promo_ht, PDO::PARAM_STR);
$enrg_com->bindValue('remise_promo_ttc', $remise_promo, PDO::PARAM_STR);
$enrg_com->bindValue('gen_ht', $total_gen_ht, PDO::PARAM_STR);
$enrg_com->bindValue('gen_ttc', $total_gen_ttc, PDO::PARAM_STR);
$enrg_com->bindValue('vads_trans_date', $vads_trans_date, PDO::PARAM_STR);
$enrg_com->bindValue('type_paiement', $type_paiement, PDO::PARAM_STR);
$enrg_com->bindValue('num_adresse', $num_adresse, PDO::PARAM_INT);
try {
$enrg_com->execute();
$num_commande = $bdd->lastInsertId();
echo 'INSERT odl_commandes OK '.$transaction_num.'';
}
catch (PDOException $e) {
echo 'Error : ' . $e->getMessage();
echo 'INSERT INTO odl_commandes $transaction_num '.$transaction_num.'';
exit();
}?> |
Partager