/>
Plugin statistics on the dashboard style="float:left; margin-right:5px; margin-top: 5px;" type="radio" name="event_regis_dashboard_stats" value="off" />
style="float:left; margin-right:5px; margin-top: 5px;" type="radio" name="event_regis_dashboard_stats" value="abox" />
style="float:left; margin-right:5px; margin-top: 5px;" type="radio" name="event_regis_dashboard_stats" value="widget" />
*/ $event_regis_dashboard_stats = get_option('event_regis_dashboard_stats'); $event_regis_dashboard_stats = 'abox'; switch(strtolower($event_regis_dashboard_stats)) { case 'abox': // activity box add_action('activity_box_end', 'event_regis_admin_latest_activity'); break; case 'widget': // separate widget add_action('wp_dashboard_setup', 'event_regis_register_dashboard_widget'); add_filter('wp_dashboard_widgets', 'event_regis_add_dashboard_widget'); break; } ### Function: Register Dashboard Widget function event_regis_register_dashboard_widget() { //global $event_regis_full_plugin_name; wp_register_sidebar_widget('dashboard_event_regis', __('Event Registration with PayPal IPN', 'Event Registration with PayPal IPN'), 'dashboard_event_regis', array( 'width' => 'half', // OR 'fourth', 'third', 'half', 'full' (Default: 'half') 'height' => 'single', // OR 'single', 'double' (Default: 'single') ) ); } ### Function: Add Dashboard Widget function event_regis_add_dashboard_widget($widgets) { global $wp_registered_widgets; if (!isset($wp_registered_widgets['dashboard_event_regis'])) { return $widgets; } $w1 = array_slice($widgets,0,1); $w2 = array_slice($widgets,1); return array_merge($w1,array('dashboard_event_regis'),$w2); //$widgets[] = array('dashboard_event_regis'); //return $widgets; } function event_regis_get_stats($opt){ global $wpdb; switch($opt){ case 'total_attendees': $sql = "SELECT count(id) FROM ".get_option('events_attendee_tbl'); break; case 'total_events': $sql = "SELECT count(id) FROM ".get_option('events_detail_tbl') ." WHERE (is_active='yes' OR is_active='Y') AND start_date >= '".date ( 'Y-m-d' )."'"; break; case 'total_sales': $sql = "SELECT sum(amount_pd) FROM ".get_option('events_attendee_tbl')." WHERE amount_pd != '' OR amount_pd != '0.00'"; break; case 'total_paid': $sql = "SELECT count(id) FROM ".get_option('events_attendee_tbl')." WHERE amount_pd != '' OR amount_pd != '0.00'"; break; case 'total_not_paid': $sql = "SELECT count(id) FROM ".get_option('events_attendee_tbl')." WHERE amount_pd = '' OR amount_pd = '0.00'"; break; } $res = $wpdb->get_var($wpdb->prepare($sql)); return $res; } ### Function: Print Dashboard Widget function dashboard_event_regis($sidebar_args) { global $wpdb; $org_options = get_option('events_organization_settings'); if (is_array($sidebar_args)){ extract($sidebar_args, EXTR_SKIP); } echo $before_widget; echo $before_title; echo $widget_name; echo $after_title; //global $event_regis_plugindir; echo '
'; echo '
'; echo '

Events stats

'; echo 'View Attendees/Payments'; echo '
'; //$admin_current_event = event_regis_get_current_event('current_event'); $admin_total_events = event_regis_get_stats('total_events'); $admin_total_attendees = event_regis_get_stats('total_attendees'); $admin_total_event_sales = event_regis_get_stats('total_sales'); $admin_total_total_paid = event_regis_get_stats('total_paid'); $admin_total_total_not_paid = event_regis_get_stats('total_not_paid'); ?>
Total Active Events All Time Attendees All Time Paid All Time Not Paid All Time Payments
'; echo '
'; echo '

Event Registration with PayPal IPN

'; echo 'View Attendees/Payments'; echo '
'; //$admin_current_event = event_regis_get_current_event('current_event'); $admin_total_events = event_regis_get_stats('total_events'); $admin_total_attendees = event_regis_get_stats('total_attendees'); $admin_total_event_sales = event_regis_get_stats('total_sales'); $admin_total_total_paid = event_regis_get_stats('total_paid'); $admin_total_total_not_paid = event_regis_get_stats('total_not_paid'); ?>
Total Active Events All Time Attendees All Time Paid All Time Not Paid All Time Payments
= '".date ( 'Y-m-d' )."' ORDER BY date(start_date) LIMIT 3"; $result = mysql_query ($sql); while ($row = mysql_fetch_assoc ($result)){ $event_id=$row['id']; $event_name=$row['event_name']; $reg_limit = $row['reg_limit']; $start_date =$row['start_date']; $sql2= "SELECT SUM(quantity) FROM " . get_option('events_attendee_tbl') . " WHERE event_id='$event_id'"; $result2 = mysql_query($sql2); while($row = mysql_fetch_array($result2)){ $number_attendees = $row['SUM(quantity)']; } if ($number_attendees == '' || $number_attendees == 0){ $number_attendees = '0'; } if ($reg_limit == "" || $reg_limit == " " || $reg_limit == "999"){ $reg_limit = "∞"; } ?>
Next 3 Upcoming Events
| Start Date: | Attendees: /