<?php
session_start();
include ("includes/security.php");
include ("includes/database.php");
include ("includes/setting.php");

//retrieved logged's user data
$username=$_SESSION["username"];
$dataUser=mysqli_query($newcon,"SELECT * from customer where username='$username'");
$bil_rekod=mysqli_num_rows($dataUser);
$showData=mysqli_fetch_array($dataUser);


$_SESSION["data3"]=$_POST["receiver_name"];
$_SESSION["data4"]=$_POST["receiver_address"];
$_SESSION["data5"]=$_POST["receiver_hp"];
$_SESSION["data6"]=$_POST["customize_specialnotes"];



//retrieved tbl_data2

$data1=mysqli_query($newcon,"SELECT * from basket where basket_id='$_SESSION[data1]'");
$showData1=mysqli_fetch_array($data1);

$data2=mysqli_query($newcon,"SELECT * from flower where flower_id='$_SESSION[data2]'");
$showData2=mysqli_fetch_array($data2);

$data3=mysqli_query($newcon,"SELECT * from addons_choice where addons_id='$_SESSION[data7]'");
$showData3=mysqli_fetch_array($data3);

?>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><?php echo $tajuk; ?></title>

    <!-- Bootstrap Core CSS -->
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<?php
$ttlSemua=0;
?>
    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
               <a class="navbar-brand" href="#"> <font face="Aharoni" size="22"> <?php echo $tajuk; ?> </font></a>
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">

               
                
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
<?php include ("includes/menu_atas.php"); ?>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->

            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        
                        <?php include "includes/menu_tepi.php";?>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <!-- Page Content -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                      <h1 class="page-header">List of Products</h1>
                      
                      
                      
                       <div class="col-lg-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                          
                          
                          
                        
                          
                          
                          
                          
                          
                          
                          
                          
                          
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                

<table width="500" border="0">
  <tr>
    <td colspan="2"><p>SENDER DETAILS</p>
      <p>&nbsp;</p></td>
    </tr>
  <tr>
    <td width="162">NAME</td>
    <td width="328"><?php echo $showData['name']; ?></td>
  </tr>
  <tr>
    <td>ADDRESS</td>
    <td>
  <?php echo $showData['add1']; ?>, 
  <?php echo $showData['add2']; ?>, 
  <?php echo $showData['postcode']; ?>,
  <?php echo $showData['city']; ?>, 
  <?php echo $showData['state']; ?>
    </td>
  </tr>
  <tr>
    <td>HANDPHONE NUMBER</td>
    <td><?php echo $showData['phone']; ?></td>
    
  </tr>
</table>
<br>
<br>
<table width="500" border="0">
  <tr>
    <td colspan="2"><p>RECEIVER DETAILS</p>
      <p>&nbsp;</p></td>
    </tr>
  <tr>
    <td width="159">NAME</td>
    <td width="331"><?php echo $_SESSION['data3']; ?></td>
  </tr>
  <tr>
    <td>HANDPHONE</td>
    <td><?php echo $_SESSION['data4']; ?></td>
  </tr>
  <tr>
    <td>ADDRESS</td>
    <td><?php echo $_SESSION['data5']; ?></td>
    
  </tr>
  
  <tr>
    <td>SPECIAL NOTES</td>
    <td><?php echo $_SESSION['data6']; ?></td>
    
  </tr>
  
</table>
<p>&nbsp;</p>
<table width="500" border="0">
  <tr>
    <td colspan="3">gifts images</td>
    </tr>
  <tr>
     <td><?php echo '<img src="data:'.$showData3["addons_id"].';base64,'.base64_encode($showData3["addons_pic"]) .'" class="img-circle" width="100" height="100"/>';?></td>
    <td><?php echo '<img src="data:'.$showData1["basket_id"].';base64,'.base64_encode($showData1["basket_picture"]) .'" class="img-circle" width="100" height="100"/>';?></td>
    <td><?php echo '<img src="data:'.$showData2["flower_id"].';base64,'.base64_encode($showData2["flower_img"]) .'" class="img-circle" width="100" height="100"/>';?></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<p><br>
  </p>
<table width="500" border="0">
  <tr>    
    <td>RM <?php echo number_format($showData1['basket_price']+$showData2['flower_price']+$showData3['addons_price']);?></td>
</tr>

<?php
$ttlSemua+=($showData1['basket_price']+$showData2['flower_price']+$showData3['addons_price']);

?>
                                       
</tbody>



 <tr>
                                            <th colspan="5" align="right" valign="middle">SUM TOTAL</th>
                                         
                                            <th>RM <?php echo number_format($ttlSemua); ?></th>
                                        </tr>
                                        
                                                                            
 <tr>
                                            <th colspan="6" align="right" valign="middle"><center> 
                                            
                                            
                        
 <tr>
                                            
                                         
                                           
                                        </tr>
                                        
                                       
                 


<a href="payment1.php?jumlah=<?php echo number_format($ttlSemua); ?>" class="btn btn-primary">Confirm Purchase</a></center></th>
                                         
                                           
                                        </tr>
                                        
                                        <?php

?>
    
    </td>
  </tr>
</table>
<p><br>
  
  
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="alert alert-success">
  
</div>
						
                                
                                
                    </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-6 -->
            </div>
            <!-- /.row -->
                      
                      
                      
                      
                        
                      
  
  
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.container-fluid -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="vendor/metisMenu/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="dist/js/sb-admin-2.js"></script>

</body>

</html>
