306 lines
16 KiB
PHP
Executable File

<!--sidebar end-->
<!--main content start-->
<style type="text/css">
.required-field:after {
content: "*";
color: red;
}
.row.experienceLabel.hide {
display: none;
}
.skill-row{ /* border: thin solid #000; */}
.skill-row label{ margin-bottom: 0px !important;}
.form-control.multiselect-class {
height: 300px !important;
}
.app-content .wizard > .steps > ul > li.active .step {
background-color: #666EE8;
border-color: #666EE8;
color: #fff;
}
.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="password"], .has-error input[type="date"], .has-error select[multiple], .has-error select {
border: 1px solid #a94442;
}
.help-block.with-errors {
color: #a94442;
}
.full-height-view{
height: 500px !important;
}
</style>
<div class="app-content content">
<section class="content-wrapper">
<div class="content-body">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header card-header-title-part card_mrgn">
<div class="row">
<div class="col-md-12">
<header class="panel-heading font-weight-bold">
<h3 class="mar_cus">
<?php
echo lang('Add Caregiver');
?>
</h3>
</header>
</div>
</div>
</div>
<hr class="mt-0 mb-0" />
<section id="main-content">
<section class="wrapper site-min-height mt-20">
<!-- page start-->
<section class="row col-md-12">
<div class="col-md-12">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade active in show" id="tab1" role="tabpanel" aria-labelledby="" style="padding: 20px;">
<form role="form" action="<?php echo base_url(); ?>caregivers/addNewStep" id="caregiverBasicForm" method="post" enctype="multipart/form-data" class="needs-validation" >
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<!--data-toggle="validator" novalidate="true"-->
<input type="hidden" name="form_tab_status" value="1">
<input type="hidden" name="id" id="caregiver_id" value="">
<input type="hidden" name="form_status" value="1">
<input type="hidden" name="form_mode" value="Add">
<div class="row">
<div class="row">
<div class="form-group col-md-4">
<label for="exampleInputEmail1" class="required-field"><?php echo lang('First Name'); ?></label>
<input type="text" class="form-control" name="fname" id="exampleInputEmail1" value='<?php
if (!empty($setval)) {
echo set_value('fname');
}
if (!empty($nurse->fname)) {
echo $nurse->fname;
}
?>' required data-error="Please enter a valid first name.">
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4">
<label for="regMidname" class="required-field" id="regMidnameLbl"><?php echo lang('Middle Name'); ?></label>
<input type="text" class="form-control" name="mid_name" id="regMidname" value='<?php
if (!empty($setval)) {
echo set_value('mid_name');
}
if (!empty($nurse->mid_name)) {
echo $nurse->mid_name;
}
?>' data-error="Please enter a valid middle name." required>
<label>
<input type="checkbox" id="midName" name="midNameOptional">&nbsp;I don't have a middle name
</label>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4">
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Last Name'); ?></label>
<input type="text" class="form-control" name="lname" id="exampleInputEmail1" value='<?php
if (!empty($setval)) {
echo set_value('lname');
}
if (!empty($nurse->lname)) {
echo $nurse->lname;
}
?>' required data-error="Please enter a valid last name.">
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4">
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Mobile Number'); ?></label>
<input type="text" class="form-control" name="phone" onkeypress="return isNumberKey(event)" onkeyup="USformatPhoneNumber(this.value,this);" onBlur="USformatPhoneNumber(this.value,this);" value='<?php
if (!empty($setval)) {
echo set_value('phone');
}
if (!empty($nurse->phone)) {
echo $nurse->phone;
}
?>' placeholder="" required data-error="Please enter a valid mobile number.">
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4">
<label class="required-field"><?php echo lang('email'); ?></label>
<div class="input-group">
<input type="email" class="form-control" name="email" id="email" value='<?php
if (!empty($setval)) {
echo set_value('email');
}
if (!empty($nurse->email)) {
echo $nurse->email;
}
?>' placeholder="" required data-error="Please enter a valid email.">
<div class="input-group-append" id="emailcheckTab" style="display: none;">
<span class="input-group-text" >
<span id="emailChecking" style="display: none"><i class="la la-hourglass-start" style="color: blue;"></i></span>
<span id="emailAvailable" style="display: none"><i class="la la-check" style="color: green;">Available</i></span>
<span id="emailNA" style="display: none"><i class="la la-close" style="color: red;">Not-Available</i></span>
</span>
</div>
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4">
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Hire Type'); ?></label>
<select type="text" class="form-control" name="hire_type" id="hire_type" required data-error="Please select a Hire Type.">
<option value="New Hire">New Hire</option>
<option value="Re-Hire">Re-Hire</option>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-md-4" id="Date-of-Re-Hire">
</div>
<div class="form-group col-md-4">
<label class="required-field"><?php echo lang('Caregiver Type'); ?></label>
<div class="col-md-12">
<div class="row">
<?php foreach ($skills as $skill) { ?>
<div class="form-check width-80">
<input class="form-check-input caregiver-type" type="radio" id="<?php echo $skill->name; ?>" name="qualification_type" value="<?php echo $skill->id; ?>" required>
<label class="form-check-label" for="<?php echo $skill->name; ?>"><?php echo $skill->name; ?></label>
</div>
<?php } ?>
</div>
</div>
<div class="help-block with-errors">
</div>
</div>
<div class="form-group col-md-4">
<input type="text" class="form-control" name="employee_type" value="contrator" hidden>
</div>
<!-- </div> -->
<div class="form-group col-md-12">
<input type="hidden" name="form_status" value="1">
<button type="submit" name="submit" id="submitBtn" class="btn btn-info" ><?php echo lang('submit'); ?></button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
<!-- page end-->
</section>
</section>
</div>
</div>
</div>
</div>
</section>
</div>
<?php if($this->session->flashdata('feedback_error')){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'error',
title: '<?php echo $this->session->flashdata('caregiver_created'); ?>',
showConfirmButton: false,
timer: 3500
})
</script>
<?php unset($_SESSION['feedback_error']); } ?>
<script type="text/javascript">
$(function(){
$("#midName").click(function(){
if($(this).is(":checked"))
{
$("#regMidname").val("");
$("#regMidname").prop( "disabled", true );
$("#regMidnameLbl").removeClass('required-field');
$('#regMidname').removeAttr('required');
}
else
{
$("#regMidname").prop( "disabled", false );
$("#regMidnameLbl").addClass('required-field');
$('#regMidname').prop('required',true);
}
})
});
</script>
<script type="text/javascript">
$("#email").blur(function(){
//alert('1');
var email=this.value;
$("#emailcheckTab").show();
$("#emailChecking").show();
$("#emailAvailable").hide();
$("#emailNA").hide();
$("#submitBtn").prop('disabled', true);
$.ajax({
url:'<?php echo base_url(); ?>caregivers/checkEmail',
type:'GET',
data:{email:email},
beforeSend: function(){
$("#emailcheckTab").show();
$("#emailChecking").show();
$("#emailAvailable").hide();
$("#emailNA").hide();
},
success:function(data){
// alert(data);
if(data){
$("#emailAvailable").show();
$("#emailNA").hide();
$("#submitBtn").prop('disabled', false);
}else{
$("#emailAvailable").hide();
$("#emailNA").show();
}
$("#emailcheckTab").show();
$("#emailChecking").hide();
}
});
});
$("#hire_type").change(function(){
var hire_type=$("#hire_type").val();
//alert(hire_type);
var html_re_hire_date='<label for="exampleInputEmail1" class="required-field">Date of Re-Hire</label>'
+' <input type="date" class="form-control" name="date_of_re_hire" placeholder="Date of Re-Hire" required>'
+' <div class="help-block with-errors"></div>';
if(hire_type=="Re-Hire"){
$("#Date-of-Re-Hire").html(html_re_hire_date);
}else{
$("#Date-of-Re-Hire").html('');
}
});
function USformatPhoneNumber(phoneNumberString,_this) {
var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
if(cleaned.length > 10){
cleaned = cleaned.substr(0, 10);
}
var match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
if (cleaned.length == 10 && match) {
var intlCode = (match[1] ? '+1 ' : '')
var fres = [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
_this.value = fres;
}else{
_this.value = cleaned
}
return null
}
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<!--main content end-->
<!--footer start-->