Changeset 749


Ignore:
Timestamp:
Feb 9, 2015 10:35:15 AM (10 years ago)
Author:
quyenla
Message:

api

Location:
pro-violet-viettel/sourcecode/application/modules/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportprovince.php

    r746 r749  
    1313        $this->load->helper('language');
    1414        $this->lang->load('messages', 'message');
     15        $this->load->model('reportmodel');
    1516    }
    1617
     
    3536            $data['year'] = $this->input->post('year');
    3637        }
    37         $data = $this->getdays($data);
    3838        $data['provinces'] = $this->reportmodel->getProvinces($data);
    3939
     
    4444    }
    4545
    46     public function getdays($data) {
    47         $data['month_days'] = 1;
    48         if ("" . $data['year'] . "-" . $data['month'] . "" == date("Y-m")) {
    49             $data['month_days'] = date("d");
    50         } else {
    51             $data['month_days'] = cal_days_in_month(CAL_GREGORIAN, $data['month'], $data['year']); // 31 
    52         }
    53         $data['year_days'] = 1;
    54         if ($data['year'] == date("Y")) {
    55             $data['year_days'] = date('z') + 1;
    56         } else {
    57             $data['year_days'] = date("z", mktime(0, 0, 0, 12, 31, $data['year'])) + 1;
    58         }
    59         return $data;
    60     }
     46 
    6147
    6248    public function export() {
     
    6450        $data['month'] = $this->uri->segment(4);
    6551        $data['year'] = $this->uri->segment(5);
    66         $data = $this->getdays($data);
     52       
    6753        $data['provinces'] = $this->reportmodel->getProvinces($data);
    6854
  • pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php

    r747 r749  
    148148        return $data;
    149149    }
     150    public function exportProvince($input)
     151    {
     152        //$input['month']=1;
     153        //$input['year']=2014;
     154        $data=$this->getProvinces($input);
     155        return $data;
     156    }
     157    public function exportPackage($input)
     158    {
     159       // $input['month']=1;
     160       // $input['year']=2014;
     161        $data=$this->getPackages($input);
     162        return $data;
     163    }
    150164
    151165}
Note: See TracChangeset for help on using the changeset viewer.