application/controllers/Chart.php
/**
     * Draw charts for period
     * 
     * @param string $period    Contains name of period
     */
Draw charts for period

@param string $period    Contains name of period
Draw charts for period @param string $period Contains name of period
private function _drawChartsForPeriod($period) {
        $this->load->helper('url');
        $this->load->library('pchart');
        $symbols = $this->symbol_model->get_symbols();
        $data['charts'] = array();
        foreach ($symbols as $symbol) {
            $fileName = 'img/chart/' . 'last_' . $period . '_' . str_replace('#', '', $symbol['code']) . '.png';
            if ($this->_drawChartForValueAndPeriod($symbol['id'], $symbol['name'], $period, $fileName)) {
                $data['charts'][] = $fileName;
            }
        }
        $title = 'Last ' . $period;
        $this->load->view('header', array('title' => $title));
        $this->load->view('chart', $data);
        $this->load->view('footer');
    }
private function _drawChartsForPeriod ( $ period ) { $ this -> load -> helper ( 'url' ) ; $ this -> load -> library ( 'pchart' ) ; $ symbols = $ this -> symbol_model -> get_symbols ( ) ; $ data [ 'charts' ] = array ( ) ; foreach ( $ symbols as $ symbol ) { $ fileName = 'img/chart/' . 'last_' . $ period . '_' . str_replace ( '#' , '' , $ symbol [ 'code' ] ) . '.png' ; if ( $ this -> _drawChartForValueAndPeriod ( $ symbol [ 'id' ] , $ symbol [ 'name' ] , $ period , $ fileName ) ) { $ data [ 'charts' ] [ ] = $ fileName ; } } $ title = 'Last ' . $ period ; $ this -> load -> view ( 'header' , array ( 'title' => $ title ) ) ; $ this -> load -> view ( 'chart' , $ data ) ; $ this -> load -> view ( 'footer' ) ; }
Draw charts for period
Draw charts for period