0 ) { $startDate = $_GET['start']; } else { $startDate = "January " . $datetime->format('Y'); // default: first of this year } if ( isset($_GET['end']) && strlen($_GET['end']) > 0 ) { $endDate = $_GET['end']; } else { $endDate = $datetime->format('F Y'); // default: today } ?>

B2C Monthly Reporting Dashboard

Main B2C Site

publishedPosts; endforeach; ?>
Month Posts Published
postMonth, 10)) .", ". $row->postYear; ?> publishedPosts; ?>
Total:

Webcasts Site

webcastRegistrations; endforeach; ?>
Month Webcast Registrations
regMonth, 10)) .", ". $row->regYear; ?> webcastRegistrations; ?>
Total:
0 ) { preg_match('/(\w+)\s(\d+)/', $_GET['start'], $matches); //$startM = date('m', strtotime($matches[1])); $startM = $matches[1]; $startY = $matches[2]; } else { // default: first of this year $startM = 1; $startY = date('Y'); } if ( isset($_GET['end']) && strlen($_GET['end']) > 0 ) { preg_match('/(\w+)\s(\d+)/', $_GET['end'], $matches); //$startM = date('m', strtotime($matches[1])); $endM = $matches[1]; $endY = $matches[2]; } else { // default: first of this year $endM = 1; $endY = date('Y'); } error_log("{$endM} / {$endY}"); $q = " SELECT COUNT(ID) AS publishedPosts, YEAR(post_date) AS postYear, MONTH(post_date) AS postMonth FROM b2c_posts WHERE post_type = 'post' AND post_status = 'publish' AND post_date >= '2015-01-01 00:00:00' AND post_date <= '2015-12-31 23:59:59' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC "; $results = $wpdb->get_results( $q ); return $results; } function b2crpt_fetch_chart_data_webcasts() { global $wpdb; $q = " SELECT COUNT(booking_id) AS webcastRegistrations, YEAR(booking_date) AS regYear, MONTH(booking_date) AS regMonth FROM webcasts_em_bookings WHERE booking_status = 1 AND booking_date >= '2015-01-01 00:00:00' AND booking_date <= '2015-12-31 23:59:59' GROUP BY YEAR(booking_date), MONTH(booking_date) ORDER BY YEAR(booking_date) DESC, MONTH(booking_date) DESC "; $results = $wpdb->get_results( $q ); return $results; } function b2crpt_fetch_chart_data_whitepapers() { } function b2crpt_enqueue($hook) { if ( 'toplevel_page_b2c_monthly_reporting' != $hook ) return; wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'); } add_action( 'admin_enqueue_scripts', 'b2crpt_enqueue' );