Sindbad~EG File Manager
<?php
$WhichDisk = $_GET['WhichDisk'];
$SerialNumber = $_GET['SerialNumber'];
$ProductType = $_GET['ProductType'];
function makeOptions($n, $selected)
{ for($i=0;$i<=$n;$i++)
{ if($i==$selected)
echo("<option selected=\"selected\" value=$i> $i </option>");
else
echo("<option value=$i> $i </option>");
}
}
function getSelected($productID, $Which, $Type)
{ if($productID == 1 && $Which == 7 && $Type == "individual")
return 1;
if($productID == 2 && $Which == 3 && $Type == "individual")
return 1;
if($productID == 3 && $Which == 1 && $Type == "individual")
return 1;
if($productID == 4 && $Which == 7 && $Type == "lab")
return 1;
if($productID == 5 && $Which == 3 && $Type == "lab")
return 1;
if($productID == 6 && $Which == 1 && $Type == "lab")
return 1;
return 0;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<?php include ('include/head.php'); ?>
<body onmousemove="closesubnav(event);">
<?php include ('include/body.php'); ?>
<?php
require_once('DB.php');
require_once('query.php');
require_once('GetSerialNumber.php');
?>
<div class="style1" id="pageName">
<h2> Acquista MathXpert
<img alt="MathXpert logo" src="TransparentMathXpertLogo.gif" height="50" width="118"/>
</h2>
<p>
Seleziona le quantit� desiderate.
<p>Calcolo include Precalcolo e Algebra. Precalcolo include Algebra.
</p>
<p>Le licenze di laboratorio sono valide per una singola stanza di laboratorio fino a 35 PC. </p>
<p>MathXpert gira su qualsiasi versione di Windows. Puoi farlo girare su Mac utilizzando Virtual PC o su Linux utilizzando WINE. </p>
<form name="OrderForm" action="Order.php" method="post" >
<table border="1">
<tr> <td> <strong> Prodotto </strong></td><td><strong>Prezzo </strong></td><td><strong>Quantit�</strong></td> </tr>
<?php
$sql = "SELECT * FROM Products";
$q = query($sql);
$format = "%01.2f"; // good for American currency, dollars and cents
while($q->fetchInto($row))
{ $selected = getSelected($row[0],$WhichDisk, $ProductType); // $row[0] is the product ID
$nSelections = $row[4]; // database contains the default number of choices of quantity
$price = "$" . sprintf($format,$row[2]); // $row[2] is the price, but it needs to be formatted
echo "<tr> <td> $row[1] </td> <td align=right> $price </td> <td> <select name=$row[3]> "; // short name, e.g. "calculus" or "algebra"
makeOptions($nSelections,$selected); // outputs the <option tags
echo "</select>"; // close the selection tag
echo "</tr>"; // close the table row
}
?>
</table>
<p>
<input type="submit" name="Submit" value="Continua">
</p>
</form>
</div>
<?php include ('include/footer.php'); ?>
</body>
</html>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists