reset button added
Showing
2 changed files
with
27 additions
and
0 deletions
... | @@ -32,6 +32,10 @@ if (isset($_GET['choice'])) { | ... | @@ -32,6 +32,10 @@ if (isset($_GET['choice'])) { |
32 | 32 | ||
33 | if ($choice === 'get_logs') { | 33 | if ($choice === 'get_logs') { |
34 | $date_filter = $_GET['date']; | 34 | $date_filter = $_GET['date']; |
35 | if(empty($date_filter)) { | ||
36 | $date_filter = date('d-m-y'); | ||
37 | } | ||
38 | |||
35 | $date_filter = date('d-m-y',strtotime($date_filter)); | 39 | $date_filter = date('d-m-y',strtotime($date_filter)); |
36 | $configpaths = get_config(null, 'block_log_path_info'); | 40 | $configpaths = get_config(null, 'block_log_path_info'); |
37 | 41 | ... | ... |
... | @@ -20,6 +20,11 @@ | ... | @@ -20,6 +20,11 @@ |
20 | <span class="icon-stack"><i style="line-height: 0.5em;" class="icon-filter icon-stack-base" aria-hidden="true"></i> | 20 | <span class="icon-stack"><i style="line-height: 0.5em;" class="icon-filter icon-stack-base" aria-hidden="true"></i> |
21 | <i style="line-height: 0.2em;" class="icon-add"></i></span></button> | 21 | <i style="line-height: 0.2em;" class="icon-add"></i></span></button> |
22 | </div> | 22 | </div> |
23 | <div class="input-group-prepend" style="display: block;padding: 10px;text-align: justify;width: 25em;margin-top: 30px;"> | ||
24 | <button id="reset_filter_logs" class="btn btn-primary" type="button" title="Reset">Reset | ||
25 | <span class="icon-stack"><i style="line-height: 0.5em;" class="icon-filter icon-stack-base" aria-hidden="true"></i> | ||
26 | <i style="line-height: 0.2em;" class="icon-add"></i></span></button> | ||
27 | </div> | ||
23 | </div> | 28 | </div> |
24 | </div> | 29 | </div> |
25 | 30 | ||
... | @@ -84,5 +89,23 @@ $('#filter_logs').click(function() { | ... | @@ -84,5 +89,23 @@ $('#filter_logs').click(function() { |
84 | } | 89 | } |
85 | 90 | ||
86 | }); | 91 | }); |
92 | |||
93 | $('#reset_filter_logs').click(function() { | ||
94 | if(('#date_filter_div').length != 0 ) { | ||
95 | $('#date_filter_div').empty(); | ||
96 | } | ||
97 | $.ajax({ | ||
98 | method: "GET", | ||
99 | url: M.cfg.wwwroot + '/blocks/log/ajax.php', | ||
100 | data: {"choice" : "get_logs","date" : ''} | ||
101 | }).done(function(response) { | ||
102 | var data = JSON.parse(response); | ||
103 | var userdata = JSON.parse(data.userdata); | ||
104 | log_DataTable.clear().draw(); | ||
105 | log_DataTable.rows.add(userdata).draw(); | ||
106 | |||
107 | }); | ||
108 | |||
109 | }); | ||
87 | 110 | ||
88 | </script> | 111 | </script> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment