0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
factures
/
[
Home
]
File: facture_html_.php
<? include("../configuration.inc.php"); /* Charge les détails d'une commande et les affiche */ $timestamp = urldecode(htmlspecialchars($_GET['timestamp'])); $id = intval($_GET['id']); $mode = htmlspecialchars($_GET['mode']); if (!empty($id) && !empty($timestamp)) { $qid_commande = mysql_query_override("SELECT * FROM gaia_commandes WHERE id = '$id' AND o_timestamp = '$timestamp'"); if (mysql_num_rows_override($qid_commande) > 0) { $qid_items = mysql_query_override("SELECT ca.*, p.image1 FROM gaia_commandes_articles ca, gaia_produits p WHERE ca.produit_id = p.id and ca.commande_id = '$id'"); $commande = mysql_fetch_object_override($qid_commande); $result = mysql_query_override(" SELECT * FROM gaia_utilisateurs WHERE id_utilisateur = '".$commande->id_utilisateur."' "); $user = mysql_fetch_array_override($result); switch ($mode) { case "proforma" : $mention = ''; $libelle = PROFORMA; $numero = $id; $numco = ''; $date_document = $commande->o_timestamp; break; case "facture" : $mention = ''; //'TVA non applicable, article 293 B du Code général des impôts'; $libelle = INVOICE; $numero = $commande->numero; $numco = '<br /><span style="font-weight:normal;font-size:12px; color:#666">Commande n°'.$id.'</span>'; $date_document = $commande->a_timestamp; break; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><?=$libelle." ".NUMBER." ".$numero." du ".@date("d-m-Y",@strtotime($date_document))."";?></title> <link REL="stylesheet" type="text/css" href="<?=$stylefile?>"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script LANGUAGE="JavaScript" SRC="<?=$wwwroot?>/lib/js/window.js"></script> </head> <body bgcolor="#FFFFFF" style="background:#fff"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" width="90%" height="100%" bgcolor="#FFFFFF" style="padding:0; margin:0"> <tr> <td align="center" style="padding-top:15px"><img src="<?=$wwwroot?>/images/logonoir.png" align="absmiddle" /></td> </tr> <tr> <td class="total" style="font-size:14px; padding-top:15px"><? echo $libelle." N° ".$numero." du ".@date("d/m/Y",@strtotime($date_document)).$numco;?></td> </tr> <tr> <td valign=top style="padding:0; margin:0"><div align="center"> <table border="0" cellpadding="0" cellspacing="5" width="100%" BGCOLOR="WHITE" style="padding:0; margin:0"> <tr> <td valign=top width="49%" style="padding:10px 0 0 0; margin:0"><table border="0" cellpadding="0" cellspacing="10" width="100%" style="margin:0;border:1px solid #eee"> <tr> <th class="tetiere"><?echo mb_strtoupper(BILL_ADDRESS)?></th> </tr> <tr> <td class="normal"><?=nl2br(stripslashes($commande->client_info1))?></td> </tr> </table></td> <td valign=top width="49%" style="padding:10px 0 0 0; margin-left:5px"><table border="0" cellpadding="0" cellspacing="10" width="100%" style="margin:0;border:1px solid #eee"> <tr> <th class="tetiere"><?echo mb_strtoupper(SHIP_ADDRESS)?></th> </tr> <tr> <td class="normal"><?=nl2br(stripslashes($commande->client_info2))?></td> </tr> </table></td> </tr> </table> <br /><br /> <table border="0" cellpadding="0" cellspacing="0" width="100%" BGCOLOR="WHITE" style="padding-bottom:0; margin-bottom:0"> <tr class="caddie"> <th align="center" style="text-align:left"><?echo mb_strtoupper(PRODUCT)?></th> <th align="center"><?echo mb_strtoupper(UNIT_PRICE)?></th> <th align="center">QTE</th> <th align="center"><?echo mb_strtoupper(TOTAL_PRICE)?></th> </tr> <? $ensemble_total_ht = 0; $ensemble_total_ttc = 0; if ($qid_items) { if (mysql_num_rows_override($qid_items)) { while ($prod = mysql_fetch_array_override($qid_items)) { //$imga1 = first_img($prod['image1'], $prod['id'], $prod['couleur']); ?> <tr> <!--<td valign="top" width="60" class="lignecaddie"><?=((!empty($imga1) && file_exists($dirroot.'/upload/'.$imga1))?'<img src="'.$repertoire_upload.'/min_'.$imga1.'" width="50">':'')?></td>--> <td class="lignecaddie"><? print html_entity_decode(($prod['nom_produit'])); echo '<span>'; //if ($prod['promotion'] != 0) {print " (- ".$prod['promotion']." % )";} //if ($prod['delivery_stock'] != '') {print "<br />".DELIVERY_STOCK." : ".$prod['delivery_stock'].".";} if ($prod['couleur'] != '') {print "<br />Couleur : ".$prod['couleur']."";} if ($prod['taille'] !='') {print "<br />Taille : ".$prod['taille']."";} if ($prod['comment'] !='') {print "<br />".COMMENTS." : ".stripslashes($prod['comment']).".";} if ($prod['option_prix'] != 0) {print "<br />".OPTION_PRIX." : ".$prod['option_prix']."€";} echo '</span>'; ?> </td> <td class="lignecaddie "align="center" ><?php echo $prod['prix_ht']. " €" ?></td> <td class="lignecaddie "align="center" ><?php echo $prod['quantite'] ?></td> <td class="lignecaddie "align="center" ><?php echo $prod['total_prix']. " €" ?></td> </tr> <? } ?> </table> <? } } ?> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%" > <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo TOTAL_HT?></td> <td align="right" bgcolor="#FFFFFF" class="value"><?echo fprix($commande->total_produit_avant_promo_ht) ?> €</td> </tr> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?php echo VAT ?> 20 %</td> <td align="right" bgcolor="#FFFFFF" class="value"><?php echo fprix($commande->total_tva)." €";?></td> </tr> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo TOTAL_TTC?></td> <td align="right" bgcolor="#FFFFFF" class="value"><?echo fprix($commande->total_produit_avant_promo) ?> €</td> </tr> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?php echo SHIPPING_COST." T.T.C<br />".SHIPPING." : ".$commande->transport;?></td> <td align="right" bgcolor="#FFFFFF" class="value"><?php echo ($commande->cout_transport != 0) ? fprix($commande->cout_transport)." €" : "".OFFERED; ?> </td> </tr> <?php if ($commande->ecotaxe_ttc > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit">ECOTAXE</td> <td align="right" bgcolor="#FFFFFF" class="value"><?echo fprix($commande->ecotaxe_ttc) ?> €</td> </tr> <? } if ($commande->remise_client_percent > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo REMISE_CLIENT." ( ".$commande->remise_client_percent." % )"?></td> <td align="right" bgcolor="#FFFFFF" class="value">- <?echo fprix($commande->remise_client) ?> €</td> </tr> <? } if ($commande->remise_code_percent > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo CODE_PROMO_REMISE." ( ".$commande->remise_code_percent." % )"?></td> <td align="right" bgcolor="#FFFFFF" class="value">- <?echo fprix($commande->remise_code) ?> €</td> </tr> <? } if ($commande->remise_cheque > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo CHEQUE_CADEAU_REMISE." ( ".$commande->code_cheque_cadeau." )"?></td> <td align="right" bgcolor="#FFFFFF" class="value">- <?echo fprix($commande->remise_cheque) ?> €</td> </tr> <? } if ($commande->remise_bon > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo BON_REDUCTION_REMISE." ( ".$commande->code_bon." )"?></td> <td align="right" bgcolor="#FFFFFF" class="value">- <?echo fprix($commande->remise_bon) ?> €</td> </tr> <? } if ($commande->avoir > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo AVOIR?></td> <td align="right" bgcolor="#FFFFFF" class="value">- <?echo fprix($commande->avoir) ?> €</td> </tr> <?php } ?> <?php if ($commande->tarif_paiement > 0) { ?> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo PAY_COST?></td> <td align="right" bgcolor="#FFFFFF" class="value">+ <?echo fprix($commande->tarif_paiement)?> €</td> </tr> <? } ?> <tr class="caddie"> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo NET?> TTC</td> <td align="right" bgcolor="#FFFFFF" nowrap="nowrap" class="total"><?php echo fprix($commande->montant)." € T.T.C";?></td> </tr> <tr> <td align="left" bgcolor="#FFFFFF" class="intit"><?echo PAYEMENT?></td> <td align="right" bgcolor="#FFFFFF" class="value"><?=$commande->paiement?></td> </tr> <?php if(!empty($commande->colis)) { ?> <tr class="caddie"> <td><?="<b>".COLIS."</b>"; ?></td> <td><?=stripslashes($commande->colis);?></td> </tr> <? } ?> <?php if(!empty($commande->commentaires)) { ?> <tr class="caddie"> <td colspan="2" ><?php echo "<b>".COMMENTS."</b>"; ?> </tr> <tr> <td colspan="2" class="normal"><?php echo stripslashes($commande->commentaires); ?> </tr> <? } ?> <!-- <tr> <td colspan="2" style="border:0; padding-top:20px" align="center"> <? $qid = mysql_query_override("SELECT * FROM gaia_societe"); $ligne = mysql_fetch_object_override($qid); echo '<b>'.html_entity_decode($ligne->societe).'</b> '.html_entity_decode($ligne->adresse).' '.$ligne->code_postal.' '.html_entity_decode($ligne->ville); echo (!empty($ligne->tel)?'<br />'.$ligne->tel:'').(!empty($ligne->fax)?' - '.$ligne->fax:''); echo (!empty($ligne->siren)?'<br />'.$ligne->siren:'').(!empty($ligne->tvaintra)?' - '.$ligne->tvaintra:''); ?> </td> </tr> --> </table> </div> </td> </tr> </table> <br /><span style="font-size:11px;"><?=$mention?></span><br /> </center> <script language="javascript"> window.print(); </script> <? } else { echo "NO HACK !"; } } else { echo "NO HACK !"; }?> </div> </body> </html>