Created
August 12, 2014 04:41
-
-
Save dtbaker/3f92abe32b8d813cb8a0 to your computer and use it in GitHub Desktop.
Sample PHP for AdminLTE UCM Dashboard Widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this sample widget will show how many jobs were started in the last 7 days: | |
if(class_exists('module_job',false) && module_job::can_i('view','Jobs')){ | |
$jobs = module_job::get_jobs(array( | |
'date_start_after'=>date('Y-m-d',strtotime('-7 days')) | |
),array('columns'=>'u.job_id')); | |
ob_start(); | |
// icons from http://ionicons.com/ | |
?> | |
<div class="small-box bg-aqua"> | |
<div class="inner"> | |
<h3> | |
<?php echo count($jobs); ?> | |
</h3> | |
<p> | |
<?php _e('Incomplete Jobs');?> | |
</p> | |
</div> | |
<div class="icon"> | |
<i class="ion ion-document-text"></i> | |
</div> | |
<a href="<?php echo module_job::link_open(false);?>" class="small-box-footer"> | |
<?php _e('View Jobs');?> <i class="fa fa-arrow-circle-right"></i> | |
</a> | |
</div> | |
<?php | |
$widgets[] = array( | |
'id' => 'jobs_started', | |
'columns' => 4, // 1, 2, 3 or 4 - which column group to add this widget to | |
'raw' => true, // output the raw HTML above as the widget. If this is false then the widget will get wrapped in a default box with a title. | |
'content' => ob_get_clean(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment