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

$formname = "Container ETA Register";
$action = "shipperreg_fr.php";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];

$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');

$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
<script src="MyScript/item.js" type="text/javascript"></script>
<script>
    $(document).ready(function (){
    
    $('#subpdf').hide();
    
    });

</script>
</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div>
            <div class="col-lg-5 col-md-12 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php Echo $formname; ?></h3>
                        <div class="actions pull-right">
                            <i class="fa fa-chevron-down"></i>
                            <i class="fa fa-times"></i>
                        </div>
                    </div>
                    <div class="panel-body">
                       <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Shipper</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class='name form-control select2' name='name' style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $mown1 = mysqli_query($conn, "SELECT * FROM `accmast` WHERE `grpcode`='040'") or die(mysqli_error($conn));
                                    while ($trow1 = mysqli_fetch_array($mown1)) {
                                        echo "<option value='$trow1[accode]'>$trow1[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>                                        
                       <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Container</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class='container form-control select2' name='container' style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $getcont = mysqli_query($conn, "SELECT * FROM `shipmain`") or die(mysqli_error($conn));
                                    while ($fetcont = mysqli_fetch_array($getcont)) {
                                        echo "<option value='$fetcont[container]'>$fetcont[container]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                       <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Line</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class='line form-control select2' name='line' style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $getline = mysqli_query($conn, "SELECT * FROM `shipmain`") or die(mysqli_error($conn));
                                    while ($fetline = mysqli_fetch_array($getline)) {
                                        echo "<option value='$fetline[live]'>$fetline[live]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                       <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Status</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class='status form-control select2' name='status' style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $getstatus = mysqli_query($conn, "SELECT * FROM `shipmain`") or die(mysqli_error($conn));
                                    while ($fetstatus = mysqli_fetch_array($getstatus)) {
                                        echo "<option value='$fetstatus[status]'>$fetstatus[status]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">From Date</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="date" id="mfrdt" name="frmdt" class="form-control frmdt" value="<?php Echo $mfrdate; ?>" /> 
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">To Date</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="date" id="todt" name="todt" class="form-control todt" value="<?php Echo $mtodate; ?>" /> 
                            </div>
                        </div>
                         <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Scope</label>
                            </div>
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 pad">
                                <select name="scope" class="form-control select2">
                                    <option value="">All</option>
                                    <option value="1">Non-Release</option>
                                    <option value="2">Release</option>
                                </select>
                            </div>
                        </div> 
                                          
                    </div>
                    <div class="panel-footer">
                        <div class="text-center pad">
                            <div class="panel-footer">
                                <?php include("includes/but_rep.php"); ?>
                            </div>   
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
