<?php
require_once '../includes/core.php';
require '../includes/connect.php';






if (loggedin()){
$profile1 = getfield('profile','users','user_id');

$user_name = getfield('username','users','user_id');
$first_name = getfield('firstname','users','user_id');
$last_name = getfield('lastname','users','user_id');
$user_id = getfield('user_id','users','user_id');
$password = getfield('password','users','user_id');
$confirm = getfield('confirm','users','user_id');

$mailuser1 = getfield2('email','alert','id');

$balance = getfield('balance','users','user_id');

$accountno = getfield('accountno','users','user_id');

$accounttype = getfield('accounttype','users','user_id');

$address = getfield('address','users','user_id');

$currency = getfield('currency','users','user_id');

$city = getfield('city','users','user_id');

$state = getfield('state','users','user_id');
$zipcode = getfield('zipcode','users','user_id');
$country = getfield('country','users','user_id');


$email = getfield('email','users','user_id');
$phone = getfield('phone','users','user_id');
$dob = getfield('dob','users','user_id');

$gender = getfield('gender','users','user_id');

$photo = getfield('photo','users','user_id');




}
else
{ 
	header('Location:loginexec.php');
}
?>




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

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="icon" type="image/png" href="../assets/img/favicon.png">

	<title>SkilledOrbit - Orders</title>

	<!-- Fonts -->
	<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,700&amp;subset=latin-ext" rel="stylesheet">

	<!-- CSS - REQUIRED - START -->
	<!-- Batch Icons -->
	<link rel="stylesheet" href="assets/fonts/batch-icons/css/batch-icons.css">
	<!-- Bootstrap core CSS -->
	<link rel="stylesheet" href="assets/css/bootstrap/bootstrap.min.css">
	<!-- Material Design Bootstrap -->
	<link rel="stylesheet" href="assets/css/bootstrap/mdb.min.css">
	<!-- Custom Scrollbar -->
	<link rel="stylesheet" href="assets/plugins/custom-scrollbar/jquery.mCustomScrollbar.min.css">
	<!-- Hamburger Menu -->
	<link rel="stylesheet" href="assets/css/hamburgers/hamburgers.css">

	<!-- CSS - REQUIRED - END -->

	<!-- CSS - OPTIONAL - START -->
	<!-- Font Awesome -->
	<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.min.css">
	<!-- JVMaps -->
	<link rel="stylesheet" href="assets/plugins/jvmaps/jqvmap.min.css">
	<!-- CSS - OPTIONAL - END -->

	<!-- QuillPro Styles -->
	<link rel="stylesheet" href="assets/css/quillpro/quillpro.css">
	<style type="text/css">
	.nosamepass {
  display: none;
}
	</style>
	



</head>

<body>

	<div class="container-fluid">
		<div class="row">
			<?php include('includes/leftnav.php') ?>
			
            <div class="right-column">
    
    <div>
    
    
    
</div>
    
    				<?php include('includes/header.php') ?> 
				<main class="main-content p-5" role="main">
				
				
					

		<div class="row">
					
					
					<div class="col-md-12 col-lg-12 mb-8">
							<div class="card card-md">
								

<div class="row">
			        <div class="col-md-12 mb-5">
			          <div class="card">
			            <div class="card-header">
			              Order History 			              </div>
			            <div class="card-table table-responsive">







<?php
error_reporting('E_ALL ^ E_NOTICE');


$page=mysql_real_escape_string($_REQUEST['p']);
$limit=10;
if($page=='')
{
 $page=1;
 $start=0;
}
else
{
 $start=$limit*($page-1);
}



$query=mysql_query("SELECT * FROM orders WHERE `user_id` = '".$_SESSION['user_id']."' order by id DESC limit $start, $limit")or die(mysql_error());
$tot=mysql_query("SELECT * FROM orders WHERE `user_id` = '".$_SESSION['user_id']."' order by id DESC")or die(mysql_error());
$total=mysql_num_rows($tot);
$num_page=ceil($total/$limit);


echo'                      <table class="table table-hover align-middle">
			                <thead class="thead-light">
			                  <tr>
			                    <th width="15%"> Name</th>
			                  
					              <th width="12%">Email</th>
					              <th width="14%">Design Type</th>
					              <th width="14%">Amount Paid</th>
					              <th width="16%">Status </th>
					              <th width="16%">Date </th>
					          

					              
				              </tr>
		                    </thead>
<tbody>
     ';





while($res=mysql_fetch_array($query))
{

$id = mysql_real_escape_string($res['id']);	

				$value = mysql_real_escape_string($test['suspend']);	
			

				echo "<tr>";	
				
				echo"<td ><font>" .$res['name']."</font></td>";
				
				
				echo"<td ><font>" .$res['email']."</font></td>";
				echo"<td ><font>" .$res['item_name']."</font></td>";
				echo"<td ><font>$" .$res['item_price']."</font></td>";
				

				echo"<td ><font>";
				
				if ($res['payment_status'] === 'succeeded') {
				echo "<span class='badge badge-success'>" .$res['payment_status']."</span>";
			}elseif ($res['payment_status'] === 'pending') {
				echo "<span class='badge badge-danger'>" .$res['payment_status']."</span>";
			}


				echo"</font></td>";

				echo"<td ><font>" .$res['created']."</font></td>";


				

				

				

				

	
				echo "</tr>";


}
echo'</table>


 </tbody>';


function pagination($page,$num_page)
{
  echo'<ul style="list-style-type:none;">';
  for($i=1;$i<=$num_page;$i++)
  {
     if($i==$page)
{
 echo'<li style="float:left;padding:5px;">'.$i.'</li>';
}
else
{
 echo'<li style="float:left;padding:5px;"><a href="index.php?p='.$i.'">'.$i.'</a></li>';
}
  }
  echo'</ul>';
}
if($num_page>1)
{
 pagination($page,$num_page);
}
?> 

		                </div>
		              </div>
		          </div>
		        </div>







								<div >
				</div>
							</div>
					  </div>
					  
					  
	
						

				 
						
						
                          
                         
					</div>

					
		  </div>
					
				</main>
	  </div>
</div>
	</div>

	<!-- SCRIPTS - REQUIRED START -->
	<!-- Placed at the end of the document so the pages load faster -->
	<!-- Bootstrap core JavaScript -->
	<!-- JQuery -->
	<script type="text/javascript" src="assets/js/jquery/jquery-3.1.1.min.js"></script>
	<!-- Popper.js - Bootstrap tooltips -->
	<script type="text/javascript" src="assets/js/bootstrap/popper.min.js"></script>
	<!-- Bootstrap core JavaScript -->
	<script type="text/javascript" src="assets/js/bootstrap/bootstrap.min.js"></script>
	<!-- MDB core JavaScript -->
	<script type="text/javascript" src="assets/js/bootstrap/mdb.min.js"></script>
	<!-- Velocity -->
	<script type="text/javascript" src="assets/plugins/velocity/velocity.min.js"></script>
	<script type="text/javascript" src="assets/plugins/velocity/velocity.ui.min.js"></script>
	<!-- Custom Scrollbar -->
	<script type="text/javascript" src="assets/plugins/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
	<!-- jQuery Visible -->
	<script type="text/javascript" src="assets/plugins/jquery_visible/jquery.visible.min.js"></script>
	<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
	<script type="text/javascript" src="assets/js/misc/ie10-viewport-bug-workaround.js"></script>

	<!-- SCRIPTS - REQUIRED END -->

	<!-- ChartJS -->
	<script type="text/javascript" src="assets/plugins/chartjs/chart.bundle.min.js"></script>
	<!-- JVMaps -->
	<script type="text/javascript" src="assets/plugins/jvmaps/jquery.vmap.min.js"></script>
	<script type="text/javascript" src="assets/plugins/jvmaps/maps/jquery.vmap.usa.js"></script>

	<!-- SCRIPTS - OPTIONAL START -->
	<!-- Image Placeholder -->
	<script type="text/javascript" src="assets/js/misc/holder.min.js"></script>
	<!-- SCRIPTS - OPTIONAL END -->

	<!-- QuillPro Scripts -->
	<script type="text/javascript" src="assets/js/scripts.js"></script>
		<script type="text/javascript" src="assets/plugins/form-validator/jquery.form-validator.min.js"></script>
			<script type="text/javascript" src="assets/demo/js/forms-validation.js"></script>
			

<script type="text/javascript">

$("#code_numb").keyup(function() {
  if ($("#pass1").val() != $("#code_numb").val()) {
    $(".nosamepass").fadeIn('slow');
    $("#choosepass > input").css("border", "1px solid #ff0033");
	$("#submit").prop('disabled',true);
  } else {
    $(".nosamepass").fadeOut('slow');
    $("#choosepass > input").css("border", "1px solid #232323");
	$("#submit").prop('disabled',false);
  }
});

</script>





</body>

</html>

