153 lines
4.2 KiB
PHP
Executable File

<!--sidebar end-->
<!--main content start-->
<section id="main-content">
<section class="wrapper site-min-height">
<!-- page start-->
<section class="row col-md-12">
<header class="panel-heading">
<?php
if (!empty($nurse->id))
echo lang('Edit Patient');
else
echo lang('Add Patient');
?>
</header>
<div class="panel-body col-md-12">
<div class="col-lg-3"></div>
<div class="col-lg-6">
<?php echo validation_errors(); ?>
<?php echo $this->session->flashdata('feedback'); ?>
</div>
<div class="col-lg-3"></div>
<div class="col-md-12">
<form role="form" action="patient_caregiver_mapping/addnew" method="post" enctype="multipart/form-data" name="newInsuranceFrom" >
<table class="table table-bordered table-dark">
<thead>
<tr>
<th scope="col">Co-ardinator</th>
<th scope="col">Patient</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<!-- choose cooardinator -->
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<!-- <label for="exampleInputEmail1"><?php echo lang('Coordinator'); ?></label> -->
<select class="form-control" name="Coardinator" id="Coardinator" onchange="getCooardinatorDet(this)">
<option value="" selected>Choose...</option>
<?php foreach ($CoardinatorData as $value) { ?>
<option value="<?=$value->id?>"><?=$value->name?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<!-- cooardinotr details table -->
<table class="table table-bordered table-dark" id="log">
</table>
</td>
<td>
<!-- patient details table -->
<table class="table table-bordered table-dark">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Address</th>
<th scope="col">Contact Details</th>
<th scope="col">Co-oardinator Name</th>
</tr>
</thead>
<tbody id="patientMapCOd">
<?php foreach ($Patientdata as $value) { ?>
<tr>
<th scope="row"><input type="checkbox" name="patient_list[]" value="<?=$value->id?>"></th>
<td><?=$value->first_name?> <?=$value->last_name?></td>
<td><?=$value->patient_email?></td>
<td><?=$value->address?></td>
</tr>
<?php } ?>
</tbody>
</table>
</td>
</tr>
<!-- submit box table -->
<tr>
<td colspan="2">
<button type="submit" name="submit" value="mapCP" class="btn btn-info"><?php echo lang('Submit'); ?></button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</section>
</section>
</section>
<script type="text/javascript">
function getCooardinatorDet(_this){
var codID = _this.value;
var request = $.ajax({
url: "patient_caregiver_mapping/CoradinatorDet",
type: "POST",
data: {id : codID},
dataType: "html"
});
request.done(function(msg) {
$("#log").html( msg );
});
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
});
var codID = _this.value;
var request = $.ajax({
url: "patient_caregiver_mapping/mappingDetailsPatient",
type: "POST",
data: {id : codID},
dataType: "html"
});
request.done(function(msg) {
console.log(msg);
$("#patientMapCOd").html( msg );
});
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
});
}
</script>