415 lines
22 KiB
PHP
Executable File
415 lines
22 KiB
PHP
Executable File
<!--sidebar end-->
|
|
<!--main content start-->
|
|
<style type="text/css">
|
|
.required-field:after {
|
|
content: "*";
|
|
color: red;
|
|
}
|
|
</style>
|
|
<div class="app-content content">
|
|
<section class="content-wrapper">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<h3 class="font-weight-bold">
|
|
<?php
|
|
if (!empty($user->id))
|
|
echo lang('edit').' '.lang('Physician');
|
|
else
|
|
echo lang('add').' '.lang('Physician');
|
|
?>
|
|
</h3>
|
|
|
|
<?php //echo $this->session->flashdata('feedback'); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr class="mt-0 mb-0" />
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<form role="form" action="physician/addNew" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
|
|
<input type="hidden" name="id" value='<?php if (!empty($user->id)) { echo $user->id; } ?>'>
|
|
<input type="hidden" value="<?php echo $phyid; ?>"/>
|
|
<div class="row">
|
|
<img src="<?php echo base_url(); ?>uploads/ajax-loader.gif" id="check_loader" style="display:none;">
|
|
</div>
|
|
<div class="row" id="check_phyReg">
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('NPI'); ?></label>
|
|
<input type="text" class="form-control" id="npi" minlength="10" maxlength="10" name="npi" onBlur="check_npi(this.value)" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('npi');
|
|
}
|
|
if (!empty($user->npi)) {
|
|
echo $user->npi;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('name'); ?></label>
|
|
<input type="text" class="form-control" name="name" id="name" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('name');
|
|
}
|
|
if (!empty($user->name)) {
|
|
echo $user->name;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Address'); ?></label>
|
|
<input type="text" class="form-control" name="address" id="address" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('address');
|
|
}
|
|
if (!empty($user->address)) {
|
|
echo $user->address;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Country'); ?></label>
|
|
<input type="text" class="form-control" id="country" name="country" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('country');
|
|
}
|
|
if (!empty($user->country)) {
|
|
echo $user->country;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('City'); ?></label>
|
|
<input type="text" class="form-control" name="city" id="city" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('city');
|
|
}
|
|
if (!empty($user->city)) {
|
|
echo $user->city;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Zipcode'); ?></label>
|
|
<input type="text" class="form-control" name="zipcode" id="zipcode" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('zipcode');
|
|
}
|
|
if (!empty($user->zipcode)) {
|
|
echo $user->zipcode;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('phone'); ?></label>
|
|
<input type="text" id="phone" class="form-control" name="phone" onkeyup="formatPhoneNumber(this.value,this)" onBlur="formatPhoneNumber(this.value,this)" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('phone');
|
|
}
|
|
if (!empty($user->phone)) {
|
|
echo $user->phone;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Fax'); ?></label>
|
|
<input type="text" class="form-control" name="fax" onkeyup="formatPhoneNumber(this.value,this)" onBlur="formatPhoneNumber(this.value,this)" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('fax');
|
|
}
|
|
if (!empty($user->fax)) {
|
|
echo $user->fax;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4">
|
|
<label class="required-field" for="exampleInputEmail1"><?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($user->email)) {
|
|
echo $user->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('password'); ?></label>
|
|
<!-- <div class="input-group"> -->
|
|
<input type="password" class="form-control" name="password" id="password"minlength="5" maxlength="10" placeholder="********"
|
|
<?php
|
|
if (empty($user->id))
|
|
echo 'required';
|
|
?>
|
|
>
|
|
<div class="input-group-append" id="passcheckTab" style="display: none;">
|
|
<span class="input-group-text" >
|
|
<span id="passChecking" style="display: none"><i class="la la-hourglass-start" style="color: blue;"></i></span>
|
|
<span id="passErrMin" style="display: none"><i class="la la" style="color: red;">Password must contain atleast 5 characters</i></span>
|
|
<span id="passErrMax" style="display: none"><i class="la la" style="color: red;">Password must contain less than 10 characters</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('Licenses'); ?></label>
|
|
<input type="text" class="form-control" name="licenses" id="license" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('licenses');
|
|
}
|
|
if (!empty($user->licenses)) {
|
|
echo $user->licenses;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Primary'); ?></label>
|
|
<div class="col-md-6">
|
|
<div class="row">
|
|
<div class="form-check col-md-6">
|
|
<input class="form-check-input" type="radio" id="primary" name="isPrimary" value="true" <?php if ($user->isPrimary==1) {
|
|
echo "checked"; } ?> >
|
|
<label class="form-check-label" for="live_with_patient_yes" >Yes</label>
|
|
</div>
|
|
<div class="form-check col-md-6">
|
|
<input class="form-check-input" type="radio" name="isPrimary" value="false" <?php if ($user->isPrimary==0) {
|
|
echo "checked"; } ?> >
|
|
<label class="form-check-label" for="live_with_patient_no">No</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Affiliation'); ?></label>
|
|
<input type="text" class="form-control" name="affiliation" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('affiliation');
|
|
}
|
|
if (!empty($user->affiliation)) {
|
|
echo $user->affiliation;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
<div class="form-group col-md-12">
|
|
<label for="exampleInputEmail1" class="required-field"><?php echo lang('Notes'); ?></label>
|
|
<input type="text" class="form-control" name="notes" value='<?php
|
|
if (!empty($setval)) {
|
|
echo set_value('notes');
|
|
}
|
|
if (!empty($user->notes)) {
|
|
echo $user->notes;
|
|
}
|
|
?>' placeholder="" required>
|
|
</div>
|
|
</div>
|
|
<div class="btn-group">
|
|
<button type="submit" id="npi_submit" name="submit" class="btn btn-default"><?php echo lang('submit'); ?></button>
|
|
<a class="btn btn-info btn-min-width" title="<?php echo lang('Back'); ?>" href="<?php echo base_url(); ?>physician">
|
|
<i class="fa fa-undo" aria-hidden="true"></i> <?php echo lang('Back'); ?>
|
|
</a>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<?php
|
|
if(isset($_SESSION['feedback'])){
|
|
?>
|
|
<script>
|
|
$(function(){
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: '<?php echo $_SESSION['feedback']; ?>',
|
|
showConfirmButton: false,
|
|
timer: 2000
|
|
})
|
|
})
|
|
</script>
|
|
<?php
|
|
unset($_SESSION['feedback']);
|
|
}
|
|
?>
|
|
<script type="text/javascript">
|
|
function isNumberKey(evt){
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode
|
|
if (charCode > 31 && (charCode < 48 || charCode > 57))
|
|
return false;
|
|
return true;
|
|
}
|
|
$( document ).ready(function() {
|
|
var npi_no=$("input[name=npi]").val();
|
|
if(npi_no==""){
|
|
$('#npi_submit').prop('disabled',true);
|
|
}
|
|
|
|
});
|
|
|
|
|
|
$("#email").blur(function(){
|
|
//alert('1');
|
|
var email=this.value;
|
|
// alert(email);
|
|
if(email!=''){
|
|
$("#emailcheckTab").show();
|
|
$("#emailChecking").show();
|
|
$("#emailAvailable").hide();
|
|
$("#emailNA").hide();
|
|
$("#submitBtn").prop('disabled', true);
|
|
|
|
$.ajax({
|
|
url:'<?php echo base_url(); ?>physician/checkEmail?phyid=<?php echo $phyid?>',
|
|
type:'GET',
|
|
data:{email:email},
|
|
beforeSend: function(){
|
|
$("#emailcheckTab").show();
|
|
$("#emailChecking").show();
|
|
$("#emailAvailable").hide();
|
|
$("#emailNA").hide();
|
|
},
|
|
success:function(data){
|
|
// alert(data);
|
|
// console.log(data);
|
|
if(data){
|
|
$("#emailAvailable").show();
|
|
$("#emailNA").hide();
|
|
$("#submitBtn").prop('disabled', false);
|
|
}else{
|
|
$("#emailAvailable").hide();
|
|
$("#emailNA").show();
|
|
}
|
|
$("#emailcheckTab").show();
|
|
$("#emailChecking").hide();
|
|
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#password").blur(function(){
|
|
|
|
var password=this.value;
|
|
// alert(password);
|
|
if(password!=''){
|
|
var pass=$.trim(password);
|
|
// $("#passcheckTab").show();
|
|
if(pass.length<5){
|
|
$("#passcheckTab").show();
|
|
$("#passErrMin").show();
|
|
|
|
}else if(pass.length>10){
|
|
$("#passcheckTab").show();
|
|
$("#passErrMax").show();
|
|
}else{
|
|
$("#passcheckTab").hide();
|
|
$("#passErrMin").hide();
|
|
$("#passErrMax").hide();
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
function check_npi(){
|
|
// alert;
|
|
var npi=$('#npi').val();
|
|
if(npi!=""){
|
|
$.ajax({
|
|
url:'<?php echo base_url(); ?>physician/checkNpi?phyid=<?php echo $phyid?>',
|
|
type:"GET",
|
|
data:{npi:npi},
|
|
dataType: "json",
|
|
beforeSend: function() {
|
|
$("#check_phyReg").hide();
|
|
$("#check_loader").show();
|
|
},
|
|
success:function(data){
|
|
console.log(data.status);
|
|
if(data.status == "success"){
|
|
$('#name').val(data.name);
|
|
$('#address').val(data.address);
|
|
$('#country').val(data.country);
|
|
$('#city').val(data.city);
|
|
$('#phone').val(data.phone);
|
|
$('#primary').val(data.primary);
|
|
$('#license').val(data.license);
|
|
$('#zipcode').val(data.zipcode);
|
|
$('#npi_submit').prop('disabled',false);
|
|
if(data.primary == true){
|
|
$('#primary').prop('checked', true);
|
|
}
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: data.message,
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('address not found.');
|
|
$('#npi_submit').prop('disabled',true);
|
|
}
|
|
$("#check_loader").hide();
|
|
$("#check_phyReg").show();
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Enter NPI number.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('Enter street address and zipcode.');
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
function formatPhoneNumber(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
|
|
}
|
|
</script>
|
|
<!--main content end-->
|
|
<!--footer start-->
|