<style>
.small-label {
    font-size: 15px;
}
</style>
<!----------------------------------- Cloning end for Accreditation  --------------------------------------------->

        <section class="content">
			<!-- general form elements -->
                <form class="" method="post" name="LogisticsForm" id="LogisticsForm" action="index?page=view_quotation_progress&action=insert_logistics" onsubmit="return validateForm(this)" enctype="multipart/form-data">
					     <div class="row">
							<div class="col-6">
								<div>
						            <label class="control-label p-2" for="Company Name">Separate Logistics QAF?</label>
				                      <?= $gsi->getYesNo("logistics", "$logistics", "100%", false, "form-control"); ?>
								</div>
						    </div>
						 </div>
						 <div class="row mt-2">
							<div class="col-2">
								<div>
						            <label class="control-label p-2" for="Company Name">Transport:</label>
								</div>
						    </div>
							<div class="col-3">
								<div>
								  <input type="text" class="form-control" id="transport" name="transport" value="<?=$row_log['transport']?>" placeholder="Transport" autocomplete="off" oninput="this.value=this.value.toUpperCase();"> 
								</div>
						    </div>
							<div class="col-1">
								<div>
						            <input type="number" class="form-control" id="pcost" name="pcost" value="<?=$row_log['pcost']?>" placeholder="Cost" autocomplete="off" step="0.01">  
								</div>
						    </div>
						 </div>
						 <div class="row mt-2">
							<div class="col-2">
								<div>
						            <label class="control-label p-2" for="Company Name">Packaging:</label>

								</div>
						    </div>
							<div class="col-3">
								<div>
								  <input type="text" class="form-control" id="packaging" name="packaging" value="<?=$row_log['packaging']?>" placeholder="Packaging" autocomplete="off" oninput="this.value=this.value.toUpperCase();">  
								</div>
						    </div>
							<div class="col-1">
								<div>
						            <input type="number" class="form-control" id="pacost" name="pacost" value="<?=$row_log['pacost']?>" placeholder="Cost" autocomplete="off" step="0.01">  
								</div>
						    </div>
						 </div>
						 <div class="row mt-2">
							<div class="col-2">
								<div>
						            <label class="control-label p-2" for="Company Name">Pallet Amortisation:</label>

								</div>
						    </div>
							<div class="col-3">
								<div>
								  <input type="text" class="form-control" id="pallet" name="pallet" value="<?=$row_log['pallet']?>" placeholder="Pallet Amortisation" autocomplete="off"oninput="this.value=this.value.toUpperCase();"> 
								</div>
						    </div>
							<div class="col-1">
								<div>
						            <input type="number" class="form-control" id="palcost" name="palcost" value="<?=$row_log['palcost']?>" placeholder="Cost" autocomplete="off" step="0.01">  
								</div>
						    </div>
						 </div>
						 <div class="row mt-2">
							<div class="col-2">
								<div>
						            <label class="control-label p-2" for="Other">Other:</label>

								</div>
						    </div>
							<div class="col-3">
								<div>
								  <input type="text" class="form-control" id="other" name="other" value="<?=$row_log['other']?>" placeholder="Other" autocomplete="off" oninput="this.value=this.value.toUpperCase();">  
								</div>
						    </div>
							<div class="col-1">
								<div>
						            <input type="number" class="form-control" id="othcost" name="othcost" value="<?=$row_log['othcost']?>" placeholder="Cost" autocomplete="off" step="0.01">  
								</div>
						    </div>
						 </div>
						  <div class="card-footer">
							<input type="hidden" id="id" name="id" value="<?php echo $id;?>">
							<input type="hidden" id="quot_id" name="quot_id" value="<?php echo $_REQUEST['id'];?>">
							<input type="hidden" id="from" name="from" value="<?php echo $from;?>">
							<input type="hidden" id="query_string" name="query_string" value="<?php echo $query_string;?>">
							<input type="hidden" id="section_status_logistics" name="section_status_logistics" value="">
							<button type="button" id="submit_incomplete" class="btn btn-danger" onclick="submitFormLogstStatus(1,'spinner_logistic_incomplete')">
								Save Incomplete
								<i class="fas fa-sync-alt fa-spin" style="display:none;" id="spinner_logistic_incomplete"></i>
							</button>
							<button type="button" id="submit_completed" class="btn btn-success" onclick="submitFormLogstStatus(2,'spinner_logistic_completed')">
								Section Completed
								<i class="fas fa-sync-alt fa-spin" style="display:none;" id="spinner_logistic_completed"></i>
							</button>
							<div style="float:right;">
								<button type="button" id="prevButton" class="btn btn-secondary" onclick="ToPrevTab()">Previous</button>
								<button type="button" id="nextButton" class="btn btn-secondary" onclick="ToNextTab()">Next</button>

						   </div>
						  </div>
                </form>
</section>
<script type="text/javascript">

	function submitFormLogstStatus(status, spinnerId) {
    document.getElementById('section_status_logistics').value = status;

    document.querySelectorAll('.fa-spin').forEach(function(spinner) {
        spinner.style.display = 'none';
    });
    document.getElementById(spinnerId).style.display = 'inline-block';
    document.getElementById('LogisticsForm').submit();
}
	
</script>