public function statistics()
{
global $wpdb;
return array(
'modules' => 6,
'schedules' => (int) $wpdb->get_var(
"SELECT COUNT(*)
FROM {$wpdb->prefix}bamak_schedules
WHERE status=1"
),
'today' => (int) $wpdb->get_var(
"SELECT COUNT(*)
FROM {$wpdb->prefix}bamak_logs
WHERE DATE(created_at)=CURDATE()"
),
'success' => (int) $wpdb->get_var(
"SELECT COUNT(*)
FROM {$wpdb->prefix}bamak_logs
WHERE status='SUCCESS'"
),
'failed' => (int) $wpdb->get_var(
"SELECT COUNT(*)
FROM {$wpdb->prefix}bamak_logs
WHERE status='FAILED'"
)
);
}
public function latestLogs($limit=10)
{
global $wpdb;
return $wpdb->get_results(
$wpdb->prepare(
"SELECT *
FROM {$wpdb->prefix}bamak_logs
ORDER BY id DESC
LIMIT %d",
$limit
)
);
}
public function upcomingJobs($limit = 5)
{
global $wpdb;
return $wpdb->get_results(
$wpdb->prepare(
"SELECT module,
next_run
FROM {$wpdb->prefix}bamak_schedules
WHERE status = 1
ORDER BY next_run ASC
LIMIT %d",
$limit
)
);
}
Warning: Cannot modify header information - headers already sent by (output started at /home1/chtkclmy/public_html/wp-content/plugins/bamak-automation/includes/classes/class-bamak-dashboard.php:1) in /home1/chtkclmy/public_html/wp-includes/pluggable.php on line 1535
Warning: Cannot modify header information - headers already sent by (output started at /home1/chtkclmy/public_html/wp-content/plugins/bamak-automation/includes/classes/class-bamak-dashboard.php:1) in /home1/chtkclmy/public_html/wp-includes/pluggable.php on line 1538