/** * */ public function custom_stats() { $from = !empty($_REQUEST['from']) ? $_REQUEST['from'] : 0; $to = !empty($_REQUEST['to']) ? $_REQUEST['to'] : 0; $date_diff = strtotime($to) - strtotime($from); if ($date_diff <= 0 || $from == 0 || $to == 0) { die; } learn_press_process_chart(learn_press_get_chart_students($to, 'days', floor($date_diff / (60 * 60 * 24)) + 1)); die; }
<button class="button button-primary" type="submit"><?php _e('Go', 'learn_press'); ?> </button> </form> </li> </ul> </div> <div class="lpr-chart-wrapper"> <canvas id="lpr-chart-students"></canvas> </div> <script> var last_seven_days = <?php learn_press_process_chart(learn_press_get_chart_students(null, 'days', 7)); ?> ; var last_thirty_days = <?php learn_press_process_chart(learn_press_get_chart_students(null, 'days', 30)); ?> ; var last_twelve_months = <?php learn_press_process_chart(learn_press_get_chart_students(null, 'months', 12)); ?> ; var config = <?php learn_press_config_chart(); ?> ; </script>