<section class="container" style="padding-bottom: 2rem;">
	<div class="row">
		<div class="col-sm-12">
			<div class="tab-content" id="tabContent">
				<div class="tab-pane fade show active" id="profile" role="tabpanel" aria-labelledby="profile-tab">
					<div class="card bg-light-transparent">
						<div class="card-header bg-light">
							<h4 class="card-title float-left"><?php echo (empty($ID))?'New ':'Edit '; ?> Job Request Form</h4>
						</div>
						<div class="card-body">
							<div class="card no-shadow">
								<div class="card-body">
									<form id="jobRequestForm" class="form" action="<?php echo ($ID)?base_url('hr/Serviceform/job_request_edit'):base_url('hr/Serviceform/job_request_save'); ?>" method="POST" onsubmit="return confirm('Confirm to submit this form?')">

										<input type="text" class="form-control" name="jobRequestID" id="jobRequestID" value="<?php echo $ID; ?>" hidden>

										<div class="form-row">
											<div class="col-12">
												<div class="form-group">
													<div class="form-row">
														<div class="col-12 col-sm-6">
															<div class="form-group">
																<label>Name</label>
																<input type="text" class="form-control" name="request_name" id="request_name" value="<?php echo ($ID)?$job_request_list['requester_name']:$_SESSION['user']['name']; ?>" readonly>	
																<input type="text" class="form-control" name="request_name_id" id="request_name_id" value="<?php echo ($ID)?$job_request_list['requester_id']:$_SESSION['user']['id']; ?>" hidden>
															</div>
														</div>

														<div class="col-12 col-sm-6">
															<div class="form-group">
																<label for="email">Email Address</label>
																<input type="text" class="form-control" name="request_email" id="request_email" value="<?php echo ($ID)?$job_request_list['requester_email']:$_SESSION['user']['email']; ?>" readonly>
															</div>
														</div>

														<div class="col-12 col-sm-6">
															<div class="form-group">
																<label for="department">Department</label>
																<input type="text" class="form-control" name="request_dept" id="request_dept" value="<?php echo ($ID)?$job_request_list['dept_name'].' ['.$job_request_list['branchName'].']':$_SESSION['user']['department_name'].' ['.$_SESSION['user']['branch_name'].']'; ?>" readonly>	
																<input type="text" class="form-control" name="request_dept_id" id="request_dept_id" value="<?php echo ($ID)?$job_request_list['department_id']:$_SESSION['user']['department_id']; ?>" hidden>
															</div>
														</div>

														<div class="col-12 col-sm-6">
															<div class="form-group">
																<label for="datereq">Date Request</label>
																<input type="text" class="form-control" name="datereq" id="datereq" value="<?php echo ($ID)?date("d-m-Y",strtotime($job_request_list['createdTS'])):date("d-m-Y"); ?>" readonly>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>

										<div class="form-row">
											<div class="col-12">
												<div class="form-group">
													<label>Company Name</label>
													<select class="form-control select" name="client_id[]" id="client_id" required multiple>
														<option></option>
														<?php if($client) foreach($client as $row){ ?>
															<option value="<?php echo $row->id; ?>" <?php echo ($ID)?(($job_request_list['client_id'] == $row->id)?'selected':''):''; ?>>
																<?php echo $row->name; ?>
															</option>
														<?php } ?>
													</select>
												</div>
											</div>

											<div class="col-12">
												<div class="form-group">
													<label>Description</label>
													<textarea class="form-control" name="description" id="description" rows="2" required><?php echo ($ID)?$job_request_list['description']:''; ?></textarea>
												</div>
											</div>

											<div class="col-12">
												<div class="form-group">
													<label>Remarks (If Any)</label>
													<textarea class="form-control" name="remarks" id="remarks" rows="2"><?php echo ($ID)?$job_request_list['remarks']:''; ?></textarea>
												</div>
											</div>

											<div class="col-12 col-sm-6">
												<div class="form-group">
													<label>Deadline (If Any)</label>
													<input type="text" class="form-control datepicker" name="deadline" id="deadline" value="<?php echo ($ID)?((strtotime($job_request_list['deadline']) > 0)?date('d-m-Y',strtotime($job_request_list['deadline'])):''):''; ?>">
												</div>
											</div>

											<div class="col-12 col-sm-6">
												<div class="form-group">
													<label>Year End Date (If Any)</label>
													<input type="text" class="form-control datepicker-yyyy" name="yearEndDate" id="yearEndDate" value="<?php echo ($ID)?$job_request_list['yearEndDate']:''; ?>">
												</div>
											</div>
										</div>

										<div class="form-row" <?php echo (isset($mode) && ($mode == 'view'))?'style="display: none;"':''; ?>>
											<div class="col-12" style="padding-top: 2rem;">
												<div class="float-left <?php echo ($ID)?'d-none':''; ?>">
													<table>
														<tbody>
															<tr>
																<td class="text-center">
																	<label class="switch" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Send me a copy of this form">
																		<input type="checkbox" name="send_email_checkbox">
																		<span class="slider round"></span>
																	</label>
																</td>
																<td class="p-3 py-1"><b><h6 style="">Send me a copy of this form</h6></b></td>
															</tr>
														</tbody>
													</table>
												</div>

												<div class="float-right">
													<a class="btn btn-light" href="<?php echo base_url('hr/serviceform/job_request_list/'); ?>">Cancel</a>
													<button type="submit" id="submitBtn" class="btn btn-primary"><?php echo 'submit';//($ID)?'Update':'Submit'; ?></button>
												</div> 
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>

<?php echo (!empty($approval))?$approval:''; ?>