The code is link from the Find a property page once the user select a property it should bring then to the discount page but the dicount doesnt wrk and i really dnt no why pls any help will be greatful
this code below is mt discount.php code
PHP Code:
<h1>M & K Townhouse Incorporation</h1>
<ul id="nav">
<li class="h"><a href="index.php">Home</a></li>
<li class="a"><a href="purchase.php">Find a Property</a></li>
<li class="c"><a href="discount.php">Discount</a></li>
<li class="p"><a href="payment.php">Payment</a></li>
<li class="d"><a href="summary.php">Summary</a></li>
</ul>
</div>
<!-- /header -->
<div id="content">
<h4>Discount</h4>
<div id="text">
<?php
$id = $_GET['id'];
$_SESSION['p'] = $_GET['id'];; // Set name = form variable $name
//echo $_SESSION['p'];
if ($_SESSION['p']!="")
{
echo "<div id='text1'>";
echo "You have selected property ";
echo "$id";
echo "<br />";
$con = mysql_connect("localhost","xxxxxxxx","xxxxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("xxxxxxxxx", $con);
$result1 = mysql_query("SELECT propertyprice FROM property WHERE propertyid = $id");
while($row = mysql_fetch_array($result1))
{
echo 'The original property price £' . number_format($row['propertyprice'],2);
$price = $row['propertyprice'];
echo "<br />";
}
$upgradedprice = $propertyprice;
$propertyoption1 = $_POST["Option_1"];
$propertyoption2 = $_POST["Option_2"];
$propertyoption3 = $_POST["Option_3"];
if (($propertyoption1=='centre_surround') && ($propertyoption2=='fully_carpeted') && ($propertyoption3=='early_completion')){
echo "<br />";
echo "You have chosen a central surround system, fully carpeted bedroom and early completion";
echo "<br />";
$upgradedprice = $propertyprice-((1.2/100)*($propertyprice+5500+2950));
$upgradedpriceF = number_format($upgradedprice,2);
echo 'The new property price after options have been added £' . $upgradedpriceF;
echo "<br />";
echo "<br />";
echo "Click proceed to continue to transaction";
$propertyoption1="checked";
$propertyoption2="checked";
$propertyoption3="checked";
echo "<br />";
} else if (($propertyoption1=='centre_surround') && ($propertyoption2=='fully_carpeted')) {
echo "<br />";
echo "You have chosen a central surround system and fully carpeted bedroom";
echo "<br />";
$est1 = $propertyprice - ((1.2/100)*($propertyprice+5500+2950));
$est2 = $propertyprice - ((0.45/100)*($propertyprice+5500));
if ($est1 < est2) {
$upgradedprice = $est1;
} else if ($est2 < $est1) {
$upgradedprice = $est2;
} else {
$upgradedprice = $est1;
}
echo 'The new property price after options have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
$opt1="checked";
$opt2="checked";
echo "<br />";
} else if (($propertyoption1=='centre_surround') && ($propertyoption3=='early_completion')) {
echo "<br />";
echo "You have chosen a central surround system and early completion";
echo "<br />";
$upgradedprice = $propertyprice - ((1.2/100)*($propertyprice+5500));
echo 'The new property price after options have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
echo "<br />";
$opt1="checked";
$opt3="checked";
} else if (($propertyoption2=='fully_carperted') && ($propertyoption3=='early_completion')) {
echo "<br />";
echo "You have chosen a fully carpeted bedroom and early completion";
echo "<br />";
$upgradedprice = $propertyprice - ((1.2/100)*($propertyprice+2950));
echo 'The new property price after options have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
echo "<br />";
$opt2="checked";
$opt3="checked";
} else if ($propertyoption1=='centre_surround') {
echo "<br />";
echo "You have choosen a central surround system";
echo "<br />";
$upgradedprice = ($propertyprice + 5500);
echo 'The new property price after option have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
echo "<br />";
$opt1="checked";
} else if ($propertyoption2=='fully_carpeted') {
echo "<br />";
echo "You have chosen a fully carpeted bedroom";
echo "<br />";
$upgradedprice = ($propertyprice + 2950);
echo 'The new property price after options have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
echo "<br />";
$opt2="checked";
} else if ($propertyoption3=='early_completion') {
echo "<br />";
echo "You have chosen an early completion";
echo "<br />";
$upgradedprice = $propertyprice - ((1.2/100)*($propertyprice));
echo 'The new property price after options have been added £' . number_format($upgradedprice,2);
echo "<br />";
echo "<br />";
echo "Click proceed to continue transaction";
echo "<br />";
$opt3="checked";
} else {
echo "<br />";
echo "Choose from the options or click proceed";
echo "<br />";
}
echo "<br />";
echo "<form action='$php_self' method='post'>";
echo "central surround system £5500 <input type='checkbox' name='Option_1' value='centre_surround' $opt1>";
echo "<br />";
echo "fully carpeted bedroom £2950 <input type='checkbox' name='Option_2' value='fully_carpeted' $opt2>";
echo "<br />";
echo "early completion <input type='checkbox' name='Option_3' value='early_completion' $opt3>";
echo "<br />";
echo "<br />";
echo "<input type='submit' value='Add option(s)'>";
echo "</form>";
echo "<br />";
echo "<br />";
echo "<br />";
echo "<br />";
echo "<form action='payment.php' method='post'>";
echo "<input type='submit' value='proceed'>";
echo "</form>";
mysql_close($con);
}
else{
echo "Please choose a property";
}
</div>
<!-- /content -->
<div id="footer">
<div id="ftinner">
<div class="ftlink ">
<p id="copyright">© 2008. All Rights Reserved. <br/>
Designed by XXXXXXXXXXXXXXXXX </a></p>
</div>
</div>
</div>
<!-- /footer -->
</div>
</div>
</body>
</html>