9c92d236 by vanisha

reset button added

1 parent 4025cf2a
......@@ -32,6 +32,10 @@ if (isset($_GET['choice'])) {
if ($choice === 'get_logs') {
$date_filter = $_GET['date'];
if(empty($date_filter)) {
$date_filter = date('d-m-y');
}
$date_filter = date('d-m-y',strtotime($date_filter));
$configpaths = get_config(null, 'block_log_path_info');
......
......@@ -20,6 +20,11 @@
<span class="icon-stack"><i style="line-height: 0.5em;" class="icon-filter icon-stack-base" aria-hidden="true"></i>
<i style="line-height: 0.2em;" class="icon-add"></i></span></button>
</div>
<div class="input-group-prepend" style="display: block;padding: 10px;text-align: justify;width: 25em;margin-top: 30px;">
<button id="reset_filter_logs" class="btn btn-primary" type="button" title="Reset">Reset
<span class="icon-stack"><i style="line-height: 0.5em;" class="icon-filter icon-stack-base" aria-hidden="true"></i>
<i style="line-height: 0.2em;" class="icon-add"></i></span></button>
</div>
</div>
</div>
......@@ -85,4 +90,22 @@ $('#filter_logs').click(function() {
});
$('#reset_filter_logs').click(function() {
if(('#date_filter_div').length != 0 ) {
$('#date_filter_div').empty();
}
$.ajax({
method: "GET",
url: M.cfg.wwwroot + '/blocks/log/ajax.php',
data: {"choice" : "get_logs","date" : ''}
}).done(function(response) {
var data = JSON.parse(response);
var userdata = JSON.parse(data.userdata);
log_DataTable.clear().draw();
log_DataTable.rows.add(userdata).draw();
});
});
</script>
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!