Changeset 755 for pro-violet-viettel


Ignore:
Timestamp:
Feb 10, 2015 10:47:29 AM (10 years ago)
Author:
quyenla
Message:

report update

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

Legend:

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

    r751 r755  
    9090        $chars = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L");
    9191        $dem = 1;
     92        $stt=1;
    9293        foreach ($data['packages'] as $package) {
    9394            $dem++;
    94             $sheet->setCellValue($chars[$dem] . ($index + 4), $package['p_name']);
     95            $sheet->setCellValue($chars[$dem] . ($stt + 4), $package['p_name']);
    9596            $dem++;
    96             $sheet->setCellValue($chars[$dem] . ($index + 4), "Tỉ lệ %");
     97            $sheet->setCellValue($chars[$dem] . ($stt + 4), "Tỉ lệ %");
     98       
     99            $stt++;
    97100        }
    98101        $dem++;
    99102        $sheet->setCellValue($chars[$dem] . ($index + 4), "Tổng TB");
    100103
    101 
     104$stt=1;
    102105        foreach ($data['provinces'] as $index => $provinces) {
    103106
    104             $sheet->setCellValue('A' . ($index + 5), $provinces['stt']);
    105             $sheet->setCellValue('B' . ($index + 5), $provinces['province']);
     107            $sheet->setCellValue('A' . ($stt + 5), $provinces['stt']);
     108            $sheet->setCellValue('B' . ($stt + 5), $provinces['province']);
    106109            $dem = 1;
    107110            foreach ($provinces['packages'] as $package) {
    108111                $dem++;
    109                 $sheet->setCellValue($chars[$dem] . ($index + 5), $package['total']);
     112                $sheet->setCellValue($chars[$dem] . ($stt + 5), $package['total']);
    110113                $dem++;
    111                 $sheet->setCellValue($chars[$dem] . ($index + 5), $package['percent']);
     114                $sheet->setCellValue($chars[$dem] . ($stt + 5), $package['percent']);
    112115            }
    113116            $dem++;
    114             $sheet->setCellValue($chars[$dem] . ($index + 5), $provinces['total']);
     117           
     118            $sheet->setCellValue($chars[$dem] . ($stt + 5), $provinces['total']);
     119            $stt++;
    115120        }
    116121        $writer = new PHPExcel_Writer_Excel5($this->phpexcel);
  • pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php

    r749 r755  
    4848       
    4949
    50 
     50        $dem=1;
    5151        foreach ($provinces as $index2 => $province) {
    52             $provinces[$index2] = array("stt" => ($index2 + 1), "province" => $province, "dtn" => 0, "dtt" => 0, "dtng" => 0, "tbn" => 0, "tbt" => 0, "tbng" => 0);
     52            $provinces[$index2] = array("stt" => ($dem), "province" => $province, "dtn" => 0, "dtt" => 0, "dtng" => 0, "tbn" => 0, "tbt" => 0, "tbng" => 0);
    5353            foreach ($dtns as $data) {
    54                 if ($province == $data['province']) {
     54                if ($index2 == $data['province']) {
    5555                    $provinces[$index2]['dtn'] = $data['total'];
    5656                }
    5757            }
    5858            foreach ($dtng as $data) {
    59                 if ($province == $data['province']) {
     59                if ($index2 == $data['province']) {
    6060                    $provinces[$index2]['dtng'] = $data['total'];
    6161                }
    6262            }
    6363            foreach ($dtts as $data) {
    64                 if ($province == $data['province']) {
     64                if ($index2 == $data['province']) {
    6565                    $provinces[$index2]['dtt'] = $data['total'];
    6666                   
     
    7171
    7272            foreach ($tbns as $data) {
    73                 if ($province == $data['province']) {
     73                if ($index2 == $data['province']) {
    7474                    $provinces[$index2]['tbn'] = $data['total'];
    7575                }
    7676            }
    7777            foreach ($tbng as $data) {
    78                 if ($province == $data['province']) {
     78                if ($index2 == $data['province']) {
    7979                    $provinces[$index2]['tbng'] = $data['total'];
    8080                }
    8181            }
    8282            foreach ($tbts as $data) {
    83                 if ($province == $data['province']) {
     83                if ($index2 == $data['province']) {
    8484                    $provinces[$index2]['tbt'] = $data['total'];
    8585                }
    8686            }
     87            $dem++;
    8788        }
    8889       
     
    114115            $provinces[$index] = array("province" => $province);
    115116        }
    116 
     117        $dem=1;
    117118        foreach ($provinces as $index => $province) {
    118             $provinces[$index]['stt'] = $index + 1;
     119            $provinces[$index]['stt'] = $dem;
    119120            $provinces[$index]['total'] = 0;
    120121            $totaluser = 0;
     
    124125                $total = 0;
    125126                foreach ($package['users'] as $user) {
    126                     if ($province['province'] == $user['province']) {
     127                    if ($index == $user['province']) {
    127128                        $total = $total + 1;
    128129                        $totaluser = $totaluser + 1;
     
    134135                }
    135136            }
     137            $dem++;
    136138        }
    137139        foreach ($provinces as $index => $province) {
     
    158160    {
    159161       // $input['month']=1;
    160        // $input['year']=2014;
     162       //svn $input['year']=2014;
    161163        $data=$this->getPackages($input);
    162164        return $data;
Note: See TracChangeset for help on using the changeset viewer.