<?php
include_once 'includes/processes.php';
$Process = new Login_Process;
$pageLink = basename($_SERVER['REQUEST_URI']);
$Process->check_status($pageLink);
$checkRequests = $Process->stationUnAcknowledgedRequests($_SESSION['station_id']);
?>

  
  
  
	<div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3 class="modal-title"><i class="fa fa-ticket"></i> New Requisition</h3>
    </div>
	  <form action="requisition.php" method="post">
	  <input type="hidden" name="request_scope" value="Station" />
		<div class="modal-body">
			<div class="row">
			<?php if($checkRequests==1): ?>
				<div class="col-sm-12">
					<div style="padding:5px;margin:5px;" class="alert alert-info"><i class="fa fa-warning"></i> <strong>Information:</strong> Leave item boxes empty if you don't want to add item</div>
				</div> <!-- /.col -->
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="item_desc">Baggage Tag</label>
						<select name="item_id[]" class="form-control select2-input" data-required="true">
							<option value="1">Baggage Tag</option>
						</select>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="item_qty">Item quantity</label>
						<input type="number" id="item_qty" name="item_qty[]" min="1" class="form-control">
					</div>				
				</div>
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="item_desc">Boarding Pass</label>
						<select name="item_id[]" class="form-control select2-input" data-required="true">
						<option value="2">Boarding Pass</option>
						</select>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="item_qty">Item quantity</label>
						<input type="number" id="item_qty" name="item_qty[]" min="1" class="form-control">
					</div>				
				</div>
				
				<div id="dynamicInputs"></div>
				
				<div class="col-sm-12">
					<div class="form-group col-sm-12">
						<label for="item_remark">Remarks</label>
						<textarea name="item_remark" class="form-control"></textarea>
					</div>				
				</div>
				<?php else: ?>	
					<div class="col-sm-12">
						<div style="padding:5px;margin:5px;" class="alert alert-info"><i class="fa fa-warning"></i> <strong>Alert:</strong> New Request not allowed. This could be because a previous request is being processed or waiting for acknowledgement from your station. Pleas check.</div>
					</div> <!-- /.col -->
				<?php endif; ?>
			</div>			
		</div>
		<div class="modal-footer">
			<?php if($checkRequests==1): ?>
				<!--<button type="button" class="btn btn-xs btn-info" onclick="addItem('dynamicInputs');"><i class="fa fa-plus"></i> Add Item</button>-->
				<button type="submit" name="request" class="btn btn-xs btn-success pull-left"><i class="fa fa-check"></i> Make Request</button>
			<?php endif; ?>
			<button type="button" class="btn btn-xs btn-danger" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
		</div>
	  </form>
    </div><!-- /.modal-content -->