PHP Classes
elePHPant
Icontem

File: shopping_cart_1-2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of DavidLanz  >  Hippo Shopping Cart  >  shopping_cart_1-2.php  >  Download  
File: shopping_cart_1-2.php
Role: Example script
Content type: text/plain
Description: shopping cart usage demo page: other page wanna get cart details
Class: Hippo Shopping Cart
Manage shopping cart of products stored in MySQL
Author: By
Last change:
Date: 10 years ago
Size: 3,620 bytes
 

Contents

Class file image Download
<?php
  session_start
();
  require(
'classes/hippo_sql_query.php');
  require(
'classes/hippo_shopping_cart.php');
  require(
'shopping_cart_DBVar.php');
  require(
'shopping_cart_global_func.php');
 
 
$my_shopping_cart = new hippo_shopping_cart();
 
$my_shopping_cart->get_shopping_cart_detail($_SESSION['MemId'], $_SESSION['email']);
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $header_language;?>">
<meta http-equiv="Pragma" content="<?php echo SHOPPING_PRAGMA_CACHE; ?>">
<title><?php echo $header_name_shopping_cart_1_1;?></title>
<script language="javascript" src="js/shopping_cart.js"></script>
</head>

<?php
 
if($my_shopping_cart->num_of_products_id!=0)
  {
?>
<table width="80%" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
      <tr>
        <td class="txtb"> Dear<?php echo $my_shopping_cart->user_detail[0]['f_nickname'];?>: </td>
      </tr>
      <tr>
        <td bgcolor="#AA186A" class="txtw">Shopping Cart Detail</td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td><table width="520" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="520" border="0" cellspacing="0" cellpadding="3">
                  <tr align="center" class="txt">
                    <td width="200"> Product Name </td>
                    <td width="100"> Price </td>
                    <td width="60"> Quantity </td>
                    <td width="100"> Subtotal </td>
                  </tr>
                </table></td>
              </tr>
             
<?php
   
for($i=0;$i<$my_shopping_cart->num_of_products_id;$i++)
    {
?>
<tr>
                <td><table width="520" border="0" cellspacing="0" cellpadding="3">
                  <tr align="center" class="txt">
                    <td width="200" class="txtb"><?php echo $my_shopping_cart->product_detail[$i][0]['f_products_name'];?></td>
                    <td width="100"> <?php echo $my_shopping_cart->product_detail[$i][0]['f_products_price'];?> </td>
                    <td width="60"> <?php echo $my_shopping_cart->products_num_in_cart[$i];?> </td>
                    <td width="100"> <?php echo $my_shopping_cart->product_detail[$i][0]['f_products_price']*$my_shopping_cart->products_num_in_cart[$i]; ?> </td>
                  </tr>
                  <tr align="center" class="txt">
                    <td colspan="5" class="txtb"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="3" background="images/dot.gif"></td>
                      </tr>
                    </table></td>
                    </tr>
                </table></td>
              </tr>

<?php
   
}
?>
</table></td>
          </tr>
          <tr>
            <td align="center" class="txtb"> There are <span class="txtr"><?php echo $my_shopping_cart->num_of_products_id;?></span> productsˇAamount: NT$<span class="txtr"><?php echo $my_shopping_cart->final_price;?></span> dollar </td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="center" class="txt"><input type="button" name="Continue_Shopping" value="Continue Shopping" onclick=javascript:redirectpage('<?php echo $url_continue_shopping;?>') >
        </td>
      </tr>
    </table></td>
  </tr>
</table>

<?php
 
}
?>

</html>