application/controllers/Chart.php
/**
     * Charts for symbol
     * 
     * @param string $code    Contains code of symbol
     */
Charts for symbol

@param string $code    Contains code of symbol
Charts for symbol @param string $code Contains code of symbol
public function symbol($code) {
        $this->load->helper('url');
        $this->load->library('pchart');
        $symbol = $this->symbol_model->get_symbol_by_code($code);
        if ($symbol) {
            $data['charts'] = array();
            $periods = array('hour', 'day', 'month');
            foreach ($periods as $period) {
                $fileName = 'img/chart/' . 'last_' . $period . '_' . str_replace('#', '', $symbol['code']) . '.png';
                if ($this->_drawChartForValueAndPeriod($symbol['id'], $symbol['name'], $period, $fileName)) {
                    $data['charts'][] = $fileName;
                }
            }
            $this->load->view('header', array('title' => $symbol['name']));
            $this->load->view('chart', $data);
            $this->load->view('footer');
        } else {
            show_404();
        }
    }
public function symbol ( $ code ) { $ this -> load -> helper ( 'url' ) ; $ this -> load -> library ( 'pchart' ) ; $ symbol = $ this -> symbol_model -> get_symbol_by_code ( $ code ) ; if ( $ symbol ) { $ data [ 'charts' ] = array ( ) ; $ periods = array ( 'hour' , 'day' , 'month' ) ; foreach ( $ periods as $ period ) { $ fileName = 'img/chart/' . 'last_' . $ period . '_' . str_replace ( '#' , '' , $ symbol [ 'code' ] ) . '.png' ; if ( $ this -> _drawChartForValueAndPeriod ( $ symbol [ 'id' ] , $ symbol [ 'name' ] , $ period , $ fileName ) ) { $ data [ 'charts' ] [ ] = $ fileName ; } } $ this -> load -> view ( 'header' , array ( 'title' => $ symbol [ 'name' ] ) ) ; $ this -> load -> view ( 'chart' , $ data ) ; $ this -> load -> view ( 'footer' ) ; } else { show_404 ( ) ; } }
Charts for symbol
Charts for symbol