<?php require('header.php'); ?>
<?php require("connect.php"); ?>
<?php 
$oid= $_GET['oid'];
$sid2= $_GET['sid2'];
//echo $oid;
//echo "//";
//echo $sid2;
echo "<center><a href='http://medscan.webs.dynacomp2.eu/medscan2/index.php'><button class='btn btn-warning btn-sm'>Back</button><br></center>";

?>

<div class="row">
    <div class="box col-md-12">
    <div class="box-inner">
    <div class="box-header well" data-original-title="">
        <h2>HEADER</h2>

        <div class="box-icon">
          
            <a href="#" class="btn btn-minimize btn-round btn-default"><i
                    class="glyphicon glyphicon-chevron-up"></i></a>
          
        </div>
    </div>
    <div class="box-content">
   
    <table class="table table-striped table-bordered responsive">
    <thead>
    <tr>
						<tr>
                            <th>Αριθμός Παραγγελίας</th>
                            <th>Ημερομηνία</th>
                            <th>Όνομα πελάτη</th>
                            <th>Παράδοση</th>
							 <th>Προορισμός</th>
							 <th>Κιβώτια</th>
							 <th>Κιλά</th>
							 <th>Actions</th>
                            
                        </tr>
    </tr>
    </thead>
    <tbody>

    <?php
					//echo $_SESSION['sid2'];
					//$sid2 = $_SESSION['sid2'];
					//$sid2 = "214-0171";
					if ($_SESSION['sid2'] == 1 ){$query = "Select * from RECEIVERS where OrderId ='".$oid."'";}
					else { $query = "Select * from RECEIVERS where OrderId ='".$oid."'";}
					//else { $query = "Select * from RECEIVERS where UserCode ='".$sid2."' AND Orderid ='".$oid."'";}
					//echo $query ;
					$result = mysqli_query($dbC,$query) or die(mysqli_error());
					$y=0;
					 while($row = mysqli_fetch_array($result)){
                            $y++;
							if ($_SESSION['sid2'] == 1 ){
							$sid2 = $row['UserCode'];}
                            echo "<tr onclick='get_details(".$row['OrderId'].", $(this).offset());'>";
                            echo "<td>".$row['OrderId'] ." </td>";
							echo "<td>".$row['PhrDate']."</td>";
							echo "<td>".$row['RecName']."</td>";
							echo "<td>".$row['RecParadosh']."</td>";  
							echo "<td>".$row['RecProorismos']."</td>"; 	
							echo "<td>".$row['PhrKibotia']."</td>";
							echo "<td>".$row['PhrKila']."</td>";
							echo "<td><a href='index_details.php?oid=".$row['OrderId']."&sid2=".$sid2."'><button class='btn btn-warning btn-sm'>View Order</button></a></td>";
							
							echo "</tr>";
							
					 }
					 ?>
   
   
   
   

    </tbody>
    </table>
    </div>
    </div>
    </div>
    <!--/span-->

    </div><!--/ro-->

	




<div class="row">
     <div class="box-inner">
    <div class="box-header well" data-original-title="">
        <h2>Details		
		</h2>
</div>
        
    
    <div class="box-content">
   
    <table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
    <thead>
    <tr>
						<tr>
                            <th>Αριθμός Παραγγελίας</th>
                           
							 <th>Είδος</th>
							 <th>Περιγραφή</th>
							 <th>Ποσότητα (gr)</th>
							 <th>Συσκεύαστήριο</th>
							 <th>Lot</th>
							 <th>Ημερομηνία λήξης</th>
							 <th>Μονάδα</th>
							 <th>Box id</th>
							 <th>Παλλέτα</th>
                        </tr>
    </tr>
    </thead>
    <tbody>

    <?php
					
					
				    $query22 = "Select * from TRANSACTIONS where OrderId ='".$oid."'";
					//echo $query ;
					$result22 = mysqli_query($dbC,$query22) or die(mysqli_error());
					$y=0;
					 while($row22 = mysqli_fetch_array($result22)){
                            $y++;
							
                            echo "<tr onclick='get_details(".$row['OrderId'].", $(this).offset());'>";
                            echo "<td>".$row22['OrderId'] ." </td>";
							echo "<td>".$row22['ItemId']."</td>";
							echo "<td>".$row22['IteName']."</td>";
							echo "<td>".$row22['Qty']."</td>";
							echo "<td>".$row22['Sysk']."</td>";
							echo "<td>".$row22['Lot']."</td>";
							echo "<td>".$row22['DateLhj']."</td>";
							echo "<td>".$row22['Monad']."</td>";
							echo "<td>".$row22['BoxId']."</td>";
							echo "<td>".$row22['PalletId']."</td>";
							
						    echo "</tr>";
							
					 }
					 ?>
   
   
   
   

    </tbody>
    </table>
    </div>
    </div>
    </div>
    <!--/span-->

    </div><!--/ro-->



  

   

    
<?php require('footer.php'); ?>
