<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

mysqli_query($conn, "SET NAMES 'utf8'");
mysqli_query($conn, 'SET CHARACTER SET utf8');

ini_set('display_errors', 1);
error_reporting(E_ERROR);

$usertype = $_SESSION["usertype_" . $dbname];

$maindb = 'shipment';
$trandb = 'shiptran';

$file = 'deststockrep.php';
$keyfld = "vouchno";

$keycond = "";

$zroot = $_SESSION["zdir"];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);

$destination = $_REQUEST["destination"];

if ($destination != "") {
    ?>

    <div class="row gy-3 bg-row">
        <div class="col-lg-2 col-md-4">
            <select class="form-control sfield">
                <option value="1">Booking</option>
                <option value="2">Customer</option>
                <option value="3">Supplier</option>
                <option value="4">Marka</option>
                <option value="5">Container No.</option>
                <option value="6">Sailing Date</option>
                <option value="7">Destination</option>
                <option value="8">Estimate Date</option>
                <option value="9">Delivery Date</option>
            </select>
        </div>

        <div class="col-lg-2 col-md-4">
            <select class="form-control soperator">
                <option value="">Type of Search</option>
                <option value="%">Like</option>
                <option value="=">Exactly</option>
            </select>
        </div>

        <div class="col-lg-3 col-md-6">
            <input type="text" class="form-control ssearch" placeholder="Search Here" style="background-color: #ffffff;border-radius: 4px;">
        </div>

        <div class="col-lg-1 col-md-2">
            <input type="button" class="btn btn-primary searchBtn sload" value="Search">
        </div>

        <div class="col-lg-2 col-md-4">
            <select class="form-control sortBy">
                <option value="">Sort By</option>
                <option value="1">Booking</option>
                <option value="2">Customer</option>
                <option value="3">Supplier</option>
                <option value="4">Marka</option>
                <option value="5">Container No.</option>
                <option value="6">Sailing Date</option>
                <option value="7">Destination</option>
                <option value="8">Estimate Date</option>
                <option value="9">Delivery Date</option>
            </select>
        </div>

        <div class="col-lg-2 col-md-4">
            <select class="form-control orderAs">
                <option value="asc">Asc</option>
                <option value="desc">Desc</option>
            </select>
        </div>
    </div>

    <div class="col-lg-12 sloader text-center mt-3"></div>
    <div class="col-lg-12 snoRecord text-center mt-2">
        <h5 class="text-danger">NO RECORDS FOUND</h5>
    </div>
    
    <div class="table-responsive ssload mt-4" style="overflow-y: scroll;height:100%;overflow-x: scroll">
        <table class="table table-striped table-bordered table-hover mb-0" width="200%">
            <thead class="table-light position-sticky top-0 z-1">
                <tr class="mySearchTr">
                
                    <th style="width:5%;">Voucher</th>
                    <th style="width:6%;">Booking</th>
                    <th style="width:14%;">Customer</th>
                    <th style="width:6%;">No. of Cartons</th>
                    <th style="width:14%;">Supplier</th>
                    <th style="width:14%;">Garment Description</th>
                    <th style="width:6%;">Pcs</th>
                    <th style="width:6%;">Unit</th>
                    <th style="width:6%;">Marka</th>
                    <th style="width:6%;">Total CBM</th>
                    <th style="width:6%;">Weight</th>
                    <th style="width:10%;">Container No.</th>
                    <th style="width:6%;">Sailing Date</th>
                    <th style="width:6%;">Origin</th>
                    <th style="width:6%;">Estimate Date</th>
                    <th style="width:6%;">Delivery Date</th>
                    <th style="width:6%;">Mobile</th>
                </tr>
            </thead>

            <tbody class="sTbody">
                <!-- Dynamically loaded data here -->
            </tbody>
        </table>
    </div>


<?php } ?>