Add reminder javascript assed
This commit is contained in:
+38
-6
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user