<?php
ob_start();
session_start();
include_once("dbconnect.php");
//print_r($_SESSION['idlcart']); exit;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Ideal Fengling Group... I FEEL GOOD</title>
<link href="docstyle/css.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function changeclass(key){
key.className = "boxhover";
}
function changeagain(key){
key.className = "box";
}
</script>
<SCRIPT src="jquery-1.4.4.min.js" type="text/javascript"></SCRIPT>
<SCRIPT  src="jquery.orbit.min.js" type="text/javascript"></SCRIPT>
<SCRIPT type=text/javascript>
		$(window).load(function() {
			$('#featured').orbit({
				"animation" : "horizontal-push"
			});
		});
	</SCRIPT>
<link href="home.css" rel="stylesheet" type="text/css" />


<link rel="stylesheet" type="text/css" href="docstyle/ddsmoothmenu.css" />

<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>-->
<script type="text/javascript" src="ddsmoothmenu.js">

/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

ddsmoothmenu.init({
	mainmenuid: "smoothmenu2", //Menu DIV id
	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
	//customtheme: ["#804000", "#482400"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>
<style type="text/css">
<!--
.style6 {font-family: Arial, Helvetica, sans-serif}
-->
</style>


</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top" id="table"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="228" align="left" valign="bottom"><?php include_once("header.php"); ?></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="9" align="left" valign="top" style="background:url(images/shodow_left.png) repeat-y top left;">&nbsp;</td>
                <td height="500" align="left" valign="top" id="cont"><table width="100%" border="0" cellspacing="0" cellpadding="0" summary="
">
                  <tr>
                    <td width="216" align="left" valign="top"><?php include_once("leftlink.php"); ?></td>
                    <td align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          
                          <tr>
                            <td height="10"></td>
                            </tr>
                          <tr>
                            <td align="left" valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr>
                                <td align="left" valign="top" id="wel_box"><h1>Final Payment</h1>
                                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="28%" height="25" align="center" valign="middle" style="border:1px solid #CCCCCC;"><strong>Product Image</strong></td>
                                      <td width="24%" align="center" valign="middle" style="border:1px solid #CCCCCC;"><strong>Product Name</strong></td>
                                      <td width="12%" align="center" valign="middle" style="border:1px solid #CCCCCC;"><strong>Quantity</strong></td>
                                      <td width="19%" align="center" valign="middle" style="border:1px solid #CCCCCC;"><strong>Price</strong></td>
                                      <td width="17%" align="center" valign="middle"  style="border:1px solid #CCCCCC;"><strong>Total Price</strong></td>
                                      
                                      </tr>
                                      
                                      <? 
									 
									  
									  
									  for($i=1;$i<=$_SESSION['idlcount'];$i++){  ?>
                                    <tr>
                                      <td height="144" align="center" valign="middle" style="border:1px solid #CCCCCC;"><img src="products/thumb/<?php echo $_SESSION['idlcart'][$i]['prodid']; ?>-1.jpg" width="110" height="236" alt="" /></td>
                                      <td align="center" valign="middle" style="border:1px solid #CCCCCC;"><?php echo $_SESSION['idlcart'][$i]['pname']; ?></td>
                                      <td align="center" valign="middle" style="border:1px solid #CCCCCC;"><input name="<?php echo $i; ?>" type="text" disabled="disabled" id="<?php echo $i; ?>" value="<?php echo $_SESSION['idlcart'][$i]['qty']; ?>" size="3" /></td>
                                      <td align="center" valign="middle" style="border:1px solid #CCCCCC;">$ <?php echo $_SESSION['idlcart'][$i]['price']; ?></td>
                                      <td align="center" valign="middle" style="border:1px solid #CCCCCC;">$ <? echo number_format($_SESSION['idlcart'][$i]['totprice'],2); ?></td>
                                      
                                      </tr>
                                      <? 
									   $totqty=$totqty+$_SESSION['idlcart'][$i]['qty'];
								  $totres=$totres+$_SESSION['idlcart'][$i]['totprice'];
								  $totweight=$totweight+$_SESSION['idlcart'][$i]['totwieght'];
									  }
									   $_SESSION['totalquentity']=$totqty;
											$_SESSION['totalamount']=$totres;
											$_SESSION['totwieght']=$totwieght;	
									  ?>
                                    
                                    </table></td>
                                    </tr>
                                    <tr>
                                      <td width="59%" valign="top">&nbsp;</td>
                                      <td width="41%" align="center"><table width="100%" cellpadding="0" cellspacing="0" class="reference">
                                        <tr>
                                          <td height="30" align="right" valign="middle">Sub-Total:</td>
                                          <td valign="middle" align="left">$<?php echo number_format($_SESSION['totalamount'],2); ?> USD</td>
                                        </tr>
                                        <tr>
                                          <td height="30" align="right" valign="middle">+Shipping:   </td>
                                          <td valign="middle" align="left"> $<?php if($_SESSION['ship']==""){ echo '0.00'; } else {echo  number_format($_SESSION['ship'],2);  }?> USD </td>
                                        </tr>
                                        <tr>
                                          <td height="30" align="right" valign="middle">+Estimated   Tax:   </td>
                                          <?php $tax=mysql_fetch_array(mysql_query("select * from tax where t_id=1"));
										  $_SESSION['tax']=($_SESSION['totalamount']*$tax['tax'])/100;
										  ?>
                                          <td valign="middle" align="left">$<?php echo number_format($_SESSION['tax'],2); ?> USD</td>
                                        </tr>
                                        <tr>
                                          <td height="30" align="right" valign="middle">Grand   Total:   </td>
                                          <?php $_SESSION['totalamounttax']=$_SESSION['totalamount']+$_SESSION['tax']+$_SESSION['ship']; ?>
                                          <td valign="middle" align="left">$<?php echo number_format($_SESSION['totalamounttax'],2); ?> USD</td>
                                        </tr>
                                      </table></td>
                                    </tr>
                                    <tr>
                                      <td colspan="2"><table border="0" cellpadding="0" cellspacing="0" 
width="100%">
                                        <tbody>
                                          <tr>
                                            <td style="padding-bottom: 3px;" align="left" 
valign="bottom"><table width="100%" border="0" cellpadding="0" 
cellspacing="0" class="reference">
                                              <tbody>
                                                <tr>
                                                  <td></td>
                                                </tr>
                                                <tr>
                                                  <td width="50%" height="33" align="center" 
valign="bottom"><strong>Billing Details </strong></td>
                                                  <td align="center" 
valign="bottom" width="50%"><strong>Shipping Details </strong></td>
                                                </tr>
                                              </tbody>
                                            </table></td>
                                          </tr>
                                          <tr></tr>
                                          <tr>
                                            <td height="10px"></td>
                                          </tr>
                                          <tr>
                                            <td align="center" valign="middle"><table border="0" cellpadding="0" 
cellspacing="0" width="100%">

 <?php 
					$Queryre=mysql_query("select * from register where user_id=".$_SESSION['userid']); 

				  $res=mysql_fetch_array($Queryre);

				  ?>
<tr>
  <td align="center" valign="top" 
width="49%"><table style="border: 1px 
solid #CCC;" border="0" cellpadding="0" cellspacing="0" 
width="100%">
    <tbody>
      <tr>
        <td 
style="padding: 5px;" class="msgbg" align="center" valign="top"><table width="100%" 
border="0" cellpadding="0" cellspacing="3" class="reference">
          <tbody>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>First name: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['Fname'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Last name: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['Lname'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Email: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['Email'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Phone #: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingphone'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px">Fax #:&nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingfax'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="60px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Address: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingaddress1'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>City: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingcity'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>State/Province: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingstate'] ?></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Zip/Postal Code: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingzip'] ?> <span style="color: Red; display: none;"></span></td>
              </tr>
            <tr>
              <td
 align="right" valign="middle" height="25"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Country: &nbsp; </td>
              <td
 align="left" valign="middle"><?php echo $res['billingcountry'] ?></td>
              </tr>
            <tr></tr>
            </tbody>
          </table></td>
        </tr>
      </tbody>
    </table></td>
  <td align="left" valign="top" 
width="2%">&nbsp;</td>
  <td style="padding-right: 5px;" 
align="center" valign="top" width="49%"><table style="border: 1px 
solid #CCC;" border="0" cellpadding="0" cellspacing="0" 
width="100%">
  <tr>
    <td 
style="padding: 5px;" class="msgbg" align="center" valign="top"><table width="100%" 
border="0" cellpadding="0" cellspacing="3" class="reference">
      <tbody>
        <tr>
          <td width="49%" height="25px"
 align="right" valign="middle"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>First name: &nbsp; </td>
          <td width="51%"
 align="left" valign="middle"><?php echo $res['Fname'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Last name: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['Lname'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Email: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['Email'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Phone #: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingphone'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px">Fax #:&nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingfax'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="60px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Address: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingaddress1'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>City: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingcity'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>State/Province: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingstate'] ?></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25px"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Zip/Postal 
            Code:  &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingzip'] ?> <span style="color: Red; display: none;"></span></td>
          </tr>
        <tr>
          <td
 align="right" valign="middle" height="25"><span style="color: Red; 
font-family: Verdana; font-size: 9pt; font-weight: bold;">*</span>Country: &nbsp; </td>
          <td
 align="left" valign="middle"><?php echo $res['shippingcountry'] ?></td>
          </tr>
        <tr></tr>
        </tbody>
      </table></td>
  </tr>
    
    </table></td>
</tr>
                                                <tr>
                                                  <td height="20" colspan="3" align="center" 
valign="middle">&nbsp;</td>
                                                </tr>
                                                
                                                <tr>
                                                  <td colspan="3" align="center" 
valign="top">&nbsp;</td>
                                                </tr>
                                                <tr>
                                                  <td colspan="3" align="center" 
valign="top">&nbsp;</td>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" enctype="multipart/form-data"> 
                <tr>
                  <td align="center" valign="middle" colspan="3">
                  
                     <input type="hidden" name="cmd" value="_xclick" />
           <input type="hidden" name="business" value="test@test.com" />
                                                        
          <input type="hidden" name="item_name" value="products of Ideal Fengling Group" />
                                                        
                         <input type="hidden" name="quantity" value="1" />
                                                        
               <input type="hidden" name="amount" value="<?php echo number_format($_SESSION['totalamounttax'],2);  ?>" />
                                                        
   <input type="hidden" name="return" value="success.php" />
                                                        
    <input type="hidden" name="cancel_return" value="cancel.php" />
                                          
     <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif"   style="border:none;" />
                  </td>
                  </tr>
                </form>
                                                </tr>
                                                <tr></tr>
                                                <tr></tr>
                                              
                                            </table></td>
                                          </tr>
                                        </tbody>
                                      </table></td>
                                    </tr>
                                    <tr>
                                      <td colspan="2">&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <td colspan="2">&nbsp;</td>
                                    </tr>
                                  </table></td>
                              </tr>
                              </table></td>
                          </tr>
                          </table></td>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                <td width="9" align="left" valign="top" style="background:url(images/shodow_right.png) repeat-y top left;">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="100" align="center" valign="top" style="background:url(images/bottom_bg.gif) repeat-x"><?php include_once("footer.php"); ?></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

<map name="Map" id="Map">
  <area shape="rect" coords="69,274,206,318" href="#" alt="" />
</map>

<map name="Map2" id="Map2">
  <area shape="rect" coords="87,255,204,295" href="#" alt="" />
</map>
</body>
</html>
