HELP with Ordering Page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ronnimallouk
Forum Newbie
Posts: 15
Joined: Tue Nov 08, 2011 7:11 pm

HELP with Ordering Page

Post by ronnimallouk »

HI All, This is my first ever time using PHP and i have been learning as i go. what im trying to do is have an ordering page where a customer can log in a enter a quantity amount in a small text box on each product row, and when he or she is finished they would click on a button on the bottom of the page which will take them to a review page so then finally the order would be sent to 3 emails. at the moment im stuck, i dont know how to put the text boxes in each row to that i can make only the products with a quantity of 1 or more to move on to the next page, Any help would be greatly aprreciated.

heres my code:

Code: Select all

<?php
include "storescripts/connect_to_mysql.php"; 
?>
<?php 
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>

<?php 
$food_list = "";
$sql = mysql_query("SELECT * FROM food ORDER BY subcategory DESC");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
	while($row = mysql_fetch_array($sql)){ 
             $id = $row["id"];
		     $product_code = $row["product_code"];
		     $description = $row["description"];
		     $units_per_product = $row["units_per_product"];
		     $product_price = $row["product_price"];
		     $unit_price = $row["unit_price"];
		     $points = $row["points"];
		     $subcategory = $row["subcategory"];
			 $food_list .= '
<body topmargin="0" leftmargin="0">

<div align="center">
	<table cellpadding="0" cellspacing="0" border="0" bordercolor="#C0C0C0" width="768" height="45">
		<!-- MSTableType="layout" -->
		<tr>
			<td valign="middle" width="89" style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
			<font face="Verdana" size="1">&nbsp; ' .$product_code. '</font></td>
			<td valign="middle" width="244" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
			<font face="Verdana" size="2">&nbsp; ' .$description. '</font></td>
			<td valign="middle" width="118" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
			<p align="center"><font face="Verdana" style="font-size: 8.5pt">' .$units_per_product. '</font></td>
			<td valign="middle" width="79" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px">
			<p align="left"><font face="Verdana" style="font-size: 8.5pt">&nbsp; $' .$unit_price. '			</font></td>
			<td valign="middle" width="93" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium">
			<p align="left"><font face="Verdana" style="font-size: 8.5pt">&nbsp; $' .$product_price. '</font></td>
			<td width="84" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" valign="middle">
			<p align="right">&nbsp;&nbsp;&nbsp;<font face="Verdana" size="1">0</font>
			<font face="Verdana" size="2">' .$qty. '</font><font face="Verdana" size="1"> </font></td>
			<td height="45" width="59" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px">
			

</p>	</td>
			</tr>
	</table>
	</div>

<div align="center">
	<table cellpadding="0" cellspacing="0" width="779" height="3">
				<!-- MSTableType="layout" -->
				<tr>
	<td width="779" height="3"></td>
				</tr>
			</table>

	</div>';
    }
} else {
	$food_list = "Your Food Store Is Empty";
}

mysql_close();
?>
Heres how the page looks now:
http://www.malloukcompany.com.au/ss.png
ronnimallouk
Forum Newbie
Posts: 15
Joined: Tue Nov 08, 2011 7:11 pm

Re: HELP with Ordering Page

Post by ronnimallouk »

22 Views and not one reply
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: HELP with Ordering Page

Post by twinedev »

[Edit] Decided to remove the work I did and posted here to answer the problem. Mods can PM if you want a reason.
ronnimallouk
Forum Newbie
Posts: 15
Joined: Tue Nov 08, 2011 7:11 pm

Re: HELP with Ordering Page

Post by ronnimallouk »

twinedev wrote:[Edit] Decided to remove the work I did and posted here to answer the problem. Mods can PM if you want a reason.
i dont understand what happened can you post your answer?
Post Reply