aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-16 18:18:19 +0100
committerMateja <mail@matejamaric.com>2020-11-16 18:18:19 +0100
commitaed493eb95bf660145003f024434296c91d1c8c3 (patch)
treebb838a90230c5904b4465badaa70031f56086159 /public
parent772fdfb0c6e520e429b1a637747b2289f6dffe20 (diff)
downloadyota-laravel-aed493eb95bf660145003f024434296c91d1c8c3.tar.gz
yota-laravel-aed493eb95bf660145003f024434296c91d1c8c3.zip
Validate from and to date on reserve from. Copy activities.js to
reservations.js
Diffstat (limited to 'public')
-rw-r--r--public/js/reservations.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/public/js/reservations.js b/public/js/reservations.js
index e69de29..94bee2d 100644
--- a/public/js/reservations.js
+++ b/public/js/reservations.js
@@ -0,0 +1,38 @@
+$.ajaxSetup({
+ headers: {
+ 'X-CSRF-TOKEN': $('input[name="csrf-token"]').attr('content')
+ }
+});
+
+jQuery('select#call-sign').change(fillTable);
+jQuery(document).ready(fillTable);
+
+function fillTable() {
+ tableData = jQuery('table#ajax-table>tbody').first();
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">Loading...</td></tr>');
+
+ sign = jQuery('select#call-sign').first().val();
+
+ jQuery.post('/api/activities', {'call-sign': sign}, function (data, status) {
+ if (status === 'success') {
+ if (data.data.length > 0) {
+ tableData.empty();
+ for (var i = 0, len = data.data.length; i < len; i++) {
+ tr = '<tr><td>' + data.data[i].operatorCall + '</td>' +
+ '<td>' + data.data[i].fromTime + '</td>' +
+ '<td>' + data.data[i].toTime + '</td>' +
+ '<td>' + data.data[i].specialCall + '</td>' +
+ '<td>' + data.data[i].frequencies + '</td>' +
+ '<td>' + data.data[i].qso + '</td></tr>';
+ tableData.append(tr);
+ }
+ }
+ else {
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">No data...</td></tr>');
+ }
+ }
+ else {
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">Error!</td></tr>');
+ }
+ });
+}