905 lines
28 KiB
PHP
905 lines
28 KiB
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>
|
||
|
|
||
|
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
|
||
|
<!-- End of breadcrumb -->
|
||
|
|
||
|
|
||
|
<div>
|
||
|
|
||
|
<form name="f1" method="post" id="flex_form_opd" action="">
|
||
|
<div id="flex1" style="width:100%">
|
||
|
</div>
|
||
|
<input type="hidden" name="flex_opd_id" id="flex_opd_id"/>
|
||
|
</form>
|
||
|
<form name="export_form" method="post" id="export_form" action="">
|
||
|
<input type="hidden" name="flex_employee_appointment_id" id="flex_employee_appointment_id"/>
|
||
|
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_guest_appointment.php"/>
|
||
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_guest_appointment.php"/>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div><!-- /.page-content -->
|
||
|
</div>
|
||
|
</div><!-- /.main-content -->
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
var w=screen.width*.90;
|
||
|
var h =screen.height*.42;
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'guest_appointment_history_script.php?guest_id=<?php echo $_REQUEST['flex_opd_id']?>',
|
||
|
type: "POST",
|
||
|
|
||
|
dataType: 'json',
|
||
|
colModel : [
|
||
|
{display: ' Sr', name : 'count', width : w*.02, sortable : false, align: 'left'},
|
||
|
{display: 'Appointment Date', name : 'id', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Ticket No', name : '', width : w*.05, sortable : true, align: 'left'},
|
||
|
{display: 'Guest Name', name : '', width : w*.08, sortable : true, align: 'left'},
|
||
|
{display: 'Associated Emp', name : '', width : w*.08, sortable : true, align: 'left'},
|
||
|
{display: 'Complaints/ Injury Details', name : 'emp_code', width : w*.12, sortable : true, align: 'left'},
|
||
|
{display: 'Examination Findings', name : 'emp_fname', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Diagnosis/ Injury Type', name : 'emp_fname', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Treatments', name : '', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Referral', name : 'father_name', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Follow-up', name : 'gender', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: 'Emergency', name : '', width : w*.05, sortable : true, align: 'left'},
|
||
|
{display: 'Injury', name : '', width : w*.05, sortable : true, align: 'left'},
|
||
|
{display: 'Check-Up Results', name : '', width : w*.05, sortable : false, align: 'left'},
|
||
|
{display: 'Remarks', name : 'blood_group', width : w*.1, sortable : true, align: 'left'},
|
||
|
{display: '', name : 'link', width : w*.15, sortable : false, align: 'left'}
|
||
|
],
|
||
|
buttons : [
|
||
|
|
||
|
{name: 'PDF', bclass: 'print', onpress : pdf},
|
||
|
{separator: true},
|
||
|
{name: 'Excel', bclass: 'print_excel', onpress : excel},
|
||
|
{separator: true}
|
||
|
],
|
||
|
searchitems : [
|
||
|
//{display: 'Appointment Id', name : 'appointment_id',isdefault: true},
|
||
|
|
||
|
{display: 'Ticket No', name : 'ticket_no',isdefault: true},
|
||
|
{display: 'Appointment Date (dd/mm/yyyy)', name : 'appointment_date'},
|
||
|
{display: 'Appointment Date Between (dd/mm/yyyy-dd/mm/yyyy)', name : 'appointment_date_between'},
|
||
|
|
||
|
{display: 'Complaints', name : 'complaints',},
|
||
|
{display: 'Examination Findings', name : 'examination_remarks'},
|
||
|
{display: 'Diagnosis', name : 'ailment_name'},
|
||
|
{display: 'Treatments', name : 'hospital_treatment'},
|
||
|
{display: 'Emergency (Y/N)', name : 'IsEmergency'},
|
||
|
{display: 'Injury (Y/N)', name : 'appointment_type'},
|
||
|
{display: 'Remarks', name : 'remarks'},
|
||
|
|
||
|
],
|
||
|
sortname: "appointment_id",
|
||
|
sortorder: "asc",
|
||
|
usepager: true,//pagination
|
||
|
//title:"Employee OPD",
|
||
|
useRp: true,
|
||
|
rp: 50,//records per page
|
||
|
showTableToggleBtn: false,//toggle button for the whole table
|
||
|
resizable: true,
|
||
|
// width: w,
|
||
|
height: h,
|
||
|
singleSelect: true
|
||
|
});
|
||
|
});
|
||
|
function add(){
|
||
|
$("#appointment_id").val("");
|
||
|
$("#appointment_date1").val("");
|
||
|
$("#complaints_appointment").val("");
|
||
|
$("#examination_remarks_appointment").val("");
|
||
|
$("#isEmergency_appointment").val("");
|
||
|
$("#ailment_appointment").val("");
|
||
|
$("#followup_appointment").val("");
|
||
|
$("#referral_appointment").val("");
|
||
|
$("#remarks_appointment").val("");
|
||
|
$("#isEmergency1").val("");
|
||
|
$('#modal-add-guestAppointment').modal("show");
|
||
|
}
|
||
|
function pdf(){
|
||
|
window.open('ajax_pdf.php','Opd/Injury List');
|
||
|
}
|
||
|
function excel(){
|
||
|
window.open('ajax_excel.php','Opd/Injury List');
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function validate(){
|
||
|
|
||
|
|
||
|
var appointment_date = $('#appointment_date').val();
|
||
|
if(appointment_date == ''){
|
||
|
BootstrapDialog.alert('Please Enter Appointment Name.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
var complaints = $('#complaints').val();
|
||
|
if(complaints == ''){
|
||
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
var counter=$("#count_treatment_item").val();
|
||
|
for(var i=0;i<counter;i++){
|
||
|
var treatment_qty=$("#treatment_item_total_"+i).val();
|
||
|
var issued_qty=$("#treatment_item_qtygvn_"+i).val();
|
||
|
if(issued_qty==null || issued_qty==''){
|
||
|
issued_qty=0;
|
||
|
}
|
||
|
if(issued_qty>treatment_qty){
|
||
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
save_guest_appointment();
|
||
|
}
|
||
|
|
||
|
function getItemDetails(item_id, current_stock_field,current_stock_field_div, current_rate_field,current_rate_field_div, appointment_id, counter){
|
||
|
|
||
|
$.ajax({
|
||
|
url : 'select_item.php?item_id='+item_id,
|
||
|
type : "GET",
|
||
|
//data : $("#"+formId).serialize(),
|
||
|
success : function(data) {
|
||
|
var data = $.parseJSON(data);
|
||
|
if(data.current_stock_level>1){
|
||
|
|
||
|
$("#"+current_stock_field).val(data.current_stock_level);
|
||
|
document.getElementById(current_stock_field_div+"").innerText=data.current_stock_level;
|
||
|
$("#"+current_rate_field).val(data.current_rate);
|
||
|
if(counter!=undefined){
|
||
|
document.getElementById(current_rate_field_div+"").innerText =data.current_rate;
|
||
|
}
|
||
|
|
||
|
//alert(data);
|
||
|
//if(data.qty!=null){
|
||
|
}else{
|
||
|
|
||
|
BootstrapDialog.alert('This item is not available in stock.');
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//}
|
||
|
|
||
|
//BootstrapDialog.alert('Injury Details Updated Successfully.');
|
||
|
//location.reload();
|
||
|
//return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error pulling Item Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function save_guest_appointment(){
|
||
|
// var file_data = $('#photo').prop('files')[0];
|
||
|
//var form_data = ;
|
||
|
//form_data.append('photo', file_data);
|
||
|
|
||
|
$.ajax({
|
||
|
url : 'save_guest_appointment.php',
|
||
|
type : "POST",
|
||
|
data : $("#opd_form").serialize(),
|
||
|
success : function(data) {
|
||
|
var data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
if($("#appointment_id").val()==""){
|
||
|
var history_record= $("#history_record").text();
|
||
|
|
||
|
$('#history_record').text(parseInt(history_record)+1);
|
||
|
}
|
||
|
if(data[0].appointment_id!=null){
|
||
|
$("#appointment_id").val(data[0].appointment_id);
|
||
|
// $("#appointment_id_pdf").val(data[0].appointment_id);
|
||
|
}
|
||
|
if(data[1]!=null && data[1]!=""){
|
||
|
for(var i=0;i<data[1].length;i++){
|
||
|
$("#treatment_id_"+i).val(data[1][i]);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
$('#flex1').flexReload();
|
||
|
BootstrapDialog.alert('Details Saved Successfully.');
|
||
|
|
||
|
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function updateTotalMedicineQty(frequency_qty_fieild,treatment_item_days_fieild,treatment_item_total_fieild,treatment_item_total_fieild_div)
|
||
|
{
|
||
|
frequency_qty = $("#"+frequency_qty_fieild).val();
|
||
|
treatment_item_days=$("#"+treatment_item_days_fieild).val();
|
||
|
if(treatment_item_days==null || treatment_item_days=='' || treatment_item_days==0){
|
||
|
treatment_item_days =1;
|
||
|
}
|
||
|
$("#"+treatment_item_total_fieild).val(treatment_item_days*frequency_qty);
|
||
|
document.getElementById(treatment_item_total_fieild_div+"").innerText =treatment_item_days*frequency_qty;
|
||
|
}
|
||
|
|
||
|
|
||
|
function validate_update(formId, appointment_id){
|
||
|
var appointment_date = $('#appointment_date'+appointment_id).val();
|
||
|
if(appointment_date == ''){
|
||
|
BootstrapDialog.alert('Please Enter Appointment Name.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
var complaints = $('#complaints'+appointment_id).val();
|
||
|
if(complaints == ''){
|
||
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
var counter=$("#count_treatment_item").val();
|
||
|
for(var i=0;i<counter;i++){
|
||
|
var treatment_qty=$("#treatment_item_total_"+i).val();
|
||
|
var issued_qty=$("#treatment_item_qtygvn_"+i).val();
|
||
|
if(issued_qty==null || issued_qty==''){
|
||
|
issued_qty=0;
|
||
|
}
|
||
|
if(issued_qty>treatment_qty){
|
||
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
update_appointment(formId, appointment_id);
|
||
|
}
|
||
|
function update_appointment(formId, appointment_id){
|
||
|
$.ajax({
|
||
|
url : 'save_guest_appointment.php',
|
||
|
type : "POST",
|
||
|
data : $("#"+formId).serialize(),
|
||
|
success : function(data) {
|
||
|
BootstrapDialog.show({
|
||
|
message: 'Details Updated Successfully.',
|
||
|
buttons: [ {
|
||
|
label: 'OK',
|
||
|
action: function(dialogItself){
|
||
|
dialogItself.close();
|
||
|
window.location.reload();
|
||
|
|
||
|
|
||
|
}
|
||
|
}]
|
||
|
});
|
||
|
|
||
|
//window.location.reload();
|
||
|
|
||
|
return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Updating Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
//window.location.reload();
|
||
|
}
|
||
|
|
||
|
function getFrequenceyQty(frequency_id, qty_value_field_id, dosage_desc_field_id, appointment_id, counter){
|
||
|
|
||
|
$.ajax({
|
||
|
url : 'select_frequency.php?frequency_id='+frequency_id,
|
||
|
type : "GET",
|
||
|
//data : $("#"+formId).serialize(),
|
||
|
async:false,
|
||
|
success : function(data) {
|
||
|
var data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
if(data.qty!=null){
|
||
|
$("#"+qty_value_field_id).val(data.qty);
|
||
|
$("#"+dosage_desc_field_id).val(data.frequency_description);
|
||
|
|
||
|
}
|
||
|
|
||
|
//BootstrapDialog.alert('Injury Details Updated Successfully.');
|
||
|
//location.reload();
|
||
|
//return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error pulling frequency qty');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
});
|
||
|
updateTotalMedicineQty('frequency_qty'+'_'+counter,'treatment_item_days'+'_'+counter,'treatment_item_total'+'_'+counter,'treatment_item_total_div'+counter)
|
||
|
}
|
||
|
|
||
|
function getItemDetails(item_id, current_stock_field,current_stock_field_div, current_rate_field,current_rate_field_div, appointment_id, counter,e){
|
||
|
|
||
|
$.ajax({
|
||
|
url : 'select_item.php?item_id='+item_id,
|
||
|
type : "GET",
|
||
|
//data : $("#"+formId).serialize(),
|
||
|
success : function(data) {
|
||
|
var data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
//if(data.qty!=null){
|
||
|
if(e=='edit'){
|
||
|
$("#"+current_stock_field).val(data.current_stock_level)
|
||
|
document.getElementById(current_stock_field_div+"").innerText=data.current_stock_level;
|
||
|
$("#"+current_rate_field).val(data.current_rate);
|
||
|
if(typeof(counter)!='undefined' && counter != null){
|
||
|
document.getElementById(current_rate_field_div+"").innerText =data.current_rate;
|
||
|
}
|
||
|
|
||
|
|
||
|
}else if(data.current_stock_level>1){
|
||
|
|
||
|
$("#"+current_stock_field).val(data.current_stock_level)
|
||
|
document.getElementById(current_stock_field_div+"").innerText=data.current_stock_level;
|
||
|
$("#"+current_rate_field).val(data.current_rate);
|
||
|
if(typeof(counter)!='undefined' && counter != null){
|
||
|
document.getElementById(current_rate_field_div+"").innerText =data.current_rate;
|
||
|
}
|
||
|
|
||
|
}else{
|
||
|
|
||
|
BootstrapDialog.alert('This Item is not available in stock.');
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//}
|
||
|
|
||
|
//BootstrapDialog.alert('Injury Details Updated Successfully.');
|
||
|
//location.reload();
|
||
|
//return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error pulling Item Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/*var url='opd_form.php?employeeId='+employeeId;
|
||
|
alert(url);
|
||
|
window.location =url;*/
|
||
|
function opd_form(id){
|
||
|
$("#flex_opd_id").val(id);
|
||
|
$("#flex_form_opd_for").attr('method', 'POST');
|
||
|
$("#flex_form_opd_for").attr('action', 'opd_form.php');
|
||
|
$("#flex_form_opd_for").submit();
|
||
|
|
||
|
}
|
||
|
|
||
|
function setFieldDisableOrEnable(value){
|
||
|
var count=$("#count_treatment_item").val();
|
||
|
if(value=='Y'){
|
||
|
// $("[name='field07']").prop("disabled", false);
|
||
|
for(var i=0;i<count;i++){
|
||
|
$("#treatment_item_qtygvn_"+i).prop("disabled", false);
|
||
|
}
|
||
|
}else if(value=='N'){
|
||
|
|
||
|
for(var i=0;i<count;i++){
|
||
|
$("#treatment_item_qtygvn_"+i).prop("disabled", true);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function checkQty(){
|
||
|
|
||
|
|
||
|
var counter=$("#count_treatment_item").val();
|
||
|
for(var i=0;i<counter;i++){
|
||
|
var treatment_qty=$("#treatment_item_total_"+i).val();
|
||
|
var issued_qty=$("#treatment_item_qtygvn_"+i).val();
|
||
|
if(issued_qty==null || issued_qty==''){
|
||
|
issued_qty=0;
|
||
|
}
|
||
|
if(issued_qty>treatment_qty){
|
||
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
function toCheckItemStock(){
|
||
|
|
||
|
var counter=$("#count_treatment_item").val();
|
||
|
for(var i=0;i<counter;i++){
|
||
|
var treatment_qty=$("#treatment_item_total_"+i).val();
|
||
|
var issued_qty=$("#treatment_item_qtygvn_"+i).val();
|
||
|
if(issued_qty==null || issued_qty==''){
|
||
|
issued_qty=0;
|
||
|
}
|
||
|
if(issued_qty>treatment_qty){
|
||
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
function delete_guest_appointment_history(guest_appointment_id){
|
||
|
//$("#flex_appointment_id").val(guest_appointment_id);
|
||
|
|
||
|
BootstrapDialog.confirm('Are you sure to delete?', function(result){
|
||
|
if(result) {
|
||
|
$.ajax({
|
||
|
url : 'delete_guest_appointment.php',
|
||
|
type : "POST",
|
||
|
data : {flex_appointment_id:guest_appointment_id},
|
||
|
success : function(data) {
|
||
|
if(data.indexOf("SUCCESS")!=-1){
|
||
|
BootstrapDialog.alert('Deleted Successfully.');
|
||
|
var history_record= $("#history_record").text();
|
||
|
|
||
|
$('#history_record').text(parseInt(history_record)-1);
|
||
|
$("#flex1").flexReload();
|
||
|
//loadAppointmentHistory('<?php echo $_REQUEST['flex_opd_id']?>');
|
||
|
|
||
|
}else{
|
||
|
BootstrapDialog.alert('Error Deleting');
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
function itemLevelTotol(treatment_item_qtygvn_field,current_rate_field,treatment_item_total_amount_field,treatment_item_total_amount_field_div){
|
||
|
var appointment_id='<?php echo $row['appointment_id']?>'
|
||
|
var count= $("#count_treatment_item").val();
|
||
|
//alert(count);
|
||
|
var price=$("#"+current_rate_field).val();
|
||
|
var qty=$("#"+treatment_item_qtygvn_field).val();
|
||
|
var totalValue=price*qty;
|
||
|
///alert(totalValue);
|
||
|
$("#"+treatment_item_total_amount_field).val(totalValue);
|
||
|
document.getElementById(treatment_item_total_amount_field_div+"").innerText=totalValue;
|
||
|
|
||
|
orderLevelTotal(count);
|
||
|
}
|
||
|
|
||
|
function orderLevelTotal(count){
|
||
|
var totalAmount=0;
|
||
|
var appointment_id='<?php echo $row['appointment_id']?>'
|
||
|
//totalAmount=totalAmount+parseInt(treatment_item_total_amount_field_value);
|
||
|
for(var i=0;i<parseInt(count);i++){
|
||
|
if($("#treatment_item_total_amount"+'_'+i).val()!="")
|
||
|
totalAmount=totalAmount+parseInt($("#treatment_item_total_amount"+'_'+i).val());
|
||
|
}
|
||
|
|
||
|
//alert(totalAmount);
|
||
|
$("#order_level_total").val(totalAmount);
|
||
|
|
||
|
document.getElementById("order_level_total_div").innerText=totalAmount;
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function updateTotalMedicineQty(frequency_qty_fieild,treatment_item_days_fieild,treatment_item_total_fieild,treatment_item_total_fieild_div)
|
||
|
{
|
||
|
frequency_qty = parseInt($("#"+frequency_qty_fieild).val());
|
||
|
treatment_item_days=parseInt($("#"+treatment_item_days_fieild).val());
|
||
|
if(treatment_item_days==null || treatment_item_days=='' || treatment_item_days==0){
|
||
|
treatment_item_days =1;
|
||
|
}
|
||
|
$("#"+treatment_item_total_fieild).val(treatment_item_days*frequency_qty);
|
||
|
document.getElementById(treatment_item_total_fieild_div+"").innerText =treatment_item_days*frequency_qty;
|
||
|
}
|
||
|
|
||
|
function updatePrice(qty_issued_field, item_id_field,current_rate_field,current_stock_field,price_field){
|
||
|
|
||
|
qty_issued = $("#"+qty_issued_field).val();
|
||
|
item_id = $("#"+item_id_field).val();
|
||
|
current_rate = $("#"+current_rate_field).val();
|
||
|
current_stock = $("#"+current_stock_field).val();
|
||
|
if(parseFloat(current_stock)<parseFloat(qty_issued)){
|
||
|
BootstrapDialog.alert('You trying to issue more than the available qty. Available:'+current_stock+", issued qty:"+qty_issued);
|
||
|
|
||
|
}
|
||
|
price = $("#"+price_field).val(qty_issued*current_rate);
|
||
|
|
||
|
|
||
|
}
|
||
|
/* function validate(){
|
||
|
var appointment_date = $('#appointment_date').val();
|
||
|
if(appointment_date == ''){
|
||
|
BootstrapDialog.alert('Please Enter Appointment Name.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
var complaints = $('#complaints').val();
|
||
|
if(complaints == ''){
|
||
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
save_appointment();
|
||
|
} */
|
||
|
|
||
|
function exporttopdf(){
|
||
|
|
||
|
document.forms['pdfform'].action="opd_form_pdf.php";
|
||
|
document.forms['pdfform'].method="post";
|
||
|
document.forms['pdfform'].submit();
|
||
|
}
|
||
|
function save_appointment(){
|
||
|
$.ajax({
|
||
|
url : 'save_opd.php',
|
||
|
type : "POST",
|
||
|
data : $("#opd_form").serialize(),
|
||
|
success : function(data) {
|
||
|
var data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
if(data[0].appointment_id!=null){
|
||
|
$("#appointment_id").val(data[0].appointment_id);
|
||
|
$("#appointment_id_pdf").val(data[0].appointment_id);
|
||
|
}
|
||
|
if(data[1]!=null && data[1]!=""){
|
||
|
for(var i=0;i<data[1].length;i++){
|
||
|
$("#treatment_id_"+i).val(data[1][i]);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
BootstrapDialog.alert('Details Saved Successfully.');
|
||
|
window.location.reload();
|
||
|
//loadAppointmentHistory('<?php echo $_REQUEST['flex_opd_id']?>');
|
||
|
//return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Details');
|
||
|
//return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
var employee_id = "";
|
||
|
function open_guest_appointment_history(appointment_id, action) {
|
||
|
var id = "";
|
||
|
if(action=="V"){
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
}else{
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url : 'select_guest_appointment.php?appointment_id='+appointment_id+' ',
|
||
|
type : 'POST',
|
||
|
|
||
|
success : function(data) {
|
||
|
//alert(data);
|
||
|
data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
|
||
|
$("#employee_id").val(data.appointment_id);
|
||
|
$("#appointment_date1").val(data.appointment_date);
|
||
|
$("#complaints_appointment").val(data.complaints);
|
||
|
$("#examination_remarks_appointment").val(data.examination_remarks);
|
||
|
$("#isEmergency_appointment").val(data.IsEmergency);
|
||
|
$("#ailment_appointment").val(myDateFormater(data.ailment_ids));
|
||
|
$("#ailment_system").val(data.ailment_system_ids);
|
||
|
//$("#treatment_item").val(data.treatment_item);
|
||
|
$("#treatment_item_dosage0").val(data.treatment_item_dosage0);
|
||
|
$("#treatment_item_days0").val(data.treatment_item_days0);
|
||
|
$("#treatment_item_total0").val(data.treatment_item_total0);
|
||
|
$("#treatment_item_qtygvn0").val(data.treatment_item_qtygvn0);
|
||
|
$("#treatment_item_remarks").val(data.treatment_item_remarks);
|
||
|
$("#referral_appointment").val(data.referral);
|
||
|
$("#followup_appointment").val(data.followup);
|
||
|
$("#remarks_appointment").val(data.remarks);
|
||
|
$("#injury_part").val(data.injury_part);
|
||
|
$("#health_advice").val(data.health_advice);
|
||
|
$("#fname").val(data.appointment_date);
|
||
|
$("#lname").val(data.complaints);
|
||
|
$('#modal-add-guestAppointment').modal("show");
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Populating User');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
</script>
|
||
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
||
|
|
||
|
<!-- page specific plugin styles -->
|
||
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/chosen.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
|
||
|
<script type="text/javascript" src="js/typeahead.bundle.js"></script>
|
||
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
||
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
||
|
<script src="assets/js/chosen.jquery.min.js"></script>
|
||
|
<script src="assets/js/spinbox.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-timepicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
|
||
|
<script src="assets/js/dataTables.buttons.min.js"></script>
|
||
|
<script src="assets/js/buttons.flash.min.js"></script>
|
||
|
<script src="assets/js/buttons.html5.min.js"></script>
|
||
|
<script src="assets/js/buttons.print.min.js"></script>
|
||
|
<script src="assets/js/buttons.colVis.min.js"></script>
|
||
|
<script src="assets/js/dataTables.select.min.js"></script>
|
||
|
|
||
|
|
||
|
<script src="assets/js/moment.min.js"></script>
|
||
|
<script src="assets/js/daterangepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.knob.min.js"></script>
|
||
|
<script src="assets/js/autosize.min.js"></script>
|
||
|
<script src="assets/js/jquery.inputlimiter.min.js"></script>
|
||
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-tag.min.js"></script>
|
||
|
<script src="assets/js/ace-elements.min.js"></script>
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
|
||
|
<script>
|
||
|
function myDateFormater(myDate){
|
||
|
var d=new Date(myDate);
|
||
|
var m=d.getMonth()+1;
|
||
|
var y=d.getFullYear();
|
||
|
var date=d.getDate();
|
||
|
// alert(date+"/"+m+"/"+y);
|
||
|
return date+"/"+m+"/"+y;
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
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');
|
||
|
});
|
||
|
/***************/
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
//add horizontal scrollbars to a simple table
|
||
|
$('#simple-table').css({'width':'2000px', 'max-width': 'none'}).wrap('<div style="width: 1000px;" />').parent().ace_scroll(
|
||
|
{
|
||
|
horizontal: true,
|
||
|
styleClass: 'scroll-top scroll-dark scroll-visible',//show the scrollbars on top(default is bottom)
|
||
|
size: 2000,
|
||
|
mouseWheelLock: true
|
||
|
}
|
||
|
).css('padding-top', '12px');
|
||
|
*/
|
||
|
|
||
|
|
||
|
})
|
||
|
|
||
|
|
||
|
$('#doj').datepicker({
|
||
|
autoclose:true,
|
||
|
format: 'dd/mm/yyyy',
|
||
|
startDate: '1d/1m/2000y',
|
||
|
endDate: 'current',
|
||
|
todayHighlight: true
|
||
|
}).next().on(ace.click_event, function(){
|
||
|
$(this).prev().focus();
|
||
|
});
|
||
|
$('#dob').datepicker({
|
||
|
autoclose:true,
|
||
|
format: 'dd/mm/yyyy',
|
||
|
startDate: '1d/1m/1970y',
|
||
|
|
||
|
}).next().on(ace.click_event, function(){
|
||
|
$(this).prev().focus();
|
||
|
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
|
||
|
|
||
|
|