229 lines
10 KiB
PHP
Executable File

<!--sidebar end-->
<!--main content start-->
<div class="app-content content">
<section class="content-wrapper">
<div class="content-body">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-8"> <h3 class="font-weight-bold"><?php //echo lang('menu'); ?>
Caregiver Menu (To edit click on node)</h3></div>
<div class="col-md-4 no-print pull-right">
<!-- <a data-toggle="modal" href="#myModal"> -->
<a href="caregiver_menu/addNewView">
<div class="btn-group pull-right">
<button id="" class="btn green btn-xs">
<i class="fa fa-plus-circle"></i> <?php echo lang('add_new'); ?>
</button>
</div>
</a>
</div>
</div>
</div>
<hr class="mt-0 mb-0" />
<div class="card-body">
<div class="row">
<div class="col-md-12">
<section id="main-content">
<section class="wrapper site-min-height">
<!-- page start-->
<section class="panel">
<div class="panel-body">
<div class="col-lg-12" id="jstree_demo_div">
<?php foreach ($permission as $p) { ?>
<ul class="treeview">
<?php if($p->parent_id==0){ ?>
<li class="last" id="<?php echo $p->id ;?>" >
<label for="<?php echo $p->id ;?>" >
<?php echo $p->name ;?> <?php //echo '(Url:'.$p->url.')' ;?> </label>
<?php //if(isset($p->child)){ ?>
<ul>
<?php foreach ($permission as $cp) { ?>
<?php if($cp->parent_id==$p->id){ ?>
<li id="<?php echo $cp->id ;?>" >
<label for="<?php echo $cp->id ;?>"><?php echo $cp->name ;?><?php //echo '(Url:'.$cp->url.')' ;?></label>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php //} ?>
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
</section>
<!-- page end-->
</section>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!--main content end-->
<!--footer start-->
<script>
$(function () {
// var select=<?php echo json_encode($permission); ?>;
// $('#jsfields').val(select);
// var i, j, r = [],q=[];
$('#jstree_demo_div')
// .on('changed.jstree', function (e, data) {
// $('#jsfields').val(data.selected);
// })
.on("select_node.jstree", function (e, data) {
//alert("node_id: " + data.node.id);
location.href = 'caregiver_menu/editPermission?id='+ data.node.id;
})
// create the instance
.jstree({
"plugins" : [ "themes", "html_data", "open_all", "sort", "ui" ]
})
.jstree('open_all');
});
</script>
<!-- <script src="common/js/codearistos.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".table").on("click", ".editbutton", function () {
// Get the record's ID via attribute
var iid = $(this).attr('data-id');
$("#img").attr("src", "uploads/cardiology-patient-icon-vector-6244713.jpg");
$('#editDoctorForm').trigger("reset");
$.ajax({
url: 'doctor/editDoctorByJason?id=' + iid,
method: 'GET',
data: '',
dataType: 'json',
}).success(function (response) {
// Populate the form fields with the data returned from server
$('#editDoctorForm').find('[name="id"]').val(response.doctor.id).end()
$('#editDoctorForm').find('[name="name"]').val(response.doctor.name).end()
$('#editDoctorForm').find('[name="password"]').val(response.doctor.password).end()
$('#editDoctorForm').find('[name="email"]').val(response.doctor.email).end()
$('#editDoctorForm').find('[name="address"]').val(response.doctor.address).end()
$('#editDoctorForm').find('[name="phone"]').val(response.doctor.phone).end()
$('#editDoctorForm').find('[name="department"]').val(response.doctor.department).end()
$('#editDoctorForm').find('[name="profile"]').val(response.doctor.profile).end()
if (typeof response.doctor.img_url !== 'undefined' && response.doctor.img_url != '') {
$("#img").attr("src", response.doctor.img_url);
}
$('.js-example-basic-single.department').val(response.doctor.department).trigger('change');
$('#myModal2').modal('show');
});
});
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$(".table").on("click", ".inffo", function () {
// Get the record's ID via attribute
var iid = $(this).attr('data-id');
$("#img1").attr("src", "uploads/cardiology-patient-icon-vector-6244713.jpg");
$('.nameClass').html("").end()
$('.emailClass').html("").end()
$('.addressClass').html("").end()
$('.phoneClass').html("").end()
$('.departmentClass').html("").end()
$('.profileClass').html("").end()
$.ajax({
url: 'doctor/editDoctorByJason?id=' + iid,
method: 'GET',
data: '',
dataType: 'json',
}).success(function (response) {
// Populate the form fields with the data returned from server
$('#editDoctorForm').find('[name="id"]').val(response.doctor.id).end()
$('.nameClass').append(response.doctor.name).end()
$('.emailClass').append(response.doctor.email).end()
$('.addressClass').append(response.doctor.address).end()
$('.phoneClass').append(response.doctor.phone).end()
$('.departmentClass').append(response.doctor.department).end()
$('.profileClass').append(response.doctor.profile).end()
if (typeof response.doctor.img_url !== 'undefined' && response.doctor.img_url != '') {
$("#img1").attr("src", response.doctor.img_url);
}
$('#infoModal').modal('show');
});
});
});
</script>
<script>
$(document).ready(function () {
var table = $('#editable-sample').DataTable({
responsive: true,
"processing": true,
"serverSide": true,
"searchable": true,
"ajax": {
url: "caregiver_menu/getPermission",
type: 'POST',
},
scroller: {
loadingIndicator: true
},
dom: "<'row'<'col-sm-3'l><'col-sm-5 text-center'B><'col-sm-4'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
'copyHtml5',
'excelHtml5',
'csvHtml5',
'pdfHtml5',
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6],
}
},
],
aLengthMenu: [
[10, 25, 50, 100, -1],
[10, 25, 50, 100, "All"]
],
iDisplayLength: 100,
"order": [[0, "desc"]],
"language": {
"lengthMenu": "_MENU_",
search: "_INPUT_",
"url": "common/assets/DataTables/languages/<?php echo $this->language; ?>.json"
}
});
table.buttons().container().appendTo('.custom_buttons');
});
</script>
<script>
$(document).ready(function () {
$(".flashmessage").delay(3000).fadeOut(100);
});
</script> -->