<?php
include('lib/db_connect.php');
include('lib/auth.php');
if(isset($_POST['submit']))
{
if ($_REQUEST['htshah_dt'] != '') {
$htshah_dt = date('Y-m-d', strtotime($_REQUEST['htshah_dt']));
}
if ($_REQUEST['edi_dt'] != '') {
$edi_dt = date('Y-m-d', strtotime($_REQUEST['edi_dt']));
}
if ($_REQUEST['thoka_dt'] != '') {
$thoka_dt = date('Y-m-d', strtotime($_REQUEST['thoka_dt']));
}
if ($_REQUEST['empty_doc_recd_dt'] != '') {
$empty_doc_recd_dt = date('Y-m-d', strtotime($_REQUEST['empty_doc_recd_dt']));
}
if ($_REQUEST['empty_despatch_dt'] != '') {
$empty_despatch_dt = date('Y-m-d', strtotime($_REQUEST['empty_despatch_dt']));
}
if ($_REQUEST['factory_stuffing_datetime'] != '') {
$factory_stuffing_datetime = date('Y-m-d', strtotime($_REQUEST['factory_stuffing_datetime']));
}
if ($_REQUEST['container_gate_in_datetime'] != '') {
$container_gate_in_datetime = date('Y-m-d', strtotime($_REQUEST['container_gate_in_datetime']));
}
if ($_REQUEST['cutoff_cont_no'] != '') {
$cutoff_cont_no = date('Y-m-d', strtotime($_REQUEST['cutoff_cont_no']));
}
if ($_REQUEST['carting'] != '') {
$carting = date('Y-m-d', strtotime($_REQUEST['carting']));
}
if ($_REQUEST['exam'] != '') {
$exam = date('Y-m-d', strtotime($_REQUEST['exam']));
}
if ($_REQUEST['stuffing'] != '') {
$stuffing = date('Y-m-d', strtotime($_REQUEST['stuffing']));
}
if ($_REQUEST['handover_of_sb'] != '') {
$handover_of_sb = date('Y-m-d', strtotime($_REQUEST['handover_of_sb']));
}
if ($_REQUEST['sailing'] != '') {
$sailing = date('Y-m-d', strtotime($_REQUEST['sailing']));
}
if ($_REQUEST['shipping_bill_release_dt'] != '') {
$shipping_bill_release_dt = date('Y-m-d', strtotime($_REQUEST['shipping_bill_release_dt']));
}
if ($_REQUEST['frtChqRequestedDate'] != '') {
$frtChqRequestedDate = date('Y-m-d', strtotime($_REQUEST['frtChqRequestedDate']));
}
if ($_REQUEST['frtChqRecievedDate'] != '') {
$frtChqRecievedDate = date('Y-m-d', strtotime($_REQUEST['frtChqRecievedDate']));
}
if ($_REQUEST['acdDeclFiled_dt'] != '') {
$acdDeclFiled_dt = date('Y-m-d', strtotime($_REQUEST['acdDeclFiled_dt']));
}
$CREATED_DT = date('Y-m-d h:i:s');
$aselquery = "select * from `tabl_exportentry` where htshah_no = '".$_REQUEST['htshah_no']."'";
$aquery_fetch = mysqli_query($con,$aselquery) or die(mysqli_error($con));
$afetchrows = mysqli_fetch_array($aquery_fetch);
if(mysqli_num_rows($aquery_fetch)=="0")
{
$insert="insert into `tabl_exportentry` set client_id='".$_REQUEST['client_id']."',htshah_no='".$_REQUEST['htshah_no']."',htshah_dt='".$htshah_dt."',htshah_no_Col='".$_REQUEST['htshah_no_Col']."',edi_no='".$_REQUEST['edi_no']."',edi_dt='".$edi_dt."',thoka_no='".$_REQUEST['thoka_no']."',thoka_dt='".$thoka_dt."',supplier='".$_REQUEST['supplier']."',supplier_col='".$_REQUEST['supplier_col']."',pkgs='".$_REQUEST['pkgs']."',pkgs_col='".$_REQUEST['pkgs_col']."',invoice='".$_REQUEST['invoice']."',frt_amt='".$_REQUEST['frt_amt']."',vessel='".$_REQUEST['vessel']."',vessel_col='".$_REQUEST['vessel_col']."',empty_doc_recd_dt='".$empty_doc_recd_dt."',empty_doc_recd_dt_col='".$_REQUEST['empty_doc_recd_dt_col']."',empty_despatch_dt='".$empty_despatch_dt."',factory_stuffing_datetime='".$factory_stuffing_datetime."',factory_stuffing_datetime_col='".$_REQUEST['factory_stuffing_datetime_col']."',container_gate_in_datetime='".$container_gate_in_datetime."',cutoff_cont_no='".$cutoff_cont_no."',cutoff_cont_no_col='".$_REQUEST['cutoff_cont_no_col']."',carting='".$carting."',carting_col='".$_REQUEST['carting_col']."',exam='".$exam."',exam_col='".$_REQUEST['exam_col']."',stuffing='".$stuffing."',stuffing_col='".$_REQUEST['stuffing_col']."',handover_of_sb='".$handover_of_sb."',handover_of_sb_col='".$_REQUEST['handover_of_sb_col']."',sailing='".$sailing."',sailing_col='".$_REQUEST['sailing_col']."',shipping_bill_release_dt='".$shipping_bill_release_dt."',shipping_bill_release_dt_col='".$_REQUEST['shipping_bill_release_dt_col']."',inspection_report='".$_REQUEST['inspection_report']."',billOfLading='".$_REQUEST['billOfLading']."',leo='".$_REQUEST['leo']."',frtChqRequestedDate='".$frtChqRequestedDate."',frtChqRecievedDate='".$frtChqRecievedDate."',acdDeclFiled_dt='".$acdDeclFiled_dt."',acdDeclFiled_dt_col='".$_REQUEST['acdDeclFiled_dt_col']."',etaOfVessel='".$_REQUEST['etaOfVessel']."',remark='".$_REQUEST['remark']."',remark_Col='".$_REQUEST['remark_Col']."',CREATED_BY='".$_SESSION["name"]."',CREATED_DT='".$CREATED_DT."',DELFLAG='N'";
$query=mysqli_query($con,$insert) or die(mysqli_error($con));
echo "<script>alert('Export Entry Added Successfully')</script>";
}
else
{
echo "<script>alert('Sorry! Record is not inserted. Duplicate Job No Found...')</script>";
}
// header('Location: viewexports.php');
echo "<script>window.location.href='viewexports.php';</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
<title>HT Shah</title>
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="assets/css/plugins.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("header.php"); ?>
<!-- BEGIN NAVBAR -->
<div class="sub-header-container">
<header class="header navbar navbar-expand-sm">
<a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></a>
<ul class="navbar-nav flex-row">
<li>
<div class="page-header">
<nav class="breadcrumb-one" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">Consignments</a></li>
<li class="breadcrumb-item active" aria-current="page"><span>Add New Export Entry</span></li>
</ol>
</nav>
</div>
</li>
</ul>
</header>
</div>
<!-- END NAVBAR -->
<!-- BEGIN MAIN CONTAINER -->
<div class="main-container" id="container">
<?php include("sidebar-wrapper.php"); ?>
<!-- BEGIN CONTENT AREA -->
<div id="content" class="main-content">
<div class="container">
<div class="row">
<div id="flFormsGrid" class="col-lg-12 layout-spacing layout-top-spacing">
<div class="statbox widget box box-shadow">
<div class="widget-header">
<div class="row">
<div class="col-xl-12 col-md-12 col-sm-12 col-12">
<h4>Add New Export Entry</h4>
</div>
</div>
</div>
<div class="widget-content widget-content-area">
<form id="comp_form" method="post">
<div class="table-responsive">
<table id="example" class="table dataTable" style="width: 100%;" role="grid" aria-describedby="example_info">
<tbody><tr>
<td>
Select Client:<span class="mandatory">*</span>
</td>
<td width="500">
<select name="client_id" id="client_id" class="form-control">
<option value="-1">-- Select --</option>
<?php
$seld = "select * from `tabl_client` order by userName asc";
$qryd = mysqli_query($con, $seld);
while ($rsd = mysqli_fetch_array($qryd)) {
?>
<option value="<?php echo $rsd['id'] ?>"><?php echo $rsd['userName'] ?></option>
<?php
}
?>
</select>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
HTSHAH Job Number:<span class="mandatory">*</span>
</td>
<td>
<input type="text" name="htshah_no" maxlength="5" size="10" value="" class="form-control">
</td>
<td>
<input type="date" name="htshah_dt" size="10" id="htshah_dt" class="form-control">
</td>
<td>
<input type="checkbox" name="htshah_no_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
EDI Job Number:
</td>
<td>
<input type="text" name="edi_no" maxlength="4" size="10" value="" class="form-control">
</td>
<td>
<input type="date" name="edi_dt" size="10" id="edi_dt" class="form-control">
</td>
<td></td>
</tr>
<tr>
<td>
Shipping bill number:
</td>
<td>
<input type="text" name="thoka_no" maxlength="10" size="10" value="" class="form-control">
</td>
<td>
<input type="date" name="thoka_dt" size="10" id="thoka_dt" class="form-control">
</td>
<td></td>
</tr>
<tr>
<td>
Supplier:
</td>
<td>
<input type="text" name="supplier" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="supplier_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Packages:
</td>
<td>
<input type="text" name="pkgs" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="pkgs_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Invoice Number:
</td>
<td>
<input type="text" name="invoice" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Freight Amount:
</td>
<td>
<input type="text" name="frt_amt" maxlength="20" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Shipping Co. and Container No.:
</td>
<td>
<input type="text" name="vessel" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="vessel_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Empty D.o Recieved Date:
</td>
<td>
<input type="date" name="empty_doc_recd_dt" size="10" id="empty_doc_recd_dt" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="empty_doc_recd_dt_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Empty Dispatch Date:
</td>
<td>
<input type="date" name="empty_despatch_dt" size="10" id="empty_despatch_dt" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Factory Stuffing Date:
</td>
<td>
<input type="date" name="factory_stuffing_datetime" size="10" id="factory_stuffing_datetime" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="factory_stuffing_datetime_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Container gate in Date:
</td>
<td>
<input type="date" name="container_gate_in_datetime" size="10" id="container_gate_in_datetime" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Cut off Date:
</td>
<td>
<input type="date" name="cutoff_cont_no" size="10" id="cutoff_cont_no" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="cutoff_cont_no_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Carting:
</td>
<td>
<input type="date" name="carting" size="10" id="carting" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="carting_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Exam:
</td>
<td>
<input type="date" name="exam" size="10" id="exam" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="exam_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Stuffing:
</td>
<td>
<input type="date" name="stuffing" size="10" id="stuffing" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="stuffing_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Handover of S/Bill
</td>
<td>
<input type="date" name="handover_of_sb" size="10" id="handover_of_sb" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="handover_of_sb_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Sailing:
</td>
<td>
<input type="date" name="sailing" size="10" id="sailing" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="sailing_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Shipping Bill Release Date:
</td>
<td>
<input type="date" name="shipping_bill_release_dt" size="10" id="shipping_bill_release_dt" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="shipping_bill_release_dt_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
Inspection Report:
</td>
<td>
<input type="text" name="inspection_report" maxlength="200" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Bill of Lading Number & Date:
</td>
<td>
<input type="text" name="billOfLading" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Leo Number & Date:
</td>
<td>
<input type="text" name="leo" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Frt. Cheque Requested Date:
</td>
<td>
<input type="date" name="frtChqRequestedDate" size="10" id="frtChqRequestedDate" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Frt. Cheque Recieved Date:
</td>
<td>
<input type="date" name="frtChqRecievedDate" size="10" id="frtChqRecievedDate" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
ETD required by client:
</td>
<td>
<input type="date" name="acdDeclFiled_dt" size="10" id="acdDeclFiled_dt" class="form-control">
</td>
<td></td>
<td>
<input type="checkbox" name="acdDeclFiled_dt_col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td>
ETA of vessel at destination:
</td>
<td>
<input type="text" name="etaOfVessel" maxlength="50" size="20" value="" class="form-control">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
Direct vessel required:
</td>
<td>
<textarea name="remark" cols="50" rows="3" onKeyPress="return IsAlphaNumeric(event);" class="form-control"></textarea>
</td>
<td></td>
<td>
<input type="checkbox" name="remark_Col" value="#FFFF99"> Color
</td>
</tr>
<tr>
<td colspan="4">
<input name="submit" type="submit" class="btn btn-primary" value="Save">
<a href="viewexports.php"><button type="button" class="btn btn-danger ml-2">Cancel</button></a>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include("footer.php"); ?>
</div>
<!-- END CONTENT AREA -->
</div>
<!-- END MAIN CONTAINER -->
<!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
<script src="assets/js/libs/jquery-3.1.1.min.js"></script>
<script src="bootstrap/js/popper.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<script src="assets/js/app.js"></script>
<script>
$(document).ready(function() {
App.init();
});
</script>
<script src="assets/js/custom.js"></script>
</body>
</html>