Add reminder javascript assed

This commit is contained in:
Olusesan Ameye
2021-02-28 17:04:52 -05:00
parent f654ffd6fd
commit 2e0efa58b5
6 changed files with 91 additions and 51 deletions
@@ -121,10 +121,10 @@ class Patient extends Provider_Controller {
case "REMINDERS":
//Reminder_model
$this->load->model('reminder_model');
$out = $this->reminder_model->getPatientReminderList($_SESSION['practice_id'], $data['patient_id']);
$out = $this->reminder_model->getPatientReminderList($_SESSION['practice_id'], $data['patient_id']);
$data["patient_reminder_list"] = $out["patient_reminder_list"];
$this->load->view('provider/patient/patientActions/view_reminder_action',$data);
$this->load->view('provider/patient/patientActions/view_reminder_action', $data);
break;
case "TRACKING":
$this->load->view('provider/patient/patientActions/view_tracking_action');
@@ -163,6 +163,46 @@ class Patient extends Provider_Controller {
}
}
public function addPatientReminder() {
$data['reminder_text'] = trim($this->input->get('reminder_text'));
$data['start_date'] = trim($this->input->get('start_date'));
$data['end_date'] = trim($this->input->get('end_date'));
$data['reminder_type'] = trim($this->input->get('reminder_type'));
$data['patient_id'] = trim($this->input->get('patient_id'));
echo "Ameye";
}
/*
var reminder_text = document.reminderaddform.reminder_text.value;
var start_date = document.reminderaddform.start_date.value;
var end_date = document.reminderaddform.end_date.value;
var reminder_type = document.reminderaddform.reminder_type.value;
var patient_id = document.reminderaddform.patient_id.value;
// alert(patient_link_id);
if (reminder_text === '' || start_date === '' || end_date === '' || reminder_type === '') {
alert('All felids are required to add a reminder!');
return false;
}
// alert(job_description);
$('#link_result').html('Processing...');
$('#rem_link_submit').prop('disabled', true);
$.ajax({
url: "/patient/addPatientReminder?reminder_text=" + reminder_text + "&patient_id=" + patient_id +"&reminder_text=" + reminder_text +"&start_date=" + start_date +"&end_date=" + end_date + "&reminder_type="+reminder_type
}).done(function (data) {
$('#link_result').html(data);
document.linkform.patient_link_id.value = '';
$('#rem_link_submit').prop('disabled', false);
});
return false;
}
*/
public function linkpatient() {
// echo 'Ameye';
@@ -8,7 +8,7 @@ class Reminder_model extends CI_Model {
public function getPatientReminderList($practice_id, $patient_id) {
$mysql = "SELECT description, start_date,end_date FROM members_reminders WHERE member_id =1 AND practice_id = 0 AND status = 1 ORDER BY added DESC LIMIT 5";
$mysql = "SELECT r.id, r.description, r.start_date,r.end_date FROM members_reminders r LEFT JOIN patients p ON p.id=r.member_id WHERE p.id = $patient_id AND r.practice_id = 0 AND r.status = 1 ORDER BY r.added DESC LIMIT 5";
$query = $this->db->query($mysql);
$num = $query->num_rows();
$data["patient_reminder_list"] = $query->result();
@@ -13,11 +13,11 @@
<div class="container-fluid">
<? include "application/views/template/topstrip.php"; ?>
<? include "application/views/template/topstrip2.php"; ?>
<? include "application/views/template/topstrip2.php"; ?>
<!-- begin row -->
<div class="row">
<div class="col-lg-6 col-xxl-4 m-b-30">
@@ -31,7 +31,7 @@
</div>
</div>
<div class="card-body">
<? include 'components/encounter_listing.php'; ?>
<? include 'components/encounter_listing.php'; ?>
</div>
@@ -113,7 +113,7 @@
</div>
</div>
<div class="col-xxl-6 m-b-30">
<? include 'components/patient_listing.php'; ?>
<? include 'components/patient_listing.php'; ?>
</div>
</div>
@@ -7,9 +7,9 @@
</div>
<div class="card-body">
<form method="POST" action="/patient/">
<form name="reminderaddform">
<input type="hidden" name="patient_id" value="<?= $patient_id ?>" >
<div class="form-row">
<div class="form-group col-md-12">
<textarea name="reminder_text" class="form-control" id="remindr_text" placeholder="Reminder Text"></textarea>
@@ -20,11 +20,11 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4">Start Date</label>
<input type="text" class="form-control date-picker-default" value="" name="startdate">
<input type="text" class="form-control date-picker-default" value="" name="start_date">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4">End Date</label>
<input type="text" class="form-control date-picker-default" value="" name="enddate">
<input type="text" class="form-control date-picker-default" value="" name="end_date">
</div>
</div>
@@ -43,10 +43,10 @@
<div class="form-row">
<div class="form-group col-md-6">
<div id="link_result"></div>
</div>
<div class="form-group col-md-6">
<button type="submit" class="btn btn-primary btn-block btn-sm">Set Reminder</button>
<button type="submit" id="rem_link_submit" class="btn btn-primary btn-block btn-sm" onclick="return addPatientReminder()">Set Reminder</button>
</div>
</div>
@@ -76,3 +76,35 @@
</ul>
</div>
<script type="text/javascript">
<!--
function addPatientReminder() {
var reminder_text = document.reminderaddform.reminder_text.value;
var start_date = document.reminderaddform.start_date.value;
var end_date = document.reminderaddform.end_date.value;
var reminder_type = document.reminderaddform.reminder_type.value;
var patient_id = document.reminderaddform.patient_id.value;
// alert(patient_link_id);
if (reminder_text === '' || start_date === '' || end_date === '' || reminder_type === '') {
alert('All felids are required to add a reminder!');
return false;
}
// alert(job_description);
$('#link_result').html('Processing...');
$('#rem_link_submit').prop('disabled', true);
$.ajax({
url: "/patient/addPatientReminder?reminder_text=" + reminder_text + "&patient_id=" + patient_id +"&reminder_text=" + reminder_text +"&start_date=" + start_date +"&end_date=" + end_date + "&reminder_type="+reminder_type
}).done(function (data) {
$('#link_result').html(data);
document.linkform.reminder_text.value = '';
$('#rem_link_submit').prop('disabled', false);
});
return false;
}
// -->
</script>
@@ -16,7 +16,7 @@
<div class="row">
<div class="col-md-12">
<div class="alert border-0 alert-primary bg-gradient m-b-30 alert-dismissible fade show border-radius-none" role="alert">
RECORD: <strong><?= $firstname ?> <?= $lastname ?> </strong> some other small info like phone number
RECORD: <strong><span style="color:#FFFF14;"><?= $firstname ?> <?= $lastname ?></span> </strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a style=" color:white;"href="#" onclick="selectPatienFetures(<?= $patient_id ?>, 'REMINDERS');">Reminders</a>
</div>
</div>
</div>
@@ -154,9 +154,9 @@
<div class="col-lg-6 col-xxl-4 m-b-30">
<div class="card card-statistics h-100 mb-0">
<div id="action_detail">
<div class="card card-statistics h-100 mb-0">
<div id="action_detail">
</div>
</div>
@@ -253,43 +253,11 @@
<div class="card card-statistics h-30 mb-0">
<div class="card-header d-flex justify-content-between">
<div class="card-heading">
<h4 class="card-title">Attach Record</h4>
<h4 class="card-title">Section</h4>
</div>
</div>
<div class="card-body">
<form method="POST" action="/patient/">
<div class="form-row">
<div class="form-group col-md-12">
<input type="text" class="form-control" id="patientAPPID" value="" placeholder="Enter patient ID from the APP">
</div>
</div>
<div class="form-row">
<button type="submit" class="btn btn-primary">Attach Record to Patient App</button>
</div>
</form>
<ul class="activity">
<li class="activity-item success">
<div class="activity-info">
<h5 class="mb-0"> Complete milestone 3 and update. </h5>
<span>
Mon, 14 Jun
</span>
</div>
</li>
</ul>
</div>
</div>
<hr>
@@ -10,7 +10,7 @@
<nav>
<ol class="breadcrumb p-0 m-b-0">
<li class="breadcrumb-item">
<a href="index.html"><i class="ti ti-home"></i></a>
<a href="/provider"><i class="ti ti-home"></i></a>
</li>
<li class="breadcrumb-item">
Dashboard