241 lines
12 KiB
PHP
Executable File
241 lines
12 KiB
PHP
Executable File
<label class="inner-heading">U.S. Work Authorization and Identification</label>
|
|
<form role="form" action="<?php echo base_url(); ?>CaregiversDashboard/ProfileUpdate" method="post" enctype="multipart/form-data" use="docDocumentType">
|
|
<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="<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>">
|
|
<input type="hidden" name="form_status" value="1">
|
|
<input type="hidden" name="form_mode" value="<?php if($nurse->form_status>0) echo 'Edit'; else echo 'Add'; ?>">
|
|
<div class="row">
|
|
|
|
<?php $citizen=json_decode($nurse->citizen);
|
|
$citizen_status = $citizen->citizen;
|
|
$citizenship_list = getCitizenList($citizen_status);
|
|
// pre($nurse->documents_type);
|
|
// _die($citizenship_list);
|
|
?>
|
|
<input type="hidden" class="doc-type-saved-value" id="citizenStatus" value="<?php echo $citizen_status;?>">
|
|
<div class="form-group col-md-4 citizen-documents-type">
|
|
<label class="required-field"><?php echo lang('Document Type'); ?></label>
|
|
<select class="form-control" name="documents_type" id="first_documents_type" required>
|
|
<option value="">Select</option>
|
|
<?php
|
|
foreach($citizenship_list as $list){ ?>
|
|
<option class="citizenListCheck" data_name="<?php echo $list->name?>" data_type="<?php echo $list->list_type?>" value="<?php echo $list->short_code?>"
|
|
<?php if($nurse->documents_type== $list->short_code ){ echo 'Selected'; }?>>
|
|
<?php echo $list->name;?>
|
|
</option>
|
|
<?php
|
|
}
|
|
?>
|
|
</Select>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4 type2div" <?php if($nurse->second_documents_type!= '' ){ echo ''; }else{echo 'style="display:none;"';}?> >
|
|
<label class=""><?php echo lang('Document Type2'); ?></label>
|
|
<select class="form-control" name="documents_type_c" id="second_document_type">
|
|
|
|
|
|
</Select>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group col-md-1">
|
|
<label></label>
|
|
<button class="btn btn-primary document-type-save" type="submit">Save</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div id="citizenshipDocContainer">
|
|
|
|
|
|
<div class="ctz_first_doc" <?php if($nurse->documents_type!= '' ){ echo ''; }else{echo 'style="display:none;"';}?>>
|
|
<form action="<?php echo base_url(); ?>CaregiversDashboard/documentsSave" method="post" enctype="multipart/form-data" use="docSaveForm" >
|
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
|
|
|
|
<div class="row">
|
|
<input type="hidden" name="Ion_id" id="caregiver_ion_id" value="<?php if (!empty($nurse->ion_user_id)) echo $nurse->ion_user_id; ?>">
|
|
<input type="hidden" name="id" id="caregiver_id" value="<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>">
|
|
<input type="hidden" name="doc_type" value="<?php echo _DOC_CITIZENSHIP_ONE_ ;?>">
|
|
<input type="hidden" name="doc_id" value="<?php echo $documentsid[_DOC_CITIZENSHIP_ONE_][0]; ?>">
|
|
<input type="hidden" name="progress" value="0">
|
|
|
|
<div class="form-group col-md-4">
|
|
<label class="required-field" id="cityDocName1"><?php echo getCitizenName($nurse->documents_type); ?></label>
|
|
|
|
<input type="file" class="form-control " name="<?php echo _DOC_CITIZENSHIP_ONE_ ;?>" allowedType="gif|jpg|png|jpeg|pdf">
|
|
|
|
</div>
|
|
|
|
<div class="form-group center col-md-2 mt-2 row">
|
|
|
|
<button class="btn btn-primary file-upload" name="upload" type="submit"> Upload</button>
|
|
</div>
|
|
<div class="form-group center col-md-1 mt-2">
|
|
<?php if($documentsarr[_DOC_CITIZENSHIP_ONE_][0] !=''){ ?>
|
|
<a class="img-icon dwnload" data-docType="<?=_DOC_CITIZENSHIP_ONE_?>" data-userid="<?=$nurse->id?>">
|
|
<i class='far fa-arrow-alt-circle-down' style='font-size:24px'></i>
|
|
</a>
|
|
<?php }else{ ?>
|
|
<span use="uploadContainer">
|
|
<span class="text-danger">pending</span>
|
|
</span>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="ctz_second_doc type2div" <?php if($nurse->second_documents_type!= '' ){ echo ''; }else{echo 'style="display:none;"';}?>>
|
|
<form action="<?php echo base_url(); ?>CaregiversDashboard/documentsSave" method="post" enctype="multipart/form-data" use="docSaveForm" >
|
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
|
|
|
|
<div class="row">
|
|
<input type="hidden" name="Ion_id" id="caregiver_ion_id" value="<?php if (!empty($nurse->ion_user_id)) echo $nurse->ion_user_id; ?>">
|
|
<input type="hidden" name="id" id="caregiver_id" value="<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>">
|
|
<input type="hidden" name="doc_type" value="<?php echo _DOC_CITIZENSHIP_TWO_ ;?>">
|
|
<input type="hidden" name="doc_id" value="<?php echo $documentsid[_DOC_CITIZENSHIP_TWO_][0]; ?>">
|
|
<input type="hidden" name="progress" value="0">
|
|
|
|
<div class="form-group col-md-4">
|
|
<label class="required-field" id="cityDocName2"><?php echo getCitizenName($nurse->second_documents_type); ?></label>
|
|
|
|
<input type="file" id="input1" class="form-control " name="<?php echo _DOC_CITIZENSHIP_TWO_ ;?>" allowedType="gif|jpg|png|jpeg|pdf">
|
|
|
|
</div>
|
|
|
|
<div class="form-group center col-md-2 mt-2 row">
|
|
|
|
<button class="btn btn-primary file-upload" name="upload" type="submit"> Upload</button>
|
|
</div>
|
|
<div class="form-group center col-md-1 mt-2">
|
|
<?php if($documentsarr[_DOC_CITIZENSHIP_TWO_][0] !=''){ ?>
|
|
<a class="img-icon" data-docType="<?=_DOC_CITIZENSHIP_TWO_?>" data-userid="<?=$nurse->id?>">
|
|
<i class='far fa-arrow-alt-circle-down' style='font-size:24px'></i>
|
|
</a>
|
|
<?php }else{ ?>
|
|
<span use="uploadContainer">
|
|
<!-- <img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 50px;"> -->
|
|
<span class="text-danger">pending</span>
|
|
</span>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
var list_type= $("#first_documents_type option:selected" ).attr('data_type');
|
|
var short_code = $("#first_documents_type option:selected" ).val();
|
|
getSecondDropdown(list_type,short_code);
|
|
|
|
$('#first_documents_type').on('change', function() {
|
|
|
|
var list_type = $("#first_documents_type option:selected" ).attr('data_type');
|
|
var option_name = $("#first_documents_type option:selected" ).attr('data_name');
|
|
var short_code = $("#first_documents_type option:selected" ).val();
|
|
// alert(option_name);
|
|
if(short_code !=''){
|
|
$('.ctz_first_doc').show();
|
|
$('#cityDocName1').text(option_name);
|
|
}
|
|
getSecondDropdown(list_type,short_code);
|
|
});
|
|
|
|
// function getSecondDropdown(list_type,short_code) {
|
|
// var citizen_status = $('#citizenStatus').val();
|
|
// // alert(citizen_status);
|
|
// if(list_type == 'B'){
|
|
// $('.type2div').show();
|
|
// $.ajax({
|
|
// type: "GET",
|
|
// url: "<?=base_url()?>caregivers/getCTypeList",
|
|
// data: {list_type:list_type,short_code:short_code,citizen_status:citizen_status,
|
|
// '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>'},
|
|
// async: false,
|
|
// success: function(outputData) {
|
|
// var data = JSON.parse(outputData);
|
|
// var dropdown1 = '<option value="">Select</option>';
|
|
// for(var i=0; i< data.length;i++){
|
|
|
|
// var slt ='';
|
|
// if(data[i].short_code == '<?php echo $nurse->second_documents_type ;?>'){
|
|
// slt = 'selected';
|
|
// }
|
|
// // console.log(slt);
|
|
// var short_code = data[i].short_code;
|
|
// dropdown2 = '<option '+slt+' value="'+data[i].short_code+'" data_name="'+data[i].name+'">'+data[i].name+'</option>';
|
|
// dropdown1 = dropdown1+dropdown2
|
|
|
|
// }
|
|
|
|
// console.log(dropdown1);
|
|
// $("#second_document_type").html(dropdown1);
|
|
// }
|
|
// });
|
|
// }else{
|
|
// $('.type2div').hide();
|
|
// $('#second_document_type').val('');
|
|
// }
|
|
|
|
// };
|
|
|
|
$('#second_document_type').on('change', function() {
|
|
|
|
var option_name2 = $("#second_document_type option:selected" ).attr('data_name');
|
|
var short_code2 = $("#second_document_type option:selected" ).val();
|
|
// alert(option_name2);
|
|
if(short_code2 !=''){
|
|
$('.ctz_second_doc').show();
|
|
$('#cityDocName2').text(option_name2);
|
|
}
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
$("form[use=docDocumentType]").on("submit",function(e){
|
|
e.preventDefault();
|
|
var form=$(this);
|
|
var url=form.attr('action');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
data: form.serialize(),
|
|
beforeSend : function(){
|
|
$(".document-type-save").html("Saving");
|
|
},
|
|
success: function(data){
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'success',
|
|
title: 'Document Type Saved Successfully',
|
|
showConfirmButton: false,
|
|
timer: 2500
|
|
});
|
|
$(".document-type-save").html("Saved");
|
|
$(".doc-type-upload").show();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|