<?php
include_once 'includes/processes.php';
$Process = new Login_Process;
$pageLink = basename($_SERVER['REQUEST_URI']);
$Process->check_status($pageLink);
$stopgapData = $Process->getStopgapInfo($_GET['stopgap_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> Edit Stopgap</h3>
    </div>
	  <form action="stopgap.php" method="post">
	  <input type="hidden" name="stopgap_id" value="<?php echo $stopgapData->stopgap_id;  ?>" />
		<div class="modal-body">
			<div class="row">
			
				<div class="col-sm-12">
					<div class="form-group col-sm-12">
						<label for="stopgap_user">Stopgap User.</label>
						<input type="text" id="stopgap_user" name="stopgap_user" value="<?php echo $stopgapData->stopgap_user;  ?>" class="form-control" required>
					</div>				
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="designation">User Designation</label>
						<input type="text" id="designation" name="designation" value="<?php echo $stopgapData->designation;  ?>" class="form-control" required>
					</div>				
				</div>
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="user_location">Location</label>
							<select name="user_location" class="form-control select2-input" data-required="true">
							<option value=""></option>
							<option value="ABUJA AIRPORT" <?php if($stopgapData->user_location=="ABUJA AIRPORT"){echo "selected";}  ?>>ABUJA AIRPORT</option>
							<option value="Abuja Airport Line Maintenance" <?php if($stopgapData->user_location=="Abuja Airport Line Maintenance"){echo "selected";}  ?>>Abuja Airport Line Maintenance</option>
							<option value="Abuja Transcorp Hilton" <?php if($stopgapData->user_location=="Abuja Transcorp Hilton"){echo "selected";}  ?>>Abuja Transcorp Hilton</option>
							<option value="ASABA AIRPORT" <?php if($stopgapData->user_location=="ASABA AIRPORT"){echo "selected";}  ?>>ASABA AIRPORT</option>
							<option value="Benin Airport" <?php if($stopgapData->user_location=="Benin Airport"){echo "selected";}  ?>>Benin Airport</option>
							<option value="CALABAR AIRPORT" <?php if($stopgapData->user_location=="CALABAR AIRPORT"){echo "selected";}  ?>>CALABAR AIRPORT</option>
							<option value="CALABAR AIRPORT BOARDING GATE" <?php if($stopgapData->user_location=="CALABAR AIRPORT BOARDING GATE"){echo "selected";}  ?>>CALABAR AIRPORT BOARDING GATE</option>
							<option value="CALABAR AIRPORT COUNTER" <?php if($stopgapData->user_location=="CALABAR AIRPORT COUNTER"){echo "selected";}  ?>>CALABAR AIRPORT COUNTER</option>
							<option value="CALABAR AIRPORT OFFICE" <?php if($stopgapData->user_location=="CALABAR AIRPORT OFFICE"){echo "selected";}  ?>>CALABAR AIRPORT OFFICE</option>
							<option value="ENUGU AIRPORT" <?php if($stopgapData->user_location=="ENUGU AIRPORT"){echo "selected";}  ?>>ENUGU AIRPORT</option>
							<option value="ENUGU NEO COURT" <?php if($stopgapData->user_location=="ENUGU NEO COURT"){echo "selected";}  ?>>ENUGU NEO COURT</option>
							<option value="HQ" <?php if($stopgapData->user_location=="HQ"){echo "selected";}  ?>>HQ</option>
							<option value="KEBBI AIRPORT" <?php if($stopgapData->user_location=="KEBBI AIRPORT"){echo "selected";}  ?>>KEBBI AIRPORT</option>
							<option value="Lagos GAT 2nd Office" <?php if($stopgapData->user_location=="Lagos GAT 2nd Office"){echo "selected";}  ?>>Lagos GAT 2nd Office</option>
							<option value="Lagos GAT ARIK Terminal" <?php if($stopgapData->user_location=="Lagos GAT ARIK Terminal"){echo "selected";}  ?>>Lagos GAT ARIK Terminal</option>
							<option value="Lagos GAT Departure" <?php if($stopgapData->user_location=="Lagos GAT Departure"){echo "selected";}  ?>>Lagos GAT Departure</option>
							<option value="Lagos GAT Departure Checkin" <?php if($stopgapData->user_location=="Lagos GAT Departure Checkin"){echo "selected";}  ?>>Lagos GAT Departure Checkin</option>
							<option value="Lagos GAT Departure Sales" <?php if($stopgapData->user_location=="Lagos GAT Departure Sales"){echo "selected";}  ?>>Lagos GAT Departure Sales</option>
							<option value="Lagos GAT Gate" <?php if($stopgapData->user_location=="Lagos GAT Gate"){echo "selected";}  ?>>Lagos GAT Gate</option>
							<option value="Lagos GAT Line Maintenance Office" <?php if($stopgapData->user_location=="Lagos GAT Line Maintenance Office"){echo "selected";}  ?>>Lagos GAT Line Maintenance Office</option>
							<option value="Lagos GAT Line Maintenance Rooftop" <?php if($stopgapData->user_location=="Lagos GAT Line Maintenance Rooftop"){echo "selected";}  ?>>Lagos GAT Line Maintenance Rooftop</option>
							<option value="Lagos GAT Line Maintenance Technical Store" <?php if($stopgapData->user_location=="Lagos GAT Line Maintenance Technical Store"){echo "selected";}  ?>>Lagos GAT Line Maintenance Technical Store</option>
							<option value="Lagos GAT Office" <?php if($stopgapData->user_location=="Lagos GAT Office"){echo "selected";}  ?>>Lagos GAT Office</option>
							<option value="Lagos GAT Rooftop" <?php if($stopgapData->user_location=="Lagos GAT Rooftop"){echo "selected";}  ?>>Lagos GAT Rooftop</option>
							<option value="Lagos Minima Estate" <?php if($stopgapData->user_location=="Lagos Minima Estate"){echo "selected";}  ?>>Lagos Minima Estate</option>
							<option value="Lagos OCC" <?php if($stopgapData->user_location=="Lagos OCC"){echo "selected";}  ?>>Lagos OCC</option>
							<option value="Mobile" <?php if($stopgapData->user_location=="Mobile"){echo "selected";}  ?>>Mobile</option>
							<option value="OWERRI AIRPORT" <?php if($stopgapData->user_location=="OWERRI AIRPORT"){echo "selected";}  ?>>OWERRI AIRPORT</option>
							<option value="OWERRI TOWN OFFICE" <?php if($stopgapData->user_location=="OWERRI TOWN OFFICE"){echo "selected";}  ?>>OWERRI TOWN OFFICE</option>
							<option value="PORTHARCOURT AIRPORT" <?php if($stopgapData->user_location=="PORTHARCOURT AIRPORT"){echo "selected";}  ?>>PORTHARCOURT AIRPORT</option>
							<option value="Sobo Arobiodu Residence" <?php if($stopgapData->user_location=="Sobo Arobiodu Residence"){echo "selected";}  ?>>Sobo Arobiodu Residence</option>
							<option value="Abuja Silverbird Outlet" <?php if($stopgapData->user_location=="Abuja Silverbird Outlet"){echo "selected";}  ?>>Abuja Silverbird Outlet</option>
							<option value="UYO AIRPORT" <?php if($stopgapData->user_location=="UYO AIRPORT"){echo "selected";}  ?>>UYO AIRPORT</option>
							<option value="PORTHARCOURT TOWN OFFICE" <?php if($stopgapData->user_location=="PORTHARCOURT TOWN OFFICE"){echo "selected";}  ?>>PORTHARCOURT TOWN OFFICE</option>
							<option value="Uyo Town Office" <?php if($stopgapData->user_location=="Uyo Town Office"){echo "selected";}  ?>>Uyo Town Office</option>
							<option value="LEKKI PHASE 1 OFFICE" <?php if($stopgapData->user_location=="LEKKI PHASE 1 OFFICE"){echo "selected";}  ?>>LEKKI PHASE 1 OFFICE</option>
							<option value="Murtala Muhammed International Airport" <?php if($stopgapData->user_location=="Murtala Muhammed International Airport"){echo "selected";}  ?>>Murtala Muhammed International Airport</option>
							<option value="Kaduna GAT Departures" <?php if($stopgapData->user_location=="Kaduna GAT Departures"){echo "selected";}  ?>>Kaduna GAT Departures</option>
							<option value="Kaduna GAT Backoffice" <?php if($stopgapData->user_location=="Kaduna GAT Backoffice"){echo "selected";}  ?>>Kaduna GAT Backoffice</option>
							<option value="Kaduna GAT Dispatch" <?php if($stopgapData->user_location=="Kaduna GAT Dispatch"){echo "selected";}  ?>>Kaduna GAT Dispatch</option>
							<option value="Akure Airport" <?php if($stopgapData->user_location=="Akure Airport"){echo "selected";}  ?>>Akure Airport</option>
							<option value="Akure Shoprite office" <?php if($stopgapData->user_location=="Akure Shoprite office"){echo "selected";}  ?>>Akure Shoprite office</option>
							<option value="Dakar Region Senegal" <?php if($stopgapData->user_location=="Dakar Region Senegal"){echo "selected";}  ?>>Dakar Region Senegal</option>
							<option value="Kano Airport" <?php if($stopgapData->user_location=="Kano Airport"){echo "selected";}  ?>>Kano Airport</option>
							<option value="Yola Airport" <?php if($stopgapData->user_location=="Yola Airport"){echo "selected";}  ?>>Yola Airport</option>
							<option value="Kano Town Office" <?php if($stopgapData->user_location=="Kano Town Office"){echo "selected";}  ?>>Kano Town Office</option>
							<option value="Yola Town Office" <?php if($stopgapData->user_location=="Yola Town Office"){echo "selected";}  ?>>Yola Town Office</option>
							<option value="Freetown Region Sierra Leone" <?php if($stopgapData->user_location=="Freetown Region Sierra Leone"){echo "selected";}  ?>>Freetown Region Sierra Leone</option>
							<option value="Lagos International Airport" <?php if($stopgapData->user_location=="Lagos International Airport"){echo "selected";}  ?>>Lagos International Airport</option>
						</select>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="device_id">Device</label>
						<select name="device_id" class="form-control select2-input" data-required="true">
							<option value=""></option>
							<?php $Process->listDevice($stopgapData->device_id); ?>
						</select>
					</div>
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="brand_id">Brand</label>
						<select name="brand_id" class="form-control select2-input" data-required="true">
							<option value=""></option>
							<?php $Process->listBrand($stopgapData->brand_id); ?>
						</select>
					</div>
				</div>
				
				<div class="col-sm-12">
					<div class="form-group col-sm-12">
						<label for="model_product_no">Model / Product No.</label>
						<input type="text" id="model_product_no" name="model_product_no" value="<?php echo $stopgapData->model_product_no;  ?>" class="form-control" required>
					</div>				
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="stopgap_tag">Stopgap Tag</label>
						<select name="stopgap_tag" class="form-control select2-input" data-required="true">
						<option value=""></option>
						<option value="Serial Number" <?php if($stopgapData->stopgap_tag=="Serial Number"){echo "selected";}  ?>>Serial Number</option>
						<option value="Mobile Number" <?php if($stopgapData->stopgap_tag=="Mobile Number"){echo "selected";}  ?>>Mobile Number</option>
						<option value="Service Tag" <?php if($stopgapData->stopgap_tag=="Service Tag"){echo "selected";}  ?>>Service Tag</option>
						<option value="IMEI" <?php if($stopgapData->stopgap_tag=="IMEI"){echo "selected";}  ?>>IMEI</option>
						<option value="PRODUCT KEY" <?php if($stopgapData->stopgap_tag=="PRODUCT KEY"){echo "selected";}  ?>>PRODUCT KEY</option>
						<option value="Mac Address" <?php if($stopgapData->stopgap_tag=="Mac Address"){echo "selected";}  ?>>Mac Address</option>
						<option value="Account Number" <?php if($stopgapData->stopgap_tag=="Account Number"){echo "selected";}  ?>>Account Number</option>
						</select>
					</div>				
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="tag_no">Tagging No</label>
						<input type="text" id="tag_no" name="tag_no" value="<?php echo $stopgapData->tagging_no;  ?>" class="form-control" required>
					</div>				
				</div>
				
				
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="date_received">Date Returned</label>
						<input type="date" id="date_returned" name="date_returned" value="<?php echo $stopgapData->date_returned;  ?>" placeholder="dd/mm/yyyy" class="form-control" required>
					</div>				
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="date_given">Date Given</label>
						<input type="date" id="date_given" name="date_given" value="<?php echo $stopgapData->date_given;  ?>" placeholder="dd/mm/yyyy" class="form-control" required>
					</div>				
				</div>
				
				<div class="col-sm-6">
					<div class="form-group col-sm-12">
						<label for="stopgap_status">Status</label>
						<select name="stopgap_status" class="form-control select2-input" data-required="true">
							<option value=""></option>
							<option value="Active" <?php if($stopgapData->stopgap_status=="Active"){echo "selected";}  ?>>Active</option>
							<option value="Exited" <?php if($stopgapData->stopgap_status==""){echo "selected";}  ?>>Exited</option>
							<option value="On Leave" <?php if($stopgapData->stopgap_status=="On Leave"){echo "selected";}  ?>>On Leave</option>
							<option value="Out Of The Country Duties" <?php if($stopgapData->stopgap_status=="Out Of The Country Duties"){echo "selected";}  ?>>Out Of The Country Duties</option>
							<option value="Stolean/lost" <?php if($stopgapData->stopgap_status=="Stolean/lost"){echo "selected";}  ?>>Stolean/lost</option>
							<option value="Returned" <?php if($stopgapData->stopgap_status=="Returned"){echo "selected";}  ?>>Returned</option>
							<option value="Damaged" <?php if($stopgapData->stopgap_status=="Damaged"){echo "selected";}  ?>>Damaged</option>
							<option value="Re-Allocation" <?php if($stopgapData->stopgap_status=="Re-Allocation"){echo "selected";}  ?>>Re-Allocation</option>
							<option value="Undergoing Repair" <?php if($stopgapData->stopgap_status=="Undergoing Repair"){echo "selected";}  ?>>Undergoing Repair</option>
							<option value="Location Not Known" <?php if($stopgapData->stopgap_status=="Location Not Known"){echo "selected";}  ?>>Location Not Known</option>
						</select>
					</div>
				</div>
				
				<div class="col-sm-12">
					<div class="form-group col-sm-12">
						<label for="remark">Remarks</label>
						<textarea name="remark" class="form-control"><?php echo $stopgapData->remarks;  ?></textarea>
					</div>				
				</div>
			</div>			
		</div>
		<div class="modal-footer">
			<button type="submit" name="update-stopgap" class="btn btn-xs btn-success pull-left"><i class="fa fa-check"></i> Update Stopgap</button>
			<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 -->