<?php

class Dashboard extends CFormModel {

    public $colors = array('#00FF00', '#FF0000', '#FFFF00', '#0000FF', '#990099', '#CC3300', '#009900', '#000099', '#FF0066', '#990000', '#00FFCC', '#003399', '#006630', '#B200B2', '#FFCC00');

    public function getRandomColor() {
        return $this->colors[rand(0, sizeof($this->colors) - 1)];
    }

    public static function getMonths() {
        for ($m = 1; $m <= 12; $m++) {
            $months[$m] = date('Y').' - '.date('F', mktime(0,0,0,$m,1));
        }
        return $months;
    }
    public static function getMonths1($end_year,$month,$month_1) {
        $currentYear  = date("Y");
        $currentmonth  = date("m");
        
        if($end_year==$currentYear){
            $month_1=$currentmonth;
        }
        for ($m =$month; $m <= $month_1; $m++) {
            $months[$end_year.'-'.$m] = $end_year.' - '.date('F', mktime(0,0,0,$m,1));
        }
        return $months;
    }
    public static function getYear() {
        for ($m = date('Y')-4; $m <= date('Y'); $m++) {
            $year[$m] = $m;
        }
        return $year;
    }
}