<?php session_start();
?>
<?php   include('conn.php');
$page='Dashboard Management';
include 'common/head.php'; ?>

<style>
     * { box-sizing: border-box; }

body {
  font-family: sans-serif;
}

/* ---- input ---- */

input[type="text"] {
  font-size: 20px;
}

/* ---- button ---- */

.button {
  display: inline-block;
  padding: 0.5em 1.0em;
  margin-bottom: 10px;
  background: #EEE;
  border: none;
  border-radius: 7px;
  background-image: linear-gradient( to bottom, hsla(0, 0%, 0%, 0), hsla(0, 0%, 0%, 0.2) );
  color: #222;
  font-family: sans-serif;
  font-size: 16px;
  text-shadow: 0 1px white;
  cursor: pointer;
}

.button:hover {
  background-color: #8CF;
  text-shadow: 0 1px hsla(0, 0%, 100%, 0.5);
  color: #222;
}

.button:active,
.button.is-checked {
  background-color: #28F;
}

.button.is-checked {
  color: white;
  text-shadow: 0 -1px hsla(0, 0%, 0%, 0.8);
}

.button:active {
  box-shadow: inset 0 1px 10px hsla(0, 0%, 0%, 0.8);
}

/* ---- button-group ---- */

.button-group:after {
  content: '';
  display: block;
  clear: both;
}

.button-group .button {
  float: left;
  border-radius: 0;
  margin-left: 0;
  margin-right: 1px;
  font-size: 12px;
}

.button-group .button:first-child { border-radius: 0.5em 0 0 0.5em; }
.button-group .button:last-child { border-radius: 0 0.5em 0.5em 0; }

/* ---- grid ---- */

.grid {
  border: 1px solid #333;
  overflow: auto;
    height: 100vh !important;
}

/* clear fix */
.grid:after {
 
}

/* ---- .element-item ---- */

.element-item {

}

.element-item > * {
  margin: 0;
  padding: 0;
}

.element-item .name {

}

.element-item .symbol {

}

.element-item .number {
  position: absolute;
  right: 8px;
  top: 5px;
}

.element-item .weight {
  position: absolute;
  left: 10px;
  top: 76px;
  font-size: 12px;
}
</style>
<div id="main">

<?php 

$sql2="SELECT * FROM currency ";
$result2 = mysqli_query($conn,$sql2)or die( mysqli_error($conn));
$row2=mysqli_fetch_array($result2) ;
$currency=$row2['curency'];

                $sql="select * from orders where confirm='0' order by date desc  ";
                $result = mysqli_query($conn,$sql)or die( mysqli_error($conn));
                while ($row=mysqli_fetch_array($result)) {
                $order_id=$row['orderid'];
                $item_id=$row['item_id'];
                    $real_id=substr($order_id,-2);
                    $ord = sprintf('%03d',$real_id);
                    $location=$row['location']; 
                    $sql3="SELECT * FROM menu  WHERE id=$item_id";
                    $result3 = mysqli_query($conn,$sql3)or die( mysqli_error($conn));
                    $row2=mysqli_fetch_array($result3) ;

                ?>
                
              <!--menu items 1-->
                        <div style="display:<?php echo  $prepare_order_r ." ". $prepare_order_b ?>;" id="pizza" class=" col-sm-2  menu-items-order-managment   element-item transition  <?php echo $location ?> ">
                            <h4 style="font-size:15px;"class="text-center">#<?php echo $ord?></h4>
                            <hr class="bg-success">
                            <div class="d-flex ">
                                <img style="width: 50px; height: 90px; margin: 5px;" src="image/<?php echo $row2['image']?>" alt="">
                                <div class="menu-text">
                                    <p style="font-size:12px;"class="menu-tittle m-2"><?php echo $row['item_name']?></p><br>
                                <P class="menu-dis m-1"><?php echo $row2['discription']?>1</P>
                                <p><?php echo $row['quantity']?>X</p>
                                <div class="menu-tag">
                                    <div class="counter">
                                        <p style="font-size:12px;" class="menu-price-order-managment "><b><?php echo $currency?><?php echo number_format($row['price'],2)?></b></p>
                                      </div>
                                </div>
                                </div>
                            </div>
                            <div class="action bg-dark text-center">
                                <a style="font-size:12px;" href="edit/confirm_order.php?id=<?php echo $row["id"]; ?>" class="btn m-2 btn-outline-success"> <i class="fa fa-check-square" aria-hidden="true"></i></a>
                                <input style="font-size:10px;"  type="button" name="view" value="Cancel" id="<?php echo $row["id"]; ?>" class="btn m-2 btn-outline-danger view_data"> 
                            </div>
                           
                        </div>
    
                   <?php } ?>
 
 </div>
</div>
