<!doctype html>
<html lang="en">
  <head>
  </head>
  <style>
@media (min-width: 200px) {
.Profile-container{
	padding:0px 0px;
} 	
}
@media (min-width: 600px) {
.Profile-container{
	padding:5% 5%;
} 	
}
@media (min-width: 990px) and (max-width: 1799px) {
.Profile-container{
	padding:0% 10%;
} 
}

@media (min-width: 1800px) {  

.Profile-container{
	padding:0px 15%;
} 
}

.Profile-name, .Profile-Phone, .Profile-Addresses{
	
	background-color:#f6f6f6;
	padding:15px;
	margin:20px 0px;
	border:1px solid #e0e0e0;
	position:relative;
	box-sizing: border-box;
	float:inherit;
	font-size:15px;
}

.Profile-in-l{
	font-size:15px;
	padding-bottom:10px;
}

.Profile-in-r{
	background:#FFFFFF;
	border:1px solid #e0e0e0;
	border-radius: 5px;
}

.rp-info{
	padding:20px 0px;
	}
	
/*@media (min-width: 200px) {
.btn-center{
	padding:20px 18%;
} 	
}
@media (min-width: 600px) and (max-width: 990px) {
.btn-center{
	padding:20px 37%;
} 	
}
@media (min-width: 990px) and (max-width: 1799px) {
.btn-center{
	padding:20px 42%;
} 
}

@media (min-width: 1800px) {  

.btn-center{
	padding:20px 45%;
} 
}*/


  </style>
  <body>
  <div class="Profile-container">
  <h1>Profile</h1>

	<form action="includes/edit_profile.php" method="post">
      <div  role="tabpanel" class="Profile-all col-lg-12 col-md-12 col-sm-12 col-xs-12" id="Profile">
                <div class="Profile-l col-lg-6 col-md-6 col-sm-6 col-xs-12">
    
                    <div class="Profile-name col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
                            <div class="Profile-in-l col-lg-4 col-md-4 col-sm-12 col-xs-12">
                            *Username
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                            <?php echo $_SESSION["username"]?>
                            </div>
                        </div>
                    </div>
    
                </div>
				
				<div class="Profile-l col-lg-6 col-md-6 col-sm-6 col-xs-12">
    
                    <div class="Profile-name col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
                            <div class="Profile-in-l col-lg-4 col-md-4 col-sm-12 col-xs-12">
                            *Email Address
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                            <?php echo $_SESSION["email"]?>
                            </div>
						</div>
                    </div>
    
                </div>
                
                <div class="Profile-l col-lg-6 col-md-6 col-sm-6 col-xs-12">
    
                    <div class="Profile-name col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
                            <div class="Profile-in-l col-lg-4 col-md-4 col-sm-12 col-xs-12">
                            *Phone Number
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                            <input name="phone" style="background-color:transparent; border:0px" value="<?php echo $_SESSION["phone"]?>" />
                            </div>
						</div>
                    </div>
    
                </div>
                
                <div class="Profile-l col-lg-6 col-md-6 col-sm-6 col-xs-12">
    
                    <div class="Profile-name col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
                            <div class="Profile-in-l col-lg-4 col-md-4 col-sm-12 col-xs-12">
                            *Address
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                             <textarea name="address" style="background-color:transparent; border:0px"><?php echo $_SESSION["address"]?></textarea>
                            </div>
						</div>
                    </div>
    
                </div>
				
				<div class="Profile-l col-lg-6 col-md-6 col-sm-6 col-xs-12">
    
                    <div class="Profile-name col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
                            <div class="Profile-in-l col-lg-4 col-md-4 col-sm-12 col-xs-12">
                            *Password
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                            <a href="includes/resetpassword.php?action=reset">Set new password</a>
                            </div>
						</div>
                    </div>
    
                </div>
                <div class="col-xs-8 col-sm-3 col-sm-offset-7 col-md-2 col-md-offset-9">
                <input style="width:100%" name="submit" type="submit" value="Save Changes" class="btn btn-success" />
                </div>
                <div class="col-xs-4 col-sm-2 col-md-1">
                <input style="width:100%" value="cancel" class="btn btn-warning" />
                </div>
      </div>
      </form>
      
	   <div  role="tabpanel" class="Profile-all col-lg-12 col-md-12 col-sm-12 col-xs-12" id="Profile" style="overflow:auto">
	  <h1>Order Records</h1>
	  <table class="table table-hover">
            <?php
            $sql = "select * from orders where username='$username' order by record desc";
            $result = mysqli_query($conn,$sql);
            if ($result->num_rows > 0) {
			echo "<tr>
            <td>Order Date & Time</td>
            <td>Order No.</td>
            <td>Product Name</td>
            <td>Payment Type</td>
            <td>Payment Status</td>
            <td>Delivery Status</td>
            <td>Details</td>
            </tr>"	;
            while($row = $result->fetch_assoc()) {
			if($row["status"]=='bank'){$status='Bank Transfer';$status1='Pending';$status2='Pending';}
			if($row["status"]=='perpare'){$status='PayPal';$status1='Pending';$status2='Pending';}
			if($row["status"]=='doing'){$status='PayPal';$status1='Completed';$status2='Pending';}
			if($row["status"]=='bank doing'){$status='Bank Transfer';$status1='Completed';$status2='Pending';}						
			if($row["status"]=='bank done'){$status='PayPal';$status1='Completed';$status2='Receipt of Products';}
			if($row["status"]=='paypal done'){$status='Bank Transfer';$status1='Completed';$status2='Receipt of Products';}

            echo "<tr>
                    <td>" . $row["time"]. "</td>
                    <td>" . $row["paypal id"]. "</td>
                    <td>" . $row["bought_items"]. "</td>
                    <td>" . $status. "</td>
                    <td>" . $status1. "</td>
                    <td>" . $status2. "</td>
                    <td><a href='e-shop.php?page=13&order=".$row["record"]."'>[Details]</a></td>
                  </tr>";
            }
			}else{echo '
<div style=" padding-bottom:20%;text-align:center; padding-top:20px">
  <h2>You Do Not Have Any Orders.</h2>

<a href="#products" role="tab" data-toggle="tab" class="btn btn-color-primary" style="float:none !important;">Go shopping!</a>

  </div>';}
			
			?>
        </table>
	  </div>      
      
  </div>
  </body>
</html>