<style>
th,td {
  vertical-align: middle !important;
  font-size: 11px !important;
}

th.dt-body-center,
	td.dt-body-center {
  text-align: center !important;
  vertical-align: middle !important;
}
.submit{
	display:inline !important;
}
.table-scrollable .dataTable td>.btn-group, .table-scrollable .dataTable th>.btn-group {
  position: absolute;
  margin-top: -10px;
}

.dataTables_empty {
  text-align: center !important;
}

.dropdown-menu {
  min-width: 10px !important;
}
</style>
<div class="row">
	<div class="col-md-12">
		<div class="portlet box blue-hoki">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-cogs"></i><strong>Departure Warehouse Receive Note</strong> 
				</div>
				<div class="actions">				
					<a class="btn white btn-circle btn-outline pull-right" href="#form_add" data-toggle="modal"> 
					Add New <i class="fa fa-plus"></i> 
					</a>					
				</div>
			</div>
			<div class="portlet-body">
				
				<table class="table table-striped table-bordered table-hover" id="warehouse-arrangements">
					<thead>
						<tr role="row" class="heading">
							<th>Receive <br/> Date</th>
							<th>Warehouse <br/>Name</th>
							<th>Warehouse Receive <br/> Note No</th>
							<th>Marking No</th>
							<th>Transporter <br/> Company Name</th>
							<th>Consignment <br/> Note</th>
							<th>Total <br/> CTN</th>
							<th>Total <br/> CBM</th>
							<th>Total <br/> Weight</th>
							<th>Status</th>
							<th style="padding-right: 30px;">Actions</th>
						</tr>
					</thead>
				</table>
			</div>
		</div>
	</div>
</div>
<div class="modal fade modal-scroll in" id="form_decision_request" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">Decision Request</h4>
			</div>
			<form class="form-horizontal" id="decision_request">
				<div class="modal-body form">
					<div class="row">
						
							<div class="form-body" style="padding-top: 10px;padding-bottom: 10px;">
								<div class="form-group">
									<label class="control-label col-md-3">Title</label>
									<div class="col-md-9">
										<p class="form-control-static" id="decision_request_title">Unmatched Quantity</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">Instruction</label>
									<div class="col-md-9">
										<textarea class="form-control" rows="4" id="instruction" name="instruction">Warehouse will return back the goods if there is no reply from importer. Warehouse wouldn't take any responsibility of any cost caused.</textarea>
									</div>
								</div>
							</div>
						
					</div>
				</div>
				<div class="modal-footer">
					<div class="row pull-right">
						<div class="col-md-12">
							<a class="btn green submit"> Finish!</a>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<div class="modal fade modal-scroll in" id="form_decision_reject" role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">Decision Reject</h4>
			</div>
			<form class="form-horizontal" id="decision_reject">
				<div class="modal-body form">
					<div class="row">
						
							<div class="form-body" style="padding-top: 10px;padding-bottom: 10px;">
								<div class="form-group">
									<label class="control-label col-md-3">Title</label>
									<div class="col-md-9">
										<p class="form-control-static">Unmatched Quantity</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">Reason</label>
									<div class="col-md-9">
										<textarea class="form-control" rows="4" id="reason" name="reason"></textarea>
									</div>
								</div>
							</div>
						
					</div>
				</div>
				<div class="modal-footer">
					<div class="row pull-right">
						<div class="col-md-12">
							<a class="btn green submit"> Finish!</a>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<div class="modal fade modal-scroll bs-modal-lg  in" id="form_add" role="basic" aria-hidden="true">
	<div class="modal-dialog  modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">Departure Warehouse Receive Note</h4>
			</div>
			<div class="modal-body form"  id="form_wizard_1">
			<?php if($_SESSION['company_id'] <> 0 && getAllSOWithoutWarehouseCount() >0){ ?>
				<div class="row">
					<form class="form-horizontal" id="submit_form" enctype="multipart/form-data">
						<div class="form-wizard">
							<div class="form-body" style="padding-top: 10px;padding-bottom: 10px;">
								<ul class="nav nav-pills nav-justified steps" style="padding-top: 0px;padding-bottom: 0px;">
									<li>
										<a href="#ttab1" data-toggle="tab" class="step">
										<span class="number"> 1 </span>
										<span class="desc">
										<i class="fa fa-check"></i> Warehouse Receive Note Form </span>
										</a>
									</li>
									<li>
										<a href="#ttab2" data-toggle="tab" class="step">
										<span class="number"> 2 </span>
										<span class="desc">
										<i class="fa fa-check"></i> Warehouse Receive Note Details </span>
										</a>
									</li>
								</ul>
								<div id="bar" class="progress progress-striped" role="progressbar" style="margin-bottom:10px">
									<div class="progress-bar progress-bar-success"> </div>
								</div>
								<div class="tab-content">
									<div class="tab-pane active" id="ttab1">
										<h3 class="block">Departure Warehouse Received Note</h3>
										<div class="row" style="margin-top: 15px;margin-bottom: 15px;">
											<div class="col-md-12" >
												<div class="col-md-12" style="height: auto;padding-top:15px;">
													<div class="form-group">
														<label class="control-label col-md-3">Order No</label>
														<div class="col-md-7">
															<select name="so_id" id="so_id" class="form-control" required>
																<option value="">Please select</option>
																<?php echo getAllSOWithoutWarehouse(); ?>
															</select>
														</div>
													</div>
													<div class="form-group">
														<label class="control-label col-md-3">Warehouse</label>
														<div class="col-md-7">
															<p class="form-control-static" id="warehouse"></p>
														</div>
													</div>
													<div class="form-group">
														<label class="control-label col-md-3">Receive Date</label>
														<div class="col-md-7">
															<input class="form-control date-picker" id="receive_on" name="receive_on" type="text" required value="<?php echo date("Y-m-d"); ?>">
														</div>
													</div>
												</div>
											</div>
										</div>
										<div class="row" style="margin-top: 15px;margin-bottom: 15px;">
											<div class="col-md-12">
												<div class="col-md-6" style="height: auto;padding-top:15px;">
													<div class="form-group">
														<label class="control-label col-md-4">Transport Company Name</label>
														<div class="col-md-8">
															<input class="form-control" id="transport_company_name" name="transport_company_name" type="text">
														</div>
													</div>
													<div class="form-group">
														<label class="control-label col-md-4">Consignment Note No</label>
														<div class="col-md-8">
															<input class="form-control" id="consignment_note_no" name="consignment_note_no" type="text">
														</div>
													</div>
												</div>
												<div class="col-md-6" style="height: auto; min-height:140px; padding-top:15px;">
													<div class="form-group">
														<label class="control-label col-md-4">Warehouse Receive Note No</label>
														<div class="col-md-8">
															<input class="form-control" id="warehouse_receive_note_no" name="warehouse_receive_note_no" type="text">
														</div>
													</div>
													<div class="form-group">
														<label class="control-label col-md-4">Receiving Person</label>
														<div class="col-md-8">
															<input class="form-control" id="receiving_person" name="receiving_person" type="text">
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="tab-pane" id="ttab2">
										<h3 class="block">Departure Warehouse Receive Note</h3>
										<div class="row">
											<div class="col-md-12">
												<div class="table-scrollable" style="max-width:900px; font-size:100px;">
													<table class="table table-striped table-bordered table-hover">
														<thead>
															<tr>
																<td>No</td>
																<td>Description</td>
																<td>Total Ctn (nominal)</td>
																<td>Total Ctn(actual)</td>
																<td>Measurement (nominal)</td>
																<td>Measurement (actual)</td>
																<td>Weight (nominal)</td>
																<td>Weight (actual)</td>
																<td>Balance</td>
																<td>Status</td>
																<td>Damage</td>
																<td>Photo</td>
															</tr>
														</thead>
														<tbody id="tbody">
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="form-actions">
									<div class="row pull-right">
										<div class="col-md-12">
											<a href="javascript:;" class="btn default button-previous">
											<i class="fa fa-angle-left"></i> Back </a>
											<a href="javascript:;" class="btn btn-outline green button-next"> Continue
											<i class="fa fa-angle-right"></i>
											</a>
											<a class="btn red button-decision-reject" style="display: none;" id="reject"> Reject</a>
											<a class="btn green button-decision-request" style="display: none;" id="decision-request"> Decision Request</a>
											<a class="btn green button-submit" id="finish"> Finish!</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
				
				<?php }elseif ($_SESSION['company_id'] <> 0 && getAllSOWithoutWarehouseCount() == 0){ ?>
				<center style="margin-top:70px;margin-bottom: 70px">
					There is no order created to your company. Please ask your importer to create an order to your company.
				</center>
				<? }else{ ?>
					<center style="margin-top:70px;margin-bottom: 70px">
						Please complete your <strong><a href="/company/edit">Company Information</a></strong> to proceed.
					</center>
				<?php } ?>
			</div>
		</div>
	</div>
</div>