Jump to content

[SOLVED] pulling product list from database


lional

Recommended Posts

I have clients with  a predefined list of products that they order each month. These are stored in a table with the clients id, the product code and the quantity. I would like to pull the clients selection and then tie it up to the products table.

I am getting an invalid argument with the foreach when I pull the clients selection and assign it to the shopping cart. I have posted the code where I am getting the problem.

 

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
while ($row_cl = mysql_fetch_assoc($result_cl)){
   $supp_id_out = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];

  
foreach($supp_id_out as $key => $value)
{
$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;

}}


if (isset($_POST['submit'])) {
		foreach ($_POST['product'] as $key => $value) {
		 if (($value == 0) AND (is_numeric($value))) {
				unset ($_SESSION['cart'][$key]);
				} elseif (is_numeric($value) AND ($value > 0)) {
					$_SESSION['cart'][$key] = $value;
				}
			}

			}

		// check if the shopping cart is empty
		$empty = TRUE;
		if (isset($_SESSION['cart'])) {
			foreach($_SESSION['cart'] as $key => $value) {
				if (isset($value)) {
					$empty = FALSE;

				}
			}
		}

 

Thanks in advance

 

Lional

Like revraz said, you probably want $supp_id_out to be an array that's created from the while loop.  Try changing this portion:

 

   $supp_id_out = array();
   while ($row_cl = mysql_fetch_assoc($result_cl)){
   $supp_id_out = $row_cl["supp_id"];
   $qty_out = $row_cl["qty"];
} 
  
foreach($supp_id_out as $key => $value)
{
$qty1 = $qty_out;
$pid = $key;

      // add to the cart session variable
      $_SESSION['cart'][$pid] = $qty1;
   
}

I have got it got so far, but no rows are being pulled. Do I need to use a foreach or can I do it the way that I have just done it

 

I have got it got so far, but no rows are being pulled. Do I need to use a foreach or can I do it the way that I have just done it

 

Thanks

 

Lional

I get the following error Invalid argument supplied for foreach()

 

Here is my code

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
while ($row_cl = mysql_fetch_assoc($result_cl)){
   $supp_id_out = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];

  }
  foreach($supp_id_out as $key => $value)
{
$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;

}	

	// Display the cart if it is not empty

    
					// Retrieve all of the information for the products in the cart
		$query = 'SELECT * FROM supplements WHERE supp_id IN (';
		foreach ($_SESSION['cart'] as $key => $value) {
			$query .= $key . ',';
		}
		$query = substr ($query, 0, -1) . ') ';
		$result = mysql_query($query);

		// create a table and a form
		print <<<TOP
		 <table width="790" align="center" bgcolor="#b3314b" cellpadding="0" cellspacing="0">
          <tr><td height="450">
					<table summary="" width="560" align="center" bgcolor="#b3314b">
<tr>
<td nowrap align="center"><font face="arial" size="2" color="white">></font></tr></table>
					<table summary="" align="center" width="560" border="1">
					<tr>
					<td>
					<table border="0" width="560" cellpadding="3"bgcolor="#b3314b">
					<tr>
					<td align="left" width="250"><font face="arial" size="2" color="white"><b>Supplement</b></font></td>

					<td align="right" width="120"><font face="arial" size="2" color="white"><b>Line Total</b></font></td>
					</tr>
			<form action="view_cart.php" method="post">		
TOP;
		// Print each item
		$total = 0; // total cost of the order
		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		/*
		if ($row['specials_discount'] > 0) {
		$list_price_out = $row['price'] / $row['specials_discount'];
		} else {
      $list_price_out = $row['price'];
      }
      */
      $list_price_out = $row['price'];
      $list_price_out = number_format($list_price_out, 2, '.', '');
		// Calculate the total and subtotals
		$subtotal = $_SESSION['cart'][$row['prod_id']] * $list_price_out;
		$subtotal = number_format($subtotal, 2, '.', '');
		$total += $subtotal;
		$total = number_format($total, 2, '.', '');
		if ($_SESSION['cart'][$row['prod_id']] > 0) {
		// print the row
		print <<<ROW
					<tr>

					<td align="left"><font face="arial" size="2" color="white">{$row['supplement']}</font></td>

					<td align="center">
            
            <input type="text" size="3" name="product[{$row['supp_id']}]" value="{$_SESSION['cart'][$row['supp_id']]}"></td>
            
<td align="right"><font face="arial" size="2" color="white">R $list_price_out </font></td>
<td align="right"><font face="arial" size="2" color="white">R $subtotal</font></td>
</tr>
ROW;
}} // end of the WHILE loop
// print the footer and close the table and the form
print <<<FOOTER
<tr>
<td></td><td></td><td></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>Total:</b></font></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>R $total</b></font><br><br></td>
</tr>
</table>
<div align="center">
  <table width="260" align="center">
<tr><td width="130" align="right"><input type="image" name="submit" src="images/update_cart.jpg" border="0"></form></td><td width="130" align="left"><form action="checkout.php" method="post"><input type="image" name="checkout" src="images/checkout.jpg" border="0"></form>
</td><td width="85"></td></tr></div>
FOOTER;
/*
print <<<EMP
					<table border="0" width="580" align="center">
					<tr>
					<td>
					<table summary="" width="300" border="1" style="border-color:#960232" bgcolor="#f8f3c2" align="center">
					<tr>
					<td>
					<table border="0" width="300" cellpadding="3">
					<tr><td align="center"><p><font face="arial" size="2" color="#5e5d5d">Your cart is empty!</font>
					</td></tr></table></table></table>
EMP;
*/
?>

        </table>
         </table>
         
  
         
       </body>
</html>

Above this line:

 

  while ($row_cl = mysql_fetch_assoc($result_cl)){

 

You need to add:

 

$supp_id_out = array();

 

And change this line to:

 

   $supp_id_out[] = $row_cl["supp_id"];

 

Without initializing $supp_id_out as an array, it will always be a string with the value of the last record that's pulled from the database.

The foreach seems to work but it is complaining about the select from the supplements table

 

$query = 'SELECT * FROM supplements WHERE supp_id IN (';
		foreach ($_SESSION['cart'] as $key => $value) {
			$query .= $key . ',';
		}
		$query = substr ($query, 0, -1) . ') ';
		$result = mysql_query($query);

Change this line to:  (notice the dot)

 

         $query .= substr ($query, 0, -1) . ') ';

 

You can get descriptive SQL error messages by changing this line to:

 

         $result = mysql_query($query) or die(mysql_error());

Yes thanks for the help you are giving

 

here is my code

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
$supp_id_out = array();
while ($row_cl = mysql_fetch_assoc($result_cl)){
$supp_id_out[] = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];
}	 



$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;



	// Display the cart if it is not empty

    
					// Retrieve all of the information for the products in the cart
		$query = 'SELECT * FROM supplements WHERE supp_id IN (';
		foreach ($_SESSION['cart'] as $key => $value) {
			$query .= $key . ',';
		}
		$query .= substr ($query, 0, -1) . ') ';
		$result = mysql_query($query) or die(mysql_error());

		// create a table and a form
		print <<<TOP
		 <table width="790" align="center" bgcolor="#b3314b" cellpadding="0" cellspacing="0">
          <tr><td height="450">
					<table summary="" width="560" align="center" bgcolor="#b3314b">
<tr>
<td nowrap align="center"><font face="arial" size="2" color="white">></font></tr></table>
					<table summary="" align="center" width="560" border="1">
					<tr>
					<td>
					<table border="0" width="560" cellpadding="3"bgcolor="#b3314b">
					<tr>
					<td align="left" width="250"><font face="arial" size="2" color="white"><b>Supplement</b></font></td>

					<td align="right" width="120"><font face="arial" size="2" color="white"><b>Line Total</b></font></td>
					</tr>
			<form action="view_cart.php" method="post">		
TOP;
		// Print each item
		$total = 0; // total cost of the order
		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		/*
		if ($row['specials_discount'] > 0) {
		$list_price_out = $row['price'] / $row['specials_discount'];
		} else {
      $list_price_out = $row['price'];
      }
      */
      $list_price_out = $row['price'];
      $list_price_out = number_format($list_price_out, 2, '.', '');
		// Calculate the total and subtotals
		$subtotal = $_SESSION['cart'][$row['prod_id']] * $list_price_out;
		$subtotal = number_format($subtotal, 2, '.', '');
		$total += $subtotal;
		$total = number_format($total, 2, '.', '');
		if ($_SESSION['cart'][$row['prod_id']] > 0) {
		// print the row
		print <<<ROW
					<tr>

					<td align="left"><font face="arial" size="2" color="white">{$row['supplement']}</font></td>

					<td align="center">
            
            <input type="text" size="3" name="product[{$row['supp_id']}]" value="{$_SESSION['cart'][$row['supp_id']]}"></td>
            
<td align="right"><font face="arial" size="2" color="white">R $list_price_out </font></td>
<td align="right"><font face="arial" size="2" color="white">R $subtotal</font></td>
</tr>
ROW;
}} // end of the WHILE loop
// print the footer and close the table and the form
print <<<FOOTER
<tr>
<td></td><td></td><td></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>Total:</b></font></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>R $total</b></font><br><br></td>
</tr>
</table>
<div align="center">
  <table width="260" align="center">
<tr><td width="130" align="right"><input type="image" name="submit" src="images/update_cart.jpg" border="0"></form></td><td width="130" align="left"><form action="checkout.php" method="post"><input type="image" name="checkout" src="images/checkout.jpg" border="0"></form>
</td><td width="85"></td></tr></div>
FOOTER;
/*
print <<<EMP
					<table border="0" width="580" align="center">
					<tr>
					<td>
					<table summary="" width="300" border="1" style="border-color:#960232" bgcolor="#f8f3c2" align="center">
					<tr>
					<td>
					<table border="0" width="300" cellpadding="3">
					<tr><td align="center"><p><font face="arial" size="2" color="#5e5d5d">Your cart is empty!</font>
					</td></tr></table></table></table>
EMP;
*/

?>

        </table>
         </table>
         
  
         
       </body>
</html>

my code reads as

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
$supp_id_out = array();
while ($row_cl = mysql_fetch_assoc($result_cl)){
$supp_id_out[] = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];


foreach($supp_id_out as $key => $value)
{

$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;

}}	

	// Display the cart if it is not empty

    
					// Retrieve all of the information for the products in the cart
		$query = 'SELECT * FROM supplements WHERE supp_id IN (';
		foreach ($_SESSION['cart'] as $key => $value) {
			$query .= $key . ',';
		}
		$query .= substr ($query, 0, -1) . ') ';
		$result = mysql_query($query) or die(mysql_error());

		// create a table and a form
		print <<<TOP
		 <table width="790" align="center" bgcolor="#b3314b" cellpadding="0" cellspacing="0">
          <tr><td height="450">
					<table summary="" width="560" align="center" bgcolor="#b3314b">
<tr>
<td nowrap align="center"><font face="arial" size="2" color="white">></font></tr></table>
					<table summary="" align="center" width="560" border="1">
					<tr>
					<td>
					<table border="0" width="560" cellpadding="3"bgcolor="#b3314b">
					<tr>
					<td align="left" width="250"><font face="arial" size="2" color="white"><b>Supplement</b></font></td>

					<td align="right" width="120"><font face="arial" size="2" color="white"><b>Line Total</b></font></td>
					</tr>
			<form action="view_cart.php" method="post">		
TOP;
		// Print each item
		$total = 0; // total cost of the order
		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		/*
		if ($row['specials_discount'] > 0) {
		$list_price_out = $row['price'] / $row['specials_discount'];
		} else {
      $list_price_out = $row['price'];
      }
      */
      $list_price_out = $row['price'];
      $list_price_out = number_format($list_price_out, 2, '.', '');
		// Calculate the total and subtotals
		$subtotal = $_SESSION['cart'][$row['prod_id']] * $list_price_out;
		$subtotal = number_format($subtotal, 2, '.', '');
		$total += $subtotal;
		$total = number_format($total, 2, '.', '');
		if ($_SESSION['cart'][$row['supp_id']] > 0) {
		// print the row
		print <<<ROW
					<tr>

					<td align="left"><font face="arial" size="2" color="white">{$row['supplement']}</font></td>

					<td align="center">
            
            <input type="text" size="3" name="product[{$row['supp_id']}]" value="{$_SESSION['cart'][$row['supp_id']]}"></td>
            
<td align="right"><font face="arial" size="2" color="white">R $list_price_out </font></td>
<td align="right"><font face="arial" size="2" color="white">R $subtotal</font></td>
</tr>
ROW;
}} // end of the WHILE loop
// print the footer and close the table and the form
print <<<FOOTER
<tr>
<td></td><td></td><td></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>Total:</b></font></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>R $total</b></font><br><br></td>
</tr>
</table>
<div align="center">
  <table width="260" align="center">
<tr><td width="130" align="right"><input type="image" name="submit" src="images/update_cart.jpg" border="0"></form></td><td width="130" align="left"><form action="checkout.php" method="post"><input type="image" name="checkout" src="images/checkout.jpg" border="0"></form>
</td><td width="85"></td></tr></div>
FOOTER;
/*
print <<<EMP
					<table border="0" width="580" align="center">
					<tr>
					<td>
					<table summary="" width="300" border="1" style="border-color:#960232" bgcolor="#f8f3c2" align="center">
					<tr>
					<td>
					<table border="0" width="300" cellpadding="3">
					<tr><td align="center"><p><font face="arial" size="2" color="#5e5d5d">Your cart is empty!</font>
					</td></tr></table></table></table>
EMP;
*/

?>

        </table>
         </table>
         
  
         
       </body>
</html>

 

I am still getting the same mysql error

You took it out of the WHILE loop again, and I think you meant you get the same foreach error.

 

Use this:

 

   $supp_id_out = array();
   while ($row_cl = mysql_fetch_assoc($result_cl))
   {
      $supp_id_out[] = $row_cl["supp_id"];
      $qty_out = $row_cl["qty"];
   }   
foreach($supp_id_out as $key => $value)
{
   $qty1 = $qty_out;
   $pid = $key;
   // add to the cart session variable
   $_SESSION['cart'][$pid] = $qty1;
}   

I still get this error and this is my code

 

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
$supp_id_out = array();
while ($row_cl = mysql_fetch_assoc($result_cl)){
$supp_id_out[] = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];

}
foreach($supp_id_out as $key => $value)
{

$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;

}	

	// Display the cart if it is not empty

    
					// Retrieve all of the information for the products in the cart
		$query = 'SELECT * FROM supplements WHERE supp_id IN (';
		foreach ($_SESSION['cart'] as $key => $value) {
			$query .= $key . ',';
		}
		$query .= substr ($query, 0, -1) . ') ';
		$result = mysql_query($query) or die(mysql_error());

		// create a table and a form
		print <<<TOP
		 <table width="790" align="center" bgcolor="#b3314b" cellpadding="0" cellspacing="0">
          <tr><td height="450">
					<table summary="" width="560" align="center" bgcolor="#b3314b">
<tr>
<td nowrap align="center"><font face="arial" size="2" color="white">></font></tr></table>
					<table summary="" align="center" width="560" border="1">
					<tr>
					<td>
					<table border="0" width="560" cellpadding="3"bgcolor="#b3314b">
					<tr>
					<td align="left" width="250"><font face="arial" size="2" color="white"><b>Supplement</b></font></td>

					<td align="right" width="120"><font face="arial" size="2" color="white"><b>Line Total</b></font></td>
					</tr>
			<form action="view_cart.php" method="post">		
TOP;
		// Print each item
		$total = 0; // total cost of the order
		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		/*
		if ($row['specials_discount'] > 0) {
		$list_price_out = $row['price'] / $row['specials_discount'];
		} else {
      $list_price_out = $row['price'];
      }
      */
      $list_price_out = $row['price'];
      $list_price_out = number_format($list_price_out, 2, '.', '');
		// Calculate the total and subtotals
		$subtotal = $_SESSION['cart'][$row['prod_id']] * $list_price_out;
		$subtotal = number_format($subtotal, 2, '.', '');
		$total += $subtotal;
		$total = number_format($total, 2, '.', '');
		if ($_SESSION['cart'][$row['supp_id']] > 0) {
		// print the row
		print <<<ROW
					<tr>

					<td align="left"><font face="arial" size="2" color="white">{$row['supplement']}</font></td>

					<td align="center">
            
            <input type="text" size="3" name="product[{$row['supp_id']}]" value="{$_SESSION['cart'][$row['supp_id']]}"></td>
            
<td align="right"><font face="arial" size="2" color="white">R $list_price_out </font></td>
<td align="right"><font face="arial" size="2" color="white">R $subtotal</font></td>
</tr>
ROW;
}} // end of the WHILE loop
// print the footer and close the table and the form
print <<<FOOTER
<tr>
<td></td><td></td><td></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>Total:</b></font></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>R $total</b></font><br><br></td>
</tr>
</table>
<div align="center">
  <table width="260" align="center">
<tr><td width="130" align="right"><input type="image" name="submit" src="images/update_cart.jpg" border="0"></form></td><td width="130" align="left"><form action="checkout.php" method="post"><input type="image" name="checkout" src="images/checkout.jpg" border="0"></form>
</td><td width="85"></td></tr></div>
FOOTER;
/*
print <<<EMP
					<table border="0" width="580" align="center">
					<tr>
					<td>
					<table summary="" width="300" border="1" style="border-color:#960232" bgcolor="#f8f3c2" align="center">
					<tr>
					<td>
					<table border="0" width="300" cellpadding="3">
					<tr><td align="center"><p><font face="arial" size="2" color="#5e5d5d">Your cart is empty!</font>
					</td></tr></table></table></table>
EMP;
*/

?>

        </table>
         </table>
         
  
         
       </body>
</html>

You should be using double quotes for your queries or you variables won't interpolate.

 

Try this, and next time post the exact error message.

 

         $query = "SELECT * FROM supplements WHERE supp_id IN (';
         foreach ($_SESSION['cart'] as $key => $value) {
            $query .= $key . ',';
         }
         $query .= substr ($query, 0, -1) . ') ";

I now get

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\htdocs\metabolic-typing\order_supplements.php on line 31

 

and this line is the foreach in the code below

 

$query = "SELECT * FROM supplements WHERE supp_id IN (';

foreach ($_SESSION['cart'] as $key => $value) {

$query .= $key . ',';

}

$query .= substr ($query, 0, -1) . ') ";

$result = mysql_query($query) or die(mysql_error());

 

I get this when I run the script

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '59,41,25,22,,0,1,2,3')' at line 1

 

My code is

<body bgcolor="#32818B" topmargin="0">
<?php
session_start();
  include 'header.php';
  $client_out = $_SESSION['clid'];
  include 'includes/conn_db.php';
    $query_cl = "SELECT * from client_supps WHERE client_id = '$client_out'";
$result_cl = mysql_query($query_cl, $conn);
$supp_id_out = array();
while ($row_cl = mysql_fetch_assoc($result_cl)){
$supp_id_out[] = $row_cl["supp_id"];
$qty_out = $row_cl["qty"];

}
foreach($supp_id_out as $key => $value)
{

$qty1 = $qty_out;
$pid = $key;

	// add to the cart session variable
	$_SESSION['cart'][$pid] = $qty1;

}	

	// Display the cart if it is not empty

    
					// Retrieve all of the information for the products in the cart
		$query = "SELECT * FROM supplements WHERE supp_id IN ('";
         foreach ($_SESSION['cart'] as $key => $value) {
            $query .= $key . ',';
         }
         $query .= substr ($query, 0, -1) . "') ";
		$result = mysql_query($query) or die(mysql_error());

		// create a table and a form
		print <<<TOP
		 <table width="790" align="center" bgcolor="#b3314b" cellpadding="0" cellspacing="0">
          <tr><td height="450">
					<table summary="" width="560" align="center" bgcolor="#b3314b">
<tr>
<td nowrap align="center"><font face="arial" size="2" color="white">></font></tr></table>
					<table summary="" align="center" width="560" border="1">
					<tr>
					<td>
					<table border="0" width="560" cellpadding="3"bgcolor="#b3314b">
					<tr>
					<td align="left" width="250"><font face="arial" size="2" color="white"><b>Supplement</b></font></td>

					<td align="right" width="120"><font face="arial" size="2" color="white"><b>Line Total</b></font></td>
					</tr>
			<form action="view_cart.php" method="post">		
TOP;
		// Print each item
		$total = 0; // total cost of the order
		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		/*
		if ($row['specials_discount'] > 0) {
		$list_price_out = $row['price'] / $row['specials_discount'];
		} else {
      $list_price_out = $row['price'];
      }
      */
      $list_price_out = $row['price'];
      $list_price_out = number_format($list_price_out, 2, '.', '');
		// Calculate the total and subtotals
		$subtotal = $_SESSION['cart'][$row['prod_id']] * $list_price_out;
		$subtotal = number_format($subtotal, 2, '.', '');
		$total += $subtotal;
		$total = number_format($total, 2, '.', '');
		if ($_SESSION['cart'][$row['supp_id']] > 0) {
		// print the row
		print <<<ROW
					<tr>

					<td align="left"><font face="arial" size="2" color="white">{$row['supplement']}</font></td>

					<td align="center">
            
            <input type="text" size="3" name="product[{$row['supp_id']}]" value="{$_SESSION['cart'][$row['supp_id']]}"></td>
            
<td align="right"><font face="arial" size="2" color="white">R $list_price_out </font></td>
<td align="right"><font face="arial" size="2" color="white">R $subtotal</font></td>
</tr>
ROW;
}} // end of the WHILE loop
// print the footer and close the table and the form
print <<<FOOTER
<tr>
<td></td><td></td><td></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>Total:</b></font></td>
<td align="right" valign="top"><font face="arial" size="2" color="white"><b>R $total</b></font><br><br></td>
</tr>
</table>
<div align="center">
  <table width="260" align="center">
<tr><td width="130" align="right"><input type="image" name="submit" src="images/update_cart.jpg" border="0"></form></td><td width="130" align="left"><form action="checkout.php" method="post"><input type="image" name="checkout" src="images/checkout.jpg" border="0"></form>
</td><td width="85"></td></tr></div>
FOOTER;
/*
print <<<EMP
					<table border="0" width="580" align="center">
					<tr>
					<td>
					<table summary="" width="300" border="1" style="border-color:#960232" bgcolor="#f8f3c2" align="center">
					<tr>
					<td>
					<table border="0" width="300" cellpadding="3">
					<tr><td align="center"><p><font face="arial" size="2" color="#5e5d5d">Your cart is empty!</font>
					</td></tr></table></table></table>
EMP;
*/

?>

        </table>
         </table>
         
  
         
       </body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.