

<?php 
  session_start();
  include"inc/config.php";
   $errors = array(); // initialize variables
  $Role= ""; $Username = "";  $id = ""; $Phoneno="";    $total_price= "";
  $Id = 0; 
  $update = false;

  if (isset($_GET['edit'])) { 
    $id = $_GET['edit'];
  $record = mysqli_query($db, "SELECT * FROM items_received WHERE id= $id ");

    if (count($record) == 1 ) {
    $n = mysqli_fetch_array($record);
    $id = $n['id'];  $customer = $n['customer'];   $totalprice = $n['totalprice'];  $receipt_no = $n['receipt_no'];  $quantity = $n['quantity']; 
 
    }

$sql = "select SUM(totalprice) as totalprice from items_received where receipt_no = '$receipt_no' AND time >= CURDATE() AND YEAR(time) = YEAR(CURRENT_DATE)";  
 $result = $db->query($sql);  $row = $result->fetch_array();{  $grandtotal= $row['totalprice'];}
 // echo $grandtotal;


  }
?>


<!DOCTYPE>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
 body { font-family: helvetica, sans-serif; }
* {  box-sizing: border-box;}
body {  margin: 0;}

td {  padding:4px;border-bottom: 1px solid #ddd !important; font-size: xx-small; }

th {  padding:10px;border: 1px solid #ddd !important; background:#7CB9E8; color: white; opacity: .8;text-align: left;  font-size: x-small;
 border-spacing: 1;}

table { margin: auto; border-spacing: 1; width:100%;  overflow-x: auto;  background: white;}
.table { width: 100%; overflow-x: auto; height: 70%;  scrollbar-width: thin; padding: 5px;}

.no-results{float: left; margin-left: 5%; color: red; font-size: small;}


.top-top {float: left; font-size: x-small;color:#848482; width: 100%; padding: 10px; margin-bottom: 1%;}
 
.wrapper{ background:whitesmoke;  width:100%; border: 0px solid #a1a1a1;  margin:auto; resize: none;     overflow:hidden; }

.column-a {  float: left;  width:18%;  padding: 0px; height: 90%; background:white ;border-top: 2px solid whitesmoke;  overflow-x: auto; scrollbar-width: thin; }

.column-b { float: left; width: 82%;  padding: 15px; overflow-x: auto; scrollbar-width: thin; height: 90%; }

.section-one { float: left; width: 50%; padding: 15px;  }
.section-two{ float: left; width: 50%; padding: 15px; }

.cartdiv { background: white; padding: 15px; width: 100%;  float: left; }

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}

@media screen and (max-width:600px) {
  .column-a { width: 100%; height: auto; }
  .column-b {  width: 100%; height:auto; } 
  .section-one , .section-two{ float:left; width:100%; }}

</style>
</head>
<body>


<div class="row">

<div class="wrapper">

  <nav> <?php include "header.php"; ?></nav>


  <div class="column-a"><?php include "menu.php"; ?>  </div>
  
  <div class="column-b">

    <div class="top-top">
<a href="index.php" style="color: black; text-decoration: none; font-weight: bold;"> Home </a>
<a href="index.php?link=001returned" style="color:#848482; text-decoration: none; font-weight: bold;">// Manage returned Items</a>
<a > //Checkout for items to be exchanged with</a>
</div>



    <nav class ="section-one"><div class="cartdiv">
      <form method="post" > <?php include 'exchange-search.php'; ?> </form>
      <?php include"cart-3.php" ?> </div> </nav>


    <nav class ="section-two"><div class="cartdiv"> <?php include"cart-4.php" ?></div> </nav>




  </div>

 <?php include ("footer.php"); ?>

</div>

</div>
</body>
</html>
