diff options
Diffstat (limited to 'templates/admin/user_logs.html')
-rw-r--r-- | templates/admin/user_logs.html | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/templates/admin/user_logs.html b/templates/admin/user_logs.html index 4586b56..453eb33 100644 --- a/templates/admin/user_logs.html +++ b/templates/admin/user_logs.html @@ -89,7 +89,7 @@ </div> </div> <h4 id="file-count"></h4> - <table id="logs-table" class="table table-condensed"> + <table id="logs-table" class="table table-condensed" style="display: none;"> <thead> <tr> <th>Sl No</th> @@ -120,6 +120,7 @@ var endDate = "{{ nowdate }}"; }).on('changeDate', function(ev) { var newDate = new Date(ev.date); startDate = newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + newDate.getDate(); + $(this).datepicker('hide'); }).data('datepicker'); var DP2 = $('#dp2').datepicker({ @@ -129,15 +130,16 @@ var endDate = "{{ nowdate }}"; }).on('changeDate', function(ev) { var newDate = new Date(ev.date); endDate = newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + newDate.getDate(); + $(this).datepicker('hide'); }).data('datepicker'); })(); function fetchFileNames() { var startTime = $("#start-time").val(); var endTime = $("#end-time").val(); - var BASE_URl = window.location.origin + "/sbhs"; + var BASE_URL = window.location.origin + "/sbhs-rpi"; var request = $.ajax({ - url : BASE_URl + "/admin/rangelogs", + url : BASE_URL + "/admin/rangelogs", method : "POST", data : { "start_date" : startDate, @@ -152,11 +154,14 @@ function fetchFileNames() { htmlContent = ""; ctr=1; for (item of data.message) { - htmlContent += "<tr>" + "<td>" + ctr + "</td>" + "<td>" + item.log.split("/")[0] +"</td>" + "<td><a href='" + BASE_URl + "/admin/explogs/" + item.id + "'>" + item.log.split("/")[1] +"</a></td>" + "</tr>"; + htmlContent += "<tr>" + "<td>" + ctr + "</td>" + "<td>" + item.log.split("/")[0] +"</td>" + "<td><a href='" + BASE_URL + "/admin/explogs/" + item.id + "'>" + item.log.split("/")[1] +"</a></td>" + "</tr>"; ctr+=1; } $("#file-count").html(data.message.length + " results found"); - $("#logs-table tbody").html(htmlContent); + if (data.message.length > 0) { + $("#logs-table tbody").html(htmlContent); + $("#logs-table").show(); + } } else { alert(data.message); |