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

<div class="row">
<?php require("connect.php"); ?>
<style>
td.sorting_1{
    cursor:pointer;
}
</style> 
<script>

    function get_details(id,pos){
        $.ajax({
            url:'cust_details.php',
            type:'POST',
            data: {cusid: id},
            dataType:'html',
            success: function(response){
                $('#view_content').html(response);
                $('#view_info').draggable();
                $('#view_info').css({'top': pos.top})
                $('#view_info').show();
            }
        });
    }

    

    function close_window(){
        $('#view_info').hide();
    }
</script>
 
     


   

                    
                </div>
                <div class="box-content">
				<!--<table class="table table-striped table-bordered  datatable responsive">-->
                <table class="table table-striped table-bordered bootstrap-datatable datatable dataTable">
                        <thead>
                        <tr>
                            
							<!--<th>Id</th>-->
							<th>Αριθμός Παραγγελίας</th>														
							<th>Ημερομηνία</th>
							<th>Όνομα πελάτη</th>
							<th>Παράδοση</th>
							<th>Προορισμός</th>
							<th>Κιβώτια</th>
							<th>Κιλά</th>
							<th>Actions</th>
                            
                           
                        </tr>
                        </thead>
						<tbody>
						
						<?php
					//echo $_SESSION['sid2'];
					$sid2 = $_SESSION['sid2'];
					if ($_SESSION['sid2'] ==1 ){$query = "Select * from RECEIVERS";}
					else { $query = "Select * from RECEIVERS where UserCode ='".$sid2."'";}
					//echo $query ;
					$result = mysqli_query($dbC,$query) or die(mysqli_error());
					$y=0;
					 while($row = mysqli_fetch_array($result)){
                            $y++;
							
                            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></td>";
						    echo "</tr>";
							
					 }
					 ?>
                        </tr></tbody>
					  </table>
                        
                 
                </div>
            </div>
        </div>
    </div><!--/span-->

</div><!--/row-->


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