Exemple #1
0
 public function color($model)
 {
     if ($model->id) {
         $min_brightness = 180;
         $return = Hc_lib::random_html_color($model->id, $min_brightness);
     } else {
         $return = '#ddd';
     }
     return $return;
 }
 public function color($model)
 {
     $return = Hc_lib::random_html_color($model->id);
     return $return;
 }
$menu[] = '-divider-';
$menu[] = array('href' => ci_site_url(array('admin/shifts', 'delete', $sh->id)), 'title' => '<i class="fa fa-times text-danger"></i> ' . lang('shift_delete'), 'class' => 'hc-confirm');
/* add color to border to highlight different staff or location */
$more_style = '';
if ($use_color_code_staff) {
    if (!isset($current_staff) && $staff_count > 1) {
        if ($sh->user_id) {
            $random_color = Hc_lib::random_html_color($sh->user_id);
            $more_style .= 'border-left: ' . $random_color . ' 5px solid;';
        }
    }
}
if ($use_color_code_location) {
    if (!isset($current_location) && $location_count > 1) {
        if ($sh->location_id) {
            $random_color = Hc_lib::random_html_color($sh->location_id);
            $more_style .= 'border-right: ' . $random_color . ' 5px solid;';
        }
    }
}
?>

<a class="<?php 
echo $class;
?>
" href="#" data-toggle="dropdown" style="<?php 
echo $more_style;
?>
">
	<?php 
echo $title;