6 <& /util/import_javascript.mas, entries => [ 'recent_activity' ], classes => [ 'jquery' ] &>
8 <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
9 <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
11 <& /page/page_title.mas, title => 'Recent activity' &>
13 Start Date: <input type="text" id="dbstats_start_date" title="dbstats_start_date" />
14 <td> </td></td><td>
16 End Date: <input type="text" id="dbstats_end_date" title="dbstats_end_date" />
20 <input type="checkbox" id="include_dateless_items" checked="1" > include items without a date</input>
24 <button id="update_dbstats_by_date">Update</button>
26 <div id="dbstats_message"></div>
29 <div id="recent_activity_trials_div">
30 <table id="recent_activity_trials" width="600">
32 <tr><th width="200">Breeding Program</th><th width="200">Trials</th></tr>
38 <div id="recent_activity_phenotypes_div">
39 <table id="recent_activity_phenotypes" width="600">
41 <tr><th width="200">Breeding Program</th><th width="200">Phenotypes</th></tr>
47 <div id="recent_activity_accessions_div">
48 <table id="recent_activity_accessions" width="600">
50 <tr><th width="200">Breeding Program</th><th width="200">Accessions</th></tr>
56 <div id="recent_activity_plots_div">
57 <table id="recent_activity_plots" width="600">
59 <tr><th width="200">Breeding Program</th><th width="200">Plots</th></tr>
66 jQuery(document).ready( function() {
67 update_dbstats_tables();
70 jQuery('#update_dbstats_by_date').click( function() {
71 update_dbstats_tables();
75 function update_dbstats_tables(start_date, end_date, include_dateless_items) {
76 var start_date = jQuery('#dbstats_start_date').val();
77 var end_date = jQuery('#dbstats_end_date').val();
78 var include_dateless_items = jQuery('#include_dateless_items').prop('checked');
80 var html = "Showing database items generated from date: "+start_date+" to date: "+end_date;
81 if (include_dateless_items === true) { html += '. Including data items that do not have an associated date.'; }
82 jQuery('#dbstats_message').html(html);
84 jQuery('#recent_activity_trials').dataTable( {
85 ajax : '/ajax/dbstats/trials_by_breeding_program?start_date='+start_date+'&end_date='+end_date+'&include_dateless_items='+include_dateless_items,
94 jQuery('#recent_activity_phenotypes').dataTable({
95 ajax : '/ajax/dbstats/phenotypes_by_breeding_program?start_date='+start_date+'&end_date='+end_date+'&include_dateless_items='+include_dateless_items,
102 jQuery('#recent_activity_accessions').dataTable({
103 ajax : '/ajax/dbstats/accessions_by_breeding_program?start_date='+start_date+'&end_date='+end_date+'&include_dateless_items='+include_dateless_items,
114 jQuery('#recent_activity_plots').dataTable({
115 ajax : '/ajax/dbstats/plots_by_breeding_program?start_date='+start_date+'&end_date='+end_date+'&include_dateless_items='+include_dateless_items,
126 jQuery('input[title="dbstats_start_date"]').daterangepicker(
128 "singleDatePicker": true,
129 "showDropdowns": true,
130 "autoUpdateInput": true,
131 "startDate": "1960-01-01",
133 "minDate": "1960-01-01",
134 "maxDate": "2030-12-31",
142 var dbstats_end_date_element = jQuery("#dbstats_end_date");
144 jQuery('input[title="dbstats_end_date"]').daterangepicker(
146 "singleDatePicker": true,
147 "autoUpdateInput": true,
148 "minDate": "1960-01-01",
149 "maxYear" : "2030-12-31",
154 "showDropdowns": true,