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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| <div class="narrow_column">
<center>
<div style="margin:30px"><a href""><img src="images/image001.gif" border="0"></a></div>
<?php
$orderno = 0; // on prend 0 comme valur par défaut
if(isset($_GET['orderno'])){
$orderno = $_GET['orderno'];
}
$db_host = "";
$db_name = "";
$db_user = "";
$db_pw = "";
mysql_connect($db_host, $db_user, $db_pw)
OR die ("Cannot connect to your database");
mysql_select_db($db_name) OR die("Cannot connect to your database");
$pt_sql = mysql_query("SELECT * FROM orders where orderno='$orderno'");
if (mysql_num_rows >0)
{
while($pt_get=mysql_fetch_array($pt_sql))
{
$datetime = $pt_get['datetime'];
$g_orderno = $pt_get['orderno'];
$custom1 = $pt_get['custom1'];
$itemname = $pt_get['itemname'];
$c1 = preg_split('/\|/', $custom1, -1 , PREG_SPLIT_NO_EMPTY);
$title = preg_split('/\|/', $itemname, -1 , PREG_SPLIT_NO_EMPTY);
$title[0] = str_replace("LEASE for ","", $title[0]);
$title[1] = str_replace("LEASE for ","", $title[1]);
$title[1] = str_replace("TRACK SEPARATION for ","", $title[1]);
if ( $title[1] == "" ) {
echo "<a style='font:arial; text-decoration:none;' href='contract.php?orderno=$g_orderno' target='_blank'>Contract</a> For Item <i>$title[0]</i>";
} elseif ( $title[0] == $title[1] ) {
echo "<a style='font:arial; text-decoration:none;' href='contract.php?orderno=$g_orderno' target='_blank'>Contract</a> For Item <i>$title[0]</i>";
} else { echo "<a style='font:arial; text-decoration:none;' href='contract.php?orderno=$g_orderno' target='_blank'>Contract</a> For Item <i>$title[0]</i><br /><br />";
echo "<a style='font:arial; text-decoration:none;' href='contract2.php?orderno=$g_orderno' target='_blank'>Contract</a> For Item <i>$title[1]</i>";
}
}
//cas où il ya des résultats : traitement
} else {
echo 'There are no contracts available for download for your order.';
}
mysql_close();
?>
</center>
</div> |
Partager