<div id="collapsePersonalData">
	<div class="row">
		<div class="col">
			<label><b>Title</b></label>
			<div class="input-group mb-3">
			  <select class="form-control" name="title">
			  	<option disabled selected>Please Select Title</option>
			  	<?php if(!empty($titles)) foreach ($titles as $key => $title): ?>
			  		<?php if (!empty($action_type->title_id)): ?>
			  			<option value="<?php echo $title->id; ?>" <?php echo($action_type->title_id == $title->id)?'selected':''; ?>><?php echo $title->title; ?></option>
			  		<?php else: ?>
			  			<option value="<?php echo $title->id; ?>"><?php echo $title->title; ?></option>
			  		<?php endif ?>
			  	<?php endforeach ?>
			  </select>
			  <div class="input-group-append">
			    <button class="btn btn-warning btn-sm" type="button" data-toggle="modal" data-target="#createTitle"><i class="fas fa-plus"></i></button>
			  </div>
			</div>
		</div>
		<div class="col">
			<label><b>Name</b></label>
			<input type="text" class="form-control" name="staff_name" value="<?php echo ($staff['name'])?$staff['name']:''; ?>" disabled>
		</div>
	</div>

	<div class="row">
		<div class="col-lg-6 col-12">
			<label><b>Staff Id</b></label>
			<input type="hidden" class="form-control" name="user_id" value="<?php echo ($staff['id'])?$staff['id']:''; ?>">
			<input type="text" class="form-control" name="staff_id" value="<?php echo ($staff['staff_id'])?$staff['staff_id']:''; ?>">
		</div>
		<div class="col-lg-6 col-12">
			<label><b>Gender</b></label>
			<select class="form-control" name="gender">
				<option disabled selected>Please Select Gender</option>
				<?php if(!empty($genders)) foreach ($genders as $key => $gender): ?>
					<?php if (!empty($action_type->gender_id)): ?>
						<option value="<?php echo $gender->id; ?>" <?php echo ($action_type->gender_id == $gender->id)?'selected':''; ?>><?php echo $gender->gender; ?></option>
					<?php else: ?>
						<option value="<?php echo $gender->id; ?>"><?php echo $gender->gender; ?></option>
					<?php endif ?>
				<?php endforeach ?>
			</select>
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>NRIC / Passport No</b></label>
			<input type="text" class="form-control" name="nric" value="<?php echo (!empty($action_type->ic_no))?$action_type->ic_no:''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Passport Expired Date</b></label>
			<input type="text" class="form-control datepicker" name="passport_expired_date" value="<?php echo (!empty($action_type->passport_expired_date))?date('d-m-Y',strtotime($action_type->passport_expired_date)):''; ?>">
		</div>
		<div class="col">
			<label><b>Working Permit Expired Date</b></label>
			<input type="text" class="form-control datepicker" name="working_expired_date" value="<?php echo (!empty($action_type->working_expired_date))?date('d-m-Y',strtotime($action_type->working_expired_date)):''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Place of Issue</b></label>
			<select class="form-control select" name="passport_issue_country">
				<option disabled selected>Please Select Passport Issued Country</option>
				<?php foreach ($countries as $key => $country): ?>
					<?php if (!empty($action_type->place_issue)): ?>
						<option value="<?php echo $country->id; ?>" <?php echo ($action_type->place_issue == $country->id)?'selected':''; ?>><?php echo $country->country; ?></option>
					<?php else: ?>
						<option value="<?php echo $country->id; ?>"><?php echo $country->country; ?></option>
					<?php endif ?>
				<?php endforeach ?>
			</select>
		</div>
	</div>
	
	<div class="row">
		<div class="col">
			<label><b>Mobile Number</b></label>
			<input type="text" class="form-control" name="staff_phone" value="<?php echo (!empty($action_type->phone))?$action_type->phone:''; ?>">
		</div>
		<div class="col">
			<label><b>Extension Number</b></label>
			<input type="text" class="form-control" name="staff_ext_no" value="<?php echo (!empty($action_type->ext_no))?$action_type->ext_no:''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Birthdate</b></label>
			<input type="text" class="form-control datepicker" name="staff_birthdate" value="<?php echo (!empty($action_type->birth_date))?date('d-m-Y',strtotime($action_type->birth_date)):''; ?>">
		</div>
		<div class="col">
			<label><b>Birthplace</b></label>
			<input type="text" class="form-control" name="staff_birthplace" value="<?php echo (!empty($action_type->birth_place))?$action_type->birth_place:''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Hobby</b></label>
			<input type="text" class="form-control" name="staff_hobby" value="<?php echo (!empty($action_type->hobby))?$action_type->hobby:''; ?>">
		</div>
		<div class="col">
			<label><b>Nationality</b></label>
			<select class="form-control select" name="staff_nationality">
				<option disabled selected>Please Select Staff Nationality</option>
				<?php foreach ($countries as $key => $country): ?>
					<?php if (!empty($action_type->citizen_id)): ?>
						<option value="<?php echo $country->id; ?>" <?php echo ($action_type->citizen_id == $country->id)?'selected':''; ?>><?php echo $country->country; ?></option>	
					<?php else: ?>
						<option value="<?php echo $country->id; ?>"><?php echo $country->country; ?></option>
					<?php endif ?>
				<?php endforeach ?>
			</select>
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Religion</b></label>
			<div class="input-group">
			  <select class="form-control" name="staff_religion">
			  	<option disabled selected>Please Select Staff Religion</option>
			  	<?php if(!empty($religions)) foreach ($religions as $key => $religion): ?>
			  		<?php if ($action_type->religion_id): ?>
			  			<option value="<?php echo $religion->id; ?>" <?php echo ($action_type->religion_id == $religion->id)?'selected':''; ?>><?php echo $religion->name; ?></option>
			  		<?php else: ?>
			  			<option value="<?php echo $religion->id; ?>"><?php echo $religion->name; ?></option>
			  		<?php endif ?>
			  	<?php endforeach ?>
			  </select>
			  <div class="input-group-append">
			    <button class="btn btn-warning btn-sm" type="button" data-toggle="modal" data-target="#createNewReligion"><i class="fas fa-plus"></i></button>
			  </div>
			</div>
		</div>
		<div class="col">
			<label><b>Race</b></label>
			<div class="input-group">
			  <select class="form-control" name="staff_race">
			  	<option disabled selected>Please Select Staff Race</option>
			  	<?php if(!empty($races)) foreach ($races as $key => $race): ?>
			  		<?php if (!empty($action_type->race_id)): ?>
			  			<option value="<?php echo $race->id; ?>" <?php echo ($action_type->race_id == $race->id)?'selected':''; ?>><?php echo $race->race; ?></option>
			  		<?php else: ?>
			  			<option value="<?php echo $race->id; ?>"><?php echo $race->race; ?></option>
			  		<?php endif ?>
			  	<?php endforeach ?>
			  </select>
			  <div class="input-group-append">
			    <button class="btn btn-warning btn-sm" type="button" data-toggle="modal" data-target="#createNewRaces"><i class="fas fa-plus"></i></button>
			  </div>
			</div>
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Residential Status</b></label>
			<select class="form-control" name="residential_status">
				<option disabled selected>Please Select Residential Status</option>
					<?php if (!empty($action_type->residential_id)): ?>
						<option value="1" <?php echo ($action_type->residential_id == 1)?'selected':'' ?>>Resident</option>
						<option value="2" <?php echo ($action_type->residential_id == 2)?'selected':'' ?>>Non Resident</option>
					<?php else: ?>
						<option value="1">Resident</option>
						<option value="2">Non Resident</option>
					<?php endif ?>
			</select>
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Marital Status</b></label>
			<select class="form-control" name="marital_status">
				<option disabled selected>Please Select Staff Status</option>
				<?php if (!empty($action_type->marital_status)): ?>
					<option value="1" <?php echo ($action_type->marital_status == 1)?'selected':''; ?>>Single</option>
					<option value="2" <?php echo ($action_type->marital_status == 2)?'selected':''; ?>>Married</option>
					<option value="3" <?php echo ($action_type->marital_status == 3)?'selected':''; ?>>Divorce</option>
				<?php else: ?>
					<option value="1">Single</option>
					<option value="2">Married</option>
					<option value="3">Divorce</option>
				<?php endif ?>
			</select>
		</div>
		<div class="col">
			<label><b>Married Date</b></label>
			<input type="text" class="form-control datepicker" name="married_date" value="<?php echo (!empty($action_type->married_date))?date('d-m-Y',strtotime($action_type->married_date)):''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Primary Email</b></label>
			<input type="email" class="form-control" name="primary_email" value="<?php echo (!empty($action_type->primary_email))?$action_type->primary_email:''; ?>">
		</div>
		<div class="col">
			<label><b>Secondary Email</b></label>
			<input type="email" class="form-control" name="secondary_email" value="<?php echo (!empty($action_type->secondary_email))?$action_type->secondary_email:''; ?>">
		</div>
	</div>

	<div class="row">
		<div class="col">
			<label><b>Action Type</b></label>

			<div class="input-group">
			  	<select class="form-control" name="action_type" id="action-type" onchange="actionType()">
			  		<?php /*akmal 20201228 to hide this part from current user usetting  */ 
if ($this->router->fetch_class()=='StaffProfile' && $this->router->fetch_method()=='new_action_type') { ?>
					<?php if($action_types) foreach ($action_types as $key => $at): ?>
						<option value="<?php echo $at->id; ?>"><?php echo $at->type; ?></option>
					<?php endforeach ?>
 <?php } else {

					echo '<option value="16">Personal Details</option>';
} ?>
				</select>
			  <div class="input-group-append">
			    <button class="btn btn-warning btn-sm" type="button" data-toggle="modal" data-target="#hiring-add"><i class="fas fa-plus"></i></button>
			  </div>
			</div>
		</div>
		<div class="col">
			<label><b>Action effective date</b></label>
			<?php if (isset($action_type)): ?>
				<input type="text" class="form-control datepicker" value="<?php echo date('d-m-Y',strtotime($action_type->action_efective_date)); ?>" name="efective_date" onchange="aedChange(this)">
			<?php else: ?>
				<input type="text" class="form-control datepicker" name="efective_date" value="<?php echo date('d-m-Y'); ?>" onchange="aedChange(this)">
			<?php endif ?>
		</div>
	</div>
</div>