<!-- Content Header (Page header) -->
<section class="content-header">
	<div class="container-fluid">
		<div class="row mb-2">
			<div class="col-sm-6">
				<h1 class="m-0">H R</h1>
			</div>

			<div class="col-sm-6">
				<ol class="breadcrumb float-sm-right">
					<li class="breadcrumb-item"><a href="dashboard">Dashboard</a></li>
					<li class="breadcrumb-item"><a href="hr/emp-list">H R</a></li>
					<li class="breadcrumb-item active"><?php if ( count( $emp ) > 0 ): ?>Edit<?php else: ?>Add New<?php endif;?> Employee</li>
				</ol>
			</div>
		</div>
	</div>
</section>

<!-- Main content -->
<section class="content">
	<div class="container-fluid">
		<!-- Small boxes (Stat box) -->
		<div class="row">
			<div class="col-md-12">
				<form id="frmEmp" action="hr/emp-save" method="post">
					<div class="card card-primary">
						<div class="card-header">
							<h3 class="card-title"><?php if ( count( $emp ) > 0 ): ?>Edit<?php else: ?>Add New<?php endif;?> Employee</h3>
						</div>

						<div class="card-body">
							<div class="row">
								<div class="col-md-6">
									<div class="form-group">
										<label for="name">Employee Name</label>
										<input type="text" name="name" id="name" class="form-control" placeholder="Employee Name" value="<?php if ( count( $emp ) > 0 ): echo $emp['name'];endif;?>">
									</div>
									<div class="form-group">
										<label for="father_name">Father's Name</label>
										<input type="text" name="father_name" id="father_name" class="form-control" placeholder="Father's Name" value="<?php if ( count( $emp ) > 0 ): echo $emp['father_name'];endif;?>">
									</div>
									<div class="form-group">
										<label for="mother_name">Mother's Name</label>
										<input type="text" name="mother_name" id="mother_name" class="form-control" placeholder="Mother's Name" value="<?php if ( count( $emp ) > 0 ): echo $emp['mother_name'];endif;?>">
									</div>
									<div class="form-group">
										<label for="present_address">Present Address</label>
										<textarea name="present_address" id="present_address" class="form-control" placeholder="Present Address"><?php if ( count( $emp ) > 0 ): echo $emp['present_address'];endif;?></textarea>
									</div>
									<div class="form-group">
										<label for="permanent_address">Permanent Address</label>
										<textarea name="permanent_address" id="permanent_address" class="form-control"  placeholder="Permanent Address"><?php if ( count( $emp ) > 0 ): echo $emp['permanent_address'];endif;?></textarea>
									</div>
								</div>

								<div class="col-md-6">
									<div class="form-group">
										<label for="designation">Designation</label>
										<input type="text" name="designation" id="designation" class="form-control" placeholder="Designation" value="<?php if ( count( $emp ) > 0 ): echo $emp['designation'];endif;?>">
									</div>
									<div class="form-group">
										<label for="department">Department</label>
										<input type="text" name="department" id="department" class="form-control" placeholder="Department" value="<?php if ( count( $emp ) > 0 ): echo $emp['department'];endif;?>">
									</div>
									<div class="form-group">
										<label for="joining">Date of Join</label>
										<input type="text" name="joining" id="joining" class="form-control" value="<?php if ( count( $emp ) > 0 ): echo date_to_ui( $emp['joining'] );else:echo date( 'd/m/Y' );endif;?>" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask>
									</div>
									<div class="form-group">
										<label for="mobile">Mobile</label>
										<input type="text" name="mobile" id="mobile" class="form-control" placeholder="Mobile Number" value="<?php if ( count( $emp ) > 0 ): echo $emp['mobile'];endif;?>">
									</div>
									<div class="form-group">
										<label for="email">Email</label>
										<input type="text" name="email" id="email" class="form-control" placeholder="Email" value="<?php if ( count( $emp ) > 0 ): echo $emp['email'];endif;?>">
									</div>
									<div class="form-group">
										<label for="notes">Notes</label>
										<textarea name="notes" id="notes" class="form-control" placeholder="Customer Notes"><?php if ( count( $emp ) > 0 ): echo $emp['notes'];endif;?></textarea>
									</div>
								</div>
							</div>
						</div>

						<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">
						<?php if ( count( $emp ) > 0 ): ?>
							<input type="hidden" name="id" value="<?php echo $emp['id']; ?>">
						<?php endif;?>

						<div class="card-footer">
							<input type="submit" class="btn bg-gradient-primary" value="Save Changes">
							<input type="reset" class="btn bg-gradient-danger" value="Cancel">
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</section>