318 lines
10 KiB
PHP
318 lines
10 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try{ace.settings.loadState('main-container')}catch(e){}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
<?php
|
|
if(isset($_POST['flex_opd_id'])){
|
|
$id = $_POST['flex_opd_id'];
|
|
$query = "select * from guest_patient where id = '".$id."' ";
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
exit(mysqli_error($conn));
|
|
|
|
} else{
|
|
$row=@mysqli_fetch_array($result);
|
|
@extract($row);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
?>
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li>
|
|
<i class="ace-icon fa fa-home home-icon"></i>
|
|
<a href="#">Home</a>
|
|
</li>
|
|
<li class="#">Patient Visit</li><li class="active">Guest OPD Visit</li><li class="success"><label class="blue"><?php echo $fname?> <?php echo $lname?></label></li>
|
|
</ul>
|
|
<div class="nav-search" id="nav-search" style="width:170px;">
|
|
<form id="flex_form_opd">
|
|
<input type="hidden" name="opd_id" id="flex_opd_id">
|
|
<select class="chosen-select form-control" id="emp_list"name="emp_list" data-placeholder="Goto Employee.." onchange="opd_form(this.value)">
|
|
<option></option>
|
|
<?php
|
|
$sql_emp="SELECT id, CONCAT(fname, ' ', lname, '-') AS guest_details FROM guest_patient order by fname";
|
|
generate_options($sql_emp,'','id','guest_details','id',$id);
|
|
?>
|
|
</select>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="widget-box">
|
|
<div class="widget-body">
|
|
<div class="widget-main">
|
|
<div class="row">
|
|
<div style="margin:5px;">
|
|
<div class="tabbable">
|
|
<ul class="nav nav-tabs" id="myTab">
|
|
<li class="active">
|
|
<a data-toggle="tab" href="#appointment" aria-expanded="false">
|
|
New OPD
|
|
<span class="badge badge-success">+</span>
|
|
</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a data-toggle="tab" href="#home" aria-expanded="false">
|
|
<i class="green ace-icon fa fa-user bigger-120"></i>
|
|
<?php echo $fname?>'s Profile
|
|
</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a data-toggle="tab" href="#history" aria-expanded="false">
|
|
History
|
|
<?php
|
|
$flex_opd_id=$_REQUEST['flex_opd_id'];
|
|
|
|
$sql="select count(*) as total from guest_appointment where guest_id='".$flex_opd_id."' and doctor_attended_flag='Y' ";
|
|
|
|
$result = mysqli_query($conn,$sql);
|
|
while($row = mysqli_fetch_array($result)){
|
|
$num_rows=$row['total'];
|
|
|
|
}
|
|
// $num_rows=@mysqli_num_rows($result);
|
|
if($num_rows=="" || $num_rows==null)
|
|
$num_rows=0;
|
|
?>
|
|
<span class="badge badge-danger" id="history_record"><?php echo $num_rows;?></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div id="appointment" class="tab-pane fade in active " >
|
|
<?php include('new_guest_opd.php'); ?>
|
|
</div>
|
|
<div id="home" class="tab-pane fade">
|
|
<?php include('guest_dashboard_embed.php'); ?>
|
|
</div>
|
|
<div id="history" class="tab-pane fade">
|
|
<?php include('guest_appointment_history.php'); ?>
|
|
</div>
|
|
</div>
|
|
</div><!--end tab table-->
|
|
</div><!--end of inner row-->
|
|
</div><!--end of widget-main -->
|
|
</div><!--end of inner widgetbody-->
|
|
</div><!--end of inner widgetbox-->
|
|
</div><!--end of xs-->
|
|
</div><!--end of inner widgetbody-->
|
|
</div>
|
|
|
|
|
|
|
|
</div><!--end of outer col-xs-12">-->
|
|
</div><!--end of outer row-->
|
|
</div>
|
|
|
|
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<script type="text/javascript">
|
|
function opd_form(id){
|
|
//alert(id);
|
|
if(id!=null && id!=''){
|
|
$("#flex_opd_id").val(id);
|
|
$("#flex_form_opd").attr('method', 'POST');
|
|
$("#flex_form_opd").attr('action', 'guest_opd_form.php');
|
|
$("#flex_form_opd").submit();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jQuery(function($) {
|
|
//initiate dataTables plugin
|
|
var myTable =
|
|
$('#dynamic-table')
|
|
//.wrap("<div class='dataTables_borderWrap' />") //if you are applying horizontal scrolling (sScrollX)
|
|
.DataTable( {
|
|
bAutoWidth: false,
|
|
"aoColumns": [
|
|
{ "bSortable": false },
|
|
null, null,null, null, null,
|
|
{ "bSortable": false }
|
|
],
|
|
"aaSorting": [],
|
|
|
|
|
|
//"bProcessing": true,
|
|
//"bServerSide": true,
|
|
//"sAjaxSource": "http://127.0.0.1/table.php" ,
|
|
|
|
//,
|
|
//"sScrollY": "200px",
|
|
//"bPaginate": false,
|
|
|
|
//"sScrollX": "100%",
|
|
//"sScrollXInner": "120%",
|
|
//"bScrollCollapse": true,
|
|
//Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
|
|
//you may want to wrap the table inside a "div.dataTables_borderWrap" element
|
|
|
|
//"iDisplayLength": 50
|
|
|
|
|
|
select: {
|
|
style: 'multi'
|
|
}
|
|
} );
|
|
|
|
|
|
|
|
//style the message box
|
|
var defaultCopyAction = myTable.button(1).action();
|
|
myTable.button(1).action(function (e, dt, button, config) {
|
|
defaultCopyAction(e, dt, button, config);
|
|
$('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white');
|
|
});
|
|
|
|
|
|
var defaultColvisAction = myTable.button(0).action();
|
|
myTable.button(0).action(function (e, dt, button, config) {
|
|
|
|
defaultColvisAction(e, dt, button, config);
|
|
|
|
|
|
if($('.dt-button-collection > .dropdown-menu').length == 0) {
|
|
$('.dt-button-collection')
|
|
.wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />')
|
|
.find('a').attr('href', '#').wrap("<li />")
|
|
}
|
|
$('.dt-button-collection').appendTo('.tableTools-container .dt-buttons')
|
|
});
|
|
|
|
////
|
|
|
|
setTimeout(function() {
|
|
$($('.tableTools-container')).find('a.dt-button').each(function() {
|
|
var div = $(this).find(' > div').first();
|
|
if(div.length == 1) div.tooltip({container: 'body', title: div.parent().text()});
|
|
else $(this).tooltip({container: 'body', title: $(this).text()});
|
|
});
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
|
|
myTable.on( 'select', function ( e, dt, type, index ) {
|
|
if ( type === 'row' ) {
|
|
$( myTable.row( index ).node() ).find('input:checkbox').prop('checked', true);
|
|
}
|
|
} );
|
|
myTable.on( 'deselect', function ( e, dt, type, index ) {
|
|
if ( type === 'row' ) {
|
|
$( myTable.row( index ).node() ).find('input:checkbox').prop('checked', false);
|
|
}
|
|
} );
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////
|
|
//table checkboxes
|
|
$('th input[type=checkbox], td input[type=checkbox]').prop('checked', false);
|
|
|
|
//select/deselect all rows according to table header checkbox
|
|
$('#dynamic-table > thead > tr > th input[type=checkbox], #dynamic-table_wrapper input[type=checkbox]').eq(0).on('click', function(){
|
|
var th_checked = this.checked;//checkbox inside "TH" table header
|
|
|
|
$('#dynamic-table').find('tbody > tr').each(function(){
|
|
var row = this;
|
|
if(th_checked) myTable.row(row).select();
|
|
else myTable.row(row).deselect();
|
|
});
|
|
});
|
|
|
|
//select/deselect a row when the checkbox is checked/unchecked
|
|
$('#dynamic-table').on('click', 'td input[type=checkbox]' , function(){
|
|
var row = $(this).closest('tr').get(0);
|
|
if(this.checked) myTable.row(row).deselect();
|
|
else myTable.row(row).select();
|
|
});
|
|
|
|
|
|
|
|
$(document).on('click', '#dynamic-table .dropdown-toggle', function(e) {
|
|
e.stopImmediatePropagation();
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
});
|
|
|
|
|
|
|
|
//And for the first simple table, which doesn't have TableTools or dataTables
|
|
//select/deselect all rows according to table header checkbox
|
|
var active_class = 'active';
|
|
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
|
|
var th_checked = this.checked;//checkbox inside "TH" table header
|
|
|
|
$(this).closest('table').find('tbody > tr').each(function(){
|
|
var row = this;
|
|
if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
|
|
else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
|
|
});
|
|
});
|
|
|
|
//select/deselect a row when the checkbox is checked/unchecked
|
|
$('#simple-table').on('click', 'td input[type=checkbox]' , function(){
|
|
var $row = $(this).closest('tr');
|
|
if($row.is('.detail-row ')) return;
|
|
if(this.checked) $row.addClass(active_class);
|
|
else $row.removeClass(active_class);
|
|
});
|
|
|
|
|
|
|
|
/********************************/
|
|
//add tooltip for small view action buttons in dropdown menu
|
|
$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
|
|
|
|
//tooltip placement on right or left
|
|
function tooltip_placement(context, source) {
|
|
var $source = $(source);
|
|
var $parent = $source.closest('table')
|
|
var off1 = $parent.offset();
|
|
var w1 = $parent.width();
|
|
|
|
var off2 = $source.offset();
|
|
//var w2 = $source.width();
|
|
|
|
if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
|
|
return 'left';
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
$('.show-details-btn').on('click', function(e) {
|
|
e.preventDefault();
|
|
$(this).closest('tr').next().toggleClass('open');
|
|
$(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass('fa-angle-double-up');
|
|
});
|
|
/***************/
|
|
|
|
|
|
|
|
})
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|