Changeset 444


Ignore:
Timestamp:
Nov 10, 2014 2:08:04 PM (11 years ago)
Author:
quyenla
Message:

paidlogs

Location:
pro-violet-viettel
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/docs/Space-update-logo/Space/report_all.html

    r316 r444  
    286286
    287287                                                                <div>
    288                                                                         <div class="easy-pie-chart percentage col-xs-4" data-percent="10" data-color="#1abc9c">
    289                                                                                 <span class="percent">10</span>%
    290288                                                                        </div>
    291                                                                         <span>Doanh thu qua SMS</span>
    292                                                                         <h2 class="pull-right">1,0000 VND</h2>
    293                                                                         <hr />
    294                                                                         <div class="easy-pie-chart percentage col-xs-4" data-percent="25" data-color="#e67e22">
    295                                                                                 <span class="percent">25</span>%
    296                                                                         </div>
    297                                                                         <span>Doanh thu qua nạp thẻ cào</span>
    298                                                                         <h2 class="pull-right">4,37450 VND</h2>
    299                                                                         <hr />
    300                                                                         <div class="easy-pie-chart percentage col-xs-4" data-percent="65" data-color="#3498db">
    301                                                                                 <span class="percent">65</span>%
    302                                                                         </div>
    303                                                                         <span>Doanh thu qua cộng tác viên</span>
    304                                                                         <h2 class="pull-right">8,67450 VND</h2> <hr/>
    305                                                                         <h1 class="pull-right"><span style="color:#e67e22"> = </span>14,17450 VND</h1>
    306                                                                 </div>
    307289
    308290                                                                <!-- PAGE CONTENT ENDS -->
  • pro-violet-viettel/sourcecode/application/config/config.php

    r407 r444  
    372372|
    373373*/
    374 $config['api_url'] = 'http://api.'.$_SERVER['SERVER_NAME'].'/';
     374$config['api_url'] = 'http://api.violet.vn';
    375375
    376376
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php

    r442 r444  
    66class Report extends MX_Controller {
    77
    8     const TOKENPW = 'violet';
     8const TOKENPW = 'violet';
     9
    910    public function __construct() {
    1011        parent::__construct();
     
    1617        $admin_info = $this->session->userdata('adminInfo');
    1718        if ($admin_info) {
    18             $data['statistics'] = $this->getStatistics();           
     19            $data['statistics'] = $this->getStatistics();
    1920            $data['content'] = $this->getPaidlogs();
    2021            $this->load->view('report/index', $data);
     
    2324        }
    2425    }
    25     public function getStatistics()
    26     {
    27         $data=array();
    28        
    29         $last_month['start']= strtotime(date("Y-m-d", strtotime("first day of previous month"))." 00:00:00");
    30         $last_month['end']= strtotime(date("Y-m-d", strtotime("last day of previous month"))." 23:59:59");
    31        
    32         $last_week['start']= strtotime(date("Y-m-d", strtotime("first day of previous week"))." 00:00:00");
    33         $last_week['end']= strtotime(date("Y-m-d", strtotime("last day of previous week"))." 23:59:59");
    34        
    35         $last_week['end']=strtotime('last sunday')+(24*60*60-1);
    36         $last_week['start']=($last_week['end']-7*24*60*60+1);
    37        
    38         $last_year['start']=  strtotime((date("Y")-1)."-01-01 00:00:00");
    39         $last_year['end']=  strtotime((date("Y")-1)."-12-31 23:59:59");
    40        
    41        
    42        
    43         $last_quarter=$this->getLastquarter();
    44         $last_quarter['start']= $last_quarter['start'];
    45         $last_quarter['end']= $last_quarter['end'];
    46        
    47        
     26
     27    public function getStatistics() {
     28        $data = array();
     29
     30        $last_month['start'] = strtotime(date("Y-m-d", strtotime("first day of previous month")) . " 00:00:00");
     31        $last_month['end'] = strtotime(date("Y-m-d", strtotime("last day of previous month")) . " 23:59:59");
     32
     33        $last_week['start'] = strtotime(date("Y-m-d", strtotime("first day of previous week")) . " 00:00:00");
     34        $last_week['end'] = strtotime(date("Y-m-d", strtotime("last day of previous week")) . " 23:59:59");
     35
     36        $last_week['end'] = strtotime('last sunday') + (24 * 60 * 60 - 1);
     37        $last_week['start'] = ($last_week['end'] - 7 * 24 * 60 * 60 + 1);
     38
     39        $last_year['start'] = strtotime((date("Y") - 1) . "-01-01 00:00:00");
     40        $last_year['end'] = strtotime((date("Y") - 1) . "-12-31 23:59:59");
     41
     42
     43
     44        $last_quarter = $this->getLastquarter();
     45        $last_quarter['start'] = $last_quarter['start'];
     46        $last_quarter['end'] = $last_quarter['end'];
     47
     48
    4849        $this->load->model('paidlog_model');
    4950        $paidlogs = $this->paidlog_model->getAllPaidlogs($last_year['start']);
    50        
    51         $revenue['last_week']=0;
    52         $revenue['last_month']=0;
    53         $revenue['last_quarter']=0;
    54         $revenue['last_year']=0;
    55         foreach ($paidlogs as $paidlog)
    56         {
    57            
    58             if (($paidlog['time'] < $last_week['end'])&&($paidlog['time'] > $last_week['start']))
    59             {
     51
     52        $revenue['last_week'] = 0;
     53        $revenue['last_month'] = 0;
     54        $revenue['last_quarter'] = 0;
     55        $revenue['last_year'] = 0;
     56
     57        $lastmonth = strtotime("first day of previous month");
     58        $thismonth = strtotime("first day of this month");
     59        $charts['last_month'] = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0);
     60        $charts['this_month'] = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0);
     61        foreach ($paidlogs as $paidlog) {
     62
     63            if (($paidlog['time'] < $last_week['end']) && ($paidlog['time'] > $last_week['start'])) {
    6064                $revenue['last_week']+=$paidlog['amount'];
    6165            }
    62             if (($paidlog['time'] < $last_month['end'])&&($paidlog['time'] > $last_month['start']))
    63             {
     66            if (($paidlog['time'] < $last_month['end']) && ($paidlog['time'] > $last_month['start'])) {
    6467                $revenue['last_month']+=$paidlog['amount'];
    6568            }
    66             if (($paidlog['time'] < $last_quarter['end'])&&($paidlog['time'] > $last_quarter['start']))
    67             {
     69            if (($paidlog['time'] < $last_quarter['end']) && ($paidlog['time'] > $last_quarter['start'])) {
    6870                $revenue['last_quarter']+=$paidlog['amount'];
    6971            }
    70             if (($paidlog['time'] < $last_year['end'])&&($paidlog['time'] > $last_year['start']))
    71             {
     72            if (($paidlog['time'] < $last_year['end']) && ($paidlog['time'] > $last_year['start'])) {
    7273                $revenue['last_year']+=$paidlog['amount'];
    7374            }
    74         }
    75         $data['revenue']=$revenue;
     75            if (($paidlog['time'] < $lastmonth + (7 * 24 * 60 * 60)) && ($paidlog['time'] > $lastmonth)) {
     76                $charts['last_month'][0]+=$paidlog['amount'];
     77            }
     78            if (($paidlog['time'] < $lastmonth + (14 * 24 * 60 * 60)) && ($paidlog['time'] > $lastmonth + (7 * 24 * 60 * 60))) {
     79                $charts['last_month'][1]+=$paidlog['amount'];
     80            }
     81            if (($paidlog['time'] < $lastmonth + (21 * 24 * 60 * 60)) && ($paidlog['time'] > $lastmonth + (14 * 24 * 60 * 60))) {
     82                $charts['last_month'][2]+=$paidlog['amount'];
     83            }
     84            if (($paidlog['time'] < $lastmonth + (28 * 24 * 60 * 60)) && ($paidlog['time'] > $lastmonth + (21 * 24 * 60 * 60))) {
     85                $charts['last_month'][3]+=$paidlog['amount'];
     86            }
     87            if (($paidlog['time'] < $thismonth) && ($paidlog['time'] > $lastmonth + (28 * 24 * 60 * 60))) {
     88                $charts['last_month'][3]+=$paidlog['amount'];
     89            }
     90
     91            if (($paidlog['time'] < $thismonth + (7 * 24 * 60 * 60)) && ($paidlog['time'] > $thismonth)) {
     92                $charts['this_month'][0]+=$paidlog['amount'];
     93            }
     94            if (($paidlog['time'] < $thismonth + (14 * 24 * 60 * 60)) && ($paidlog['time'] > $thismonth + (7 * 24 * 60 * 60))) {
     95                $charts['this_month'][1]+=$paidlog['amount'];
     96            }
     97            if (($paidlog['time'] < $thismonth + (21 * 24 * 60 * 60)) && ($paidlog['time'] > $thismonth + (14 * 24 * 60 * 60))) {
     98                $charts['this_month'][2]+=$paidlog['amount'];
     99            }
     100            if (($paidlog['time'] < $thismonth + (28 * 24 * 60 * 60)) && ($paidlog['time'] > $thismonth + (21 * 24 * 60 * 60))) {
     101                $charts['this_month'][3]+=$paidlog['amount'];
     102            }
     103            if (($paidlog['time'] < $thismonth + (31 * 24 * 60 * 60)) && ($paidlog['time'] > $thismonth + (28 * 24 * 60 * 60))) {
     104                $charts['this_month'][3]+=$paidlog['amount'];
     105            }
     106        }
     107        $max = 0;
     108        foreach ($charts['last_month'] as $index => $total) {
     109            if ($total > $max) {
     110                $max = $total;
     111            }
     112            $chart_last_month[] = array($index, $total);
     113        }
     114        foreach ($charts['this_month'] as $index => $total) {
     115            if ($total > $max) {
     116                $max = $total;
     117            }
     118            $chart_this_month[] = array($index, $total);
     119        }
     120
     121        $data['revenue'] = $revenue;
     122        $data['max'] = $max;
     123        $chard[] = array("color" => "#1abc9c", "label" => "Tháng hiện tại", "data" => $chart_this_month);
     124        $chard[] = array("color" => "#3498db", "label" => "Tháng trước", "data" => $chart_last_month);
     125        $data['chard'] = $chard;
     126
    76127        return $this->load->view('report/statistics', $data, true);
    77128    }
    78     public function getLastquarter()
    79     {
     129
     130    public function getLastquarter() {
    80131        $current_month = date('m');
    81           $current_year = date('Y');
    82 
    83           if($current_month>=1 && $current_month<=3)
    84           {
    85             $start_date = strtotime('1-October-'.($current_year-1));  // timestamp or 1-October Last Year 12:00:00 AM
    86             $end_date = strtotime('1-Janauary-'.$current_year);  // // timestamp or 1-January  12:00:00 AM means end of 31 December Last year
    87           }
    88           else if($current_month>=4 && $current_month<=6)
    89           {
    90             $start_date = strtotime('1-January-'.$current_year);  // timestamp or 1-Janauray 12:00:00 AM
    91             $end_date = strtotime('1-April-'.$current_year);  // timestamp or 1-April 12:00:00 AM means end of 31 March
    92           }
    93           else  if($current_month>=7 && $current_month<=9)
    94           {
    95             $start_date = strtotime('1-April-'.$current_year);  // timestamp or 1-April 12:00:00 AM
    96             $end_date = strtotime('1-July-'.$current_year);  // timestamp or 1-July 12:00:00 AM means end of 30 June
    97           }
    98           else  if($current_month>=10 && $current_month<=12)
    99           {
    100             $start_date = strtotime('1-July-'.$current_year);  // timestamp or 1-July 12:00:00 AM
    101             $end_date = strtotime('1-October-'.$current_year);  // timestamp or 1-October 12:00:00 AM means end of 30 September
    102           }
    103           return array("start"=>$start_date,"end"=>$end_date);
    104     }
     132        $current_year = date('Y');
     133
     134        if ($current_month >= 1 && $current_month <= 3) {
     135            $start_date = strtotime('1-October-' . ($current_year - 1));  // timestamp or 1-October Last Year 12:00:00 AM
     136            $end_date = strtotime('1-Janauary-' . $current_year);  // // timestamp or 1-January  12:00:00 AM means end of 31 December Last year
     137        } else if ($current_month >= 4 && $current_month <= 6) {
     138            $start_date = strtotime('1-January-' . $current_year);  // timestamp or 1-Janauray 12:00:00 AM
     139            $end_date = strtotime('1-April-' . $current_year);  // timestamp or 1-April 12:00:00 AM means end of 31 March
     140        } else if ($current_month >= 7 && $current_month <= 9) {
     141            $start_date = strtotime('1-April-' . $current_year);  // timestamp or 1-April 12:00:00 AM
     142            $end_date = strtotime('1-July-' . $current_year);  // timestamp or 1-July 12:00:00 AM means end of 30 June
     143        } else if ($current_month >= 10 && $current_month <= 12) {
     144            $start_date = strtotime('1-July-' . $current_year);  // timestamp or 1-July 12:00:00 AM
     145            $end_date = strtotime('1-October-' . $current_year);  // timestamp or 1-October 12:00:00 AM means end of 30 September
     146        }
     147        return array("start" => $start_date, "end" => $end_date);
     148    }
     149
    105150    public function getPaidlogs($filters = array()) {
    106151        $this->load->helper('pagging');
     
    110155        $data['perpage'] = 10;
    111156        $data['keyword'] = "";
    112         $data['sorting_order']="sorting_desc";
    113         $data['sorting_field']="paid_id";
    114        
     157        $data['sorting_order'] = "sorting_desc";
     158        $data['sorting_field'] = "paid_id";
     159
    115160        if ($this->input->post('sorting_order')) {
    116             if ($this->input->post('sorting_order') != "sorting")
    117             {
    118                $data['sorting_order']=$this->input->post('sorting_order');
    119                $data['sorting_field']=$this->input->post('sorting_field');
     161            if ($this->input->post('sorting_order') != "sorting") {
     162                $data['sorting_order'] = $this->input->post('sorting_order');
     163                $data['sorting_field'] = $this->input->post('sorting_field');
    120164            }
    121165        }
     
    124168        }
    125169        if ($this->input->post('keyword')) {
    126             $data['search_field']="";
     170            $data['search_field'] = "";
    127171            $data['keyword'] = $this->input->post('keyword');
    128            
    129             if (preg_match("/[0-9]/", $data['keyword']))
    130             {
    131                $data['search_field']="cellphone";
    132             }
    133            
    134         }
    135        
    136         $data['start'] = ($data['current_page'] - 1) * $data['perpage'];   
    137         $data['total'] = $this->paidlog_model->countPaidlog($data); 
     172
     173            if (preg_match("/[0-9]/", $data['keyword'])) {
     174                $data['search_field'] = "cellphone";
     175            }
     176        }
     177
     178        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
     179        $data['total'] = $this->paidlog_model->countPaidlog($data);
    138180        $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data);
    139181
     
    141183        $data['num_links'] = 2;
    142184        $data['paging'] = pagging($data);
    143         foreach ($data['paidlogs'] as $index=>$paidlog)
    144         {
    145         $data['paidlogs'][$index]['username']= @$this->get_username($paidlog['us_id']);
    146         }
    147      
     185        foreach ($data['paidlogs'] as $index => $paidlog) {
     186            $data['paidlogs'][$index]['username'] = $this->get_username($paidlog['us_id']);
     187        }
     188
    148189        if ($this->input->is_ajax_request()) {
    149190            return $this->load->view('report/listview', $data);
     
    151192        return $this->load->view('report/listview', $data, true);
    152193    }
    153     public function get_username($us_id)
    154         {
    155         $us_id=33;
    156                 $src = 'violet';
    157                 $token = md5($us_id.self::TOKENPW);
    158                 $this->load->model('user_model');
    159                 $data = $this->user_model->get_user_info($src, $us_id, $token);
    160                 if (strlen($data) > 0){
    161                         $arr_users = explode("&", $data);
    162                         $str_username = $arr_users[1];
    163                         $arr_username = explode("=", $str_username);
    164                         return $arr_username[1];
    165                 }else
    166                 {
    167                         return "";
    168                 }
    169 
    170         }
    171 
    172     public function addPaidlog() {
    173         $result['success'] = 0;
    174         $result = array();
    175         $input = $this->input->post();
    176         $this->load->model('paidlog_model');
    177         if (strlen($input['sms_content'])==0)
    178         {
    179             $result['errors'][]="Nội dung tin nhắn khÃŽng được để trống";
    180         }
    181         if (strlen($input['sms_reply'])==0)
    182         {
    183             $result['errors'][]="Tin nhắn trả về khÃŽng được để trống";
    184         }
    185         else
    186         {
    187             /*
    188             if ($this->paidlog_model->isExist(array('field'=>'login_name','value'=>$input['login_name'],'id'=>$input['id'])))
    189             {
    190                 $result['errors'][]="Tên đăng nhập đã được sá»­ dụng";
    191             }
    192              *
    193              */
    194         }
    195         if (strlen($input['service_id'])==0)
    196         {
    197             $result['errors'][]="Mã dịch vụ khÃŽng được để trống";
    198         }
    199         else
    200         {
    201             /*
    202             if ($this->paidlog_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone'],'id'=>$input['id'])))
    203             {
    204                 $result['errors'][]="Số điện thoại đã được sá»­ dụng";
    205             }
    206              *
    207              */
    208         }
    209         if (!isset($result['errors']))
    210         {
     194
     195    public function get_username($us_id) {
     196        $src = 'violet';
     197        $token = md5($us_id . self::TOKENPW);
     198        $this->load->model('user_model');
     199        $data = $this->user_model->get_user_info($src, $us_id, $token);
     200        if (strlen($data) > 0) {
     201            $arr_users = explode("&", $data);
     202            $str_username = $arr_users[1];
     203            $arr_username = explode("=", $str_username);
     204            return $arr_username[1];
     205        } else {
     206            return "";
     207        }
     208    }
     209
     210    public function test() {
     211
     212
     213        for ($i = 1; $i <= 5000; $i++) {
     214            $input['us_id'] = rand(1, 100);
     215            $input['paid_type'] = rand(1, 2);
     216            $input['amount'] = rand(3, 10) * 1000;
     217            $time = (rand((time() - (12 * 30 * 24 * 60 * 60)), time()));
     218            $input['paid_time'] = date("Y-m-d H:i:s", $time);
    211219            $this->load->model('paidlog_model');
    212220            $this->paidlog_model->insert($input);
    213             $result['success'] = 1;
    214         }
    215 
    216        
    217         echo json_encode($result);
    218     }
    219     public function viewSms()
    220     {
    221         $id=$this->uri->segment(4);
    222         $this->load->model('paidlog_model');
    223         $data=$this->paidlog_model->getPaidlog($id);
    224         $this->load->view('report/viewSms',$data);
    225     }
    226     public function editSms()
    227     {
    228         $id=$this->uri->segment(4);
    229         $this->load->model('paidlog_model');
    230         $data=$this->paidlog_model->getPaidlog($id);
    231         $this->load->view('report/editSms',$data);
    232     }
    233     public function dodeleteSms()
    234     {
    235         $input=$this->input->post();
    236         $id=$input['sms_id'];
    237         $this->load->model('paidlog_model');
    238         $data=$this->paidlog_model->delete($id);
    239         $result['success']=1;
    240         echo json_encode($result);
    241     }
    242     public function deleteSms()
    243     {
    244         $id=$this->uri->segment(4);
    245         $this->load->model('paidlog_model');
    246         $data=$this->paidlog_model->getPaidlog($id);
    247         $this->load->view('report/deleteSms',$data);
    248     }
    249     public function updateSms()
    250     {
    251        
    252         $input=  $this->input->post();
    253         $this->load->model('paidlog_model');
    254         if (strlen($input['sms_content'])==0)
    255         {
    256             $result['errors'][]="Nội dung tin nhắn khÃŽng được để trống";
    257         }
    258         if (strlen($input['sms_reply'])==0)
    259         {
    260             $result['errors'][]="Tin nhắn trả về khÃŽng được để trống";
    261         }
    262         else
    263         {
    264             /*
    265             if ($this->paidlog_model->isExist(array('field'=>'login_name','value'=>$input['login_name'],'id'=>$input['id'])))
    266             {
    267                 $result['errors'][]="Tên đăng nhập đã được sá»­ dụng";
    268             }
    269              *
    270              */
    271         }
    272         if (strlen($input['service_id'])==0)
    273         {
    274             $result['errors'][]="Mã dịch vụ khÃŽng được để trống";
    275         }
    276         else
    277         {
    278             /*
    279             if ($this->paidlog_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone'],'id'=>$input['id'])))
    280             {
    281                 $result['errors'][]="Số điện thoại đã được sá»­ dụng";
    282             }
    283              *
    284              */
    285         }
    286        
    287         if (!isset($result['errors']))
    288         {
    289             $this->load->model('paidlog_model');
    290             $this->paidlog_model->update($input['sms_id'],$input);
    291             $result['success'] = 1;
    292         }
    293         echo json_encode($result);
    294     }
    295     public function test() {
    296        
    297      
    298         for ($i = 1; $i <= 5000; $i++) {
    299             $input['us_id']=rand(1,100);
    300             $input['paid_type']=rand(1,2);
    301             $input['amount']=rand(3,10)*1000;
    302             $time=(rand((time()-(12*30*24*60*60)),time()));
    303             $input['paid_time']= date("Y-m-d H:i:s",$time);
    304             $this->load->model('paidlog_model');
    305             $this->paidlog_model->insert($input);
    306         }
    307        
    308        die();
    309      
     221        }
     222
     223        die();
     224
    310225        for ($i = 1; $i <= 100; $i++) {
    311             $input['us_id']=$i;
    312             $input['cellphone']="01234567".(100+$i);
    313             $input['collaborator']=rand(1,100);
    314             $input['acc_balanced']=rand(100000,1000000);
    315             $input['expire_date']=date("Y-m-d H:i:s",time());
    316             $input['created_time']=date("Y-m-d H:i:s",time());
    317             $input['updated_time']=date("Y-m-d H:i:s",time());
     226            $input['us_id'] = $i;
     227            $input['cellphone'] = "01234567" . (100 + $i);
     228            $input['collaborator'] = rand(1, 100);
     229            $input['acc_balanced'] = rand(100000, 1000000);
     230            $input['expire_date'] = date("Y-m-d H:i:s", time());
     231            $input['created_time'] = date("Y-m-d H:i:s", time());
     232            $input['updated_time'] = date("Y-m-d H:i:s", time());
    318233            $this->load->model('user_model');
    319234            $this->user_model->insert($input);
  • pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php

    r442 r444  
    3434    }
    3535
    36     function isExist($data) {
    37         $sql = "SELECT COUNT(id) as total FROM " . $this->table_name . " WHERE " . $data['field'] . " = '" . $data['value'] . "'";
    38         if (isset($data['id']))
    39         {
    40             $id=$data['id'];
    41             $sql.=" AND id <> ".$id." LIMIT 1";
    42         }
    43         $result = $this->db->query($sql)->row_array();
    44         if ($result['total'] == 1) {
    45             return true;
    46         } else {
    47             return false;
    48         }
    49     }
     36
    5037
    5138    function countPaidlog($data) {
  • pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php

    r435 r444  
    6868        {
    6969                $data = $this->vservices->actionExecute('getinfo', array('src' => $src, 'us_id' => $us_id, 'token'=>$token), 'user');
    70                 return $data;
     70                return $data;
    7171        }
    7272}
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php

    r441 r444  
    7676
    7777
     78
     79                                $('#sales-charts').css({'width':'100%' , 'height':'200px'});
     80                                $.plot("#sales-charts", <?php echo json_encode($chard) ?>, {
     81                                        hoverable: true,
     82                                        shadowSize: 0,
     83                                        series: {
     84                                                lines: { show: true },
     85                                                points: { show: true }
     86                                        },
     87                                        xaxis: {
     88                                                tickLength: 0
     89                                        },
     90                                        yaxis: {
     91                                                ticks: 10,
     92                                                min: 0,
     93                                                max:<?php echo $max;?>,
     94                                                tickDecimals: 0
     95                                        },
     96                                        grid: {
     97                                                backgroundColor: { colors: [ "#fff", "#fff" ] },
     98                                                borderWidth: 1,
     99                                                borderColor:'#555'
     100                                        }
     101                                });
    78102    }
    79103
     
    120144                        }
    121145                </style>
     146             
    122147<div class="main-content" >
    123148    <div id="breadcrumbs" class="breadcrumbs">
     
    268293</div><!-- /.modal-dialog -->
    269294<?php
    270 $this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/smstemplate.js')));
     295$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js')));
    271296?>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php

    r442 r444  
    55            <!-- PAGE CONTENT BEGINS -->
    66            <div style="padding-bottom:4px" class="table-header">
    7                 Tin nhắn
     7                Thống kê
    88
    9                 <button href="#addSms" data-toggle="modal" class="btn btn-success pull-right">
    10                     <i class="icon-plus"></i>
    11                     Thêm tin nhắn
    12                 </button>
     9             
    1310
    1411            </div>
     
    7572                                <td class=" "><?php echo $paidlog['cellphone']?></td>
    7673                               
    77                                 <td class="hidden-480 "><?php echo $paidlog['amount']?></td>
     74                                <td class="hidden-480 "><?php echo number_format($paidlog['amount'],0);?></td>
    7875                                <td class="hidden-480 "><?php if ($paidlog['paid_type']==1) {echo "SMS";} else { echo "Card";}?></td>
    7976                                <td class=" "><?php echo $paidlog['paid_time']?></td>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/statistics.php

    r441 r444  
    2929                                <td>Tuần trước</td>
    3030                                <td>
    31                                     <?php echo $revenue['last_week'];?>
     31                                    <?php echo number_format($revenue['last_week'],0); ?>
    3232                                </td>
    3333                            </tr>
     
    3535                                <td>Tháng trước</td>
    3636                                <td>
    37                                     <?php echo $revenue['last_month'];?>
     37                                    <?php echo number_format($revenue['last_month'],0); ?>
    3838                                </td>
    3939                            </tr>
     
    4141                                <td>QuÜ trước</td>
    4242                                <td>
    43                                     <?php echo $revenue['last_quarter'];?>
     43                                    <?php echo number_format($revenue['last_quarter'],0); ?>
    4444                                </td>
    4545                            </tr>
     
    4747                                <td>Năm trước</td>
    4848                                <td>
    49                                     <?php echo $revenue['last_year'];?>
     49                                    <?php  echo number_format($revenue['last_year'],0); ?>
    5050                                </td>
    5151                            </tr>
     
    7171                </div>
    7272            </div>
    73 
     73           
    7474            <div class="widget-body">
    7575                <div class="widget-main padding-4">
    76                     <div id="sales-charts" style="width: 100%; height: 200px; padding: 0px; position: relative;"><canvas class="flot-base" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 534px; height: 200px;" width="534" height="200"></canvas><div class="flot-text" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; font-size: smaller; color: rgb(84, 84, 84);"><div class="flot-x-axis flot-x1-axis xAxis x1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;"><div style="position: absolute; max-width: 76px; top: 184px; left: 29px; text-align: center;" class="flot-tick-label tickLabel">0.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 110px; text-align: center;" class="flot-tick-label tickLabel">1.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 192px; text-align: center;" class="flot-tick-label tickLabel">2.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 274px; text-align: center;" class="flot-tick-label tickLabel">3.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 355px; text-align: center;" class="flot-tick-label tickLabel">4.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 437px; text-align: center;" class="flot-tick-label tickLabel">5.0</div><div style="position: absolute; max-width: 76px; top: 184px; left: 519px; text-align: center;" class="flot-tick-label tickLabel">6.0</div></div><div class="flot-y-axis flot-y1-axis yAxis y1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;"><div style="position: absolute; top: 172px; left: 1px; text-align: right;" class="flot-tick-label tickLabel">-2.000</div><div style="position: absolute; top: 150px; left: 1px; text-align: right;" class="flot-tick-label tickLabel">-1.500</div><div style="position: absolute; top: 129px; left: 1px; text-align: right;" class="flot-tick-label tickLabel">-1.000</div><div style="position: absolute; top: 107px; left: 1px; text-align: right;" class="flot-tick-label tickLabel">-0.500</div><div style="position: absolute; top: 86px; left: 4px; text-align: right;" class="flot-tick-label tickLabel">0.000</div><div style="position: absolute; top: 65px; left: 4px; text-align: right;" class="flot-tick-label tickLabel">0.500</div><div style="position: absolute; top: 43px; left: 4px; text-align: right;" class="flot-tick-label tickLabel">1.000</div><div style="position: absolute; top: 22px; left: 4px; text-align: right;" class="flot-tick-label tickLabel">1.500</div><div style="position: absolute; top: 1px; left: 4px; text-align: right;" class="flot-tick-label tickLabel">2.000</div></div></div><canvas class="flot-overlay" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 534px; height: 200px;" width="534" height="200"></canvas><div class="legend"><div style="position: absolute; width: 86px; height: 66px; top: 13px; right: 13px; background-color: rgb(255, 255, 255); opacity: 0.85;"> </div><table style="position:absolute;top:13px;right:13px;;font-size:smaller;color:#545454"><tbody><tr><td class="legendColorBox"><div style="border:1px solid #ccc;padding:1px"><div style="width:4px;height:0;border:5px solid #1abc9c;overflow:hidden"></div></div></td><td class="legendLabel">SMS</td></tr><tr><td class="legendColorBox"><div style="border:1px solid #ccc;padding:1px"><div style="width:4px;height:0;border:5px solid #e67e22;overflow:hidden"></div></div></td><td class="legendLabel">Thẻ cào</td></tr><tr><td class="legendColorBox"><div style="border:1px solid #ccc;padding:1px"><div style="width:4px;height:0;border:5px solid #3498db;overflow:hidden"></div></div></td><td class="legendLabel">Cộng tác viên</td></tr></tbody></table></div></div>
     76                    <div id="sales-charts"></div>
    7777                </div><!-- /widget-main -->
    78             </div><!-- /widget-body -->
     78            </div>
     79           
    7980        </div><!-- /widget-box -->
    8081    </div>
     
    8687    <!-- PAGE CONTENT ENDS -->
    8788</div>
     89<script type="text/javascript">
     90
     91
     92</script>
  • pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php

    r358 r444  
    4646                        jQuery(function($) {
    4747
    48                                 var d1 = [];
    49                                 for (var i = 0; i < Math.PI * 2; i += 0.5) {
    50                                         d1.push([i, Math.sin(i)]);
    51                                 }
    52                        
    53                                 var d2 = [];
    54                                 for (var i = 0; i < Math.PI * 2; i += 0.5) {
    55                                         d2.push([i, Math.cos(i)]);
    56                                 }
    57                        
    58                                 var d3 = [];
    59                                 for (var i = 0; i < Math.PI * 2; i += 1.2) {
    60                                         d3.push([i, Math.sin(i)]);
    61                                 }
    6248                               
    63                        
    64                                 var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'320px'});
    65                                 $.plot("#sales-charts", [
    66                                         { color: '#1abc9c', label: "SMS", data: d1 },
    67                                         { color: '#e67e22', label: "Thẻ cào", data: d2 },
    68                                         { color: '#3498db', label: "Cộng tác viên", data: d3 }
    69                                 ], {
    70                                         hoverable: true,
    71                                         shadowSize: 0,
    72                                         series: {
    73                                                 lines: { show: true },
    74                                                 points: { show: true }
    75                                         },
    76                                         xaxis: {
    77                                                 tickLength: 0
    78                                         },
    79                                         yaxis: {
    80                                                 ticks: 10,
    81                                                 min: -2,
    82                                                 max: 2,
    83                                                 tickDecimals: 3
    84                                         },
    85                                         grid: {
    86                                                 backgroundColor: { colors: [ "#fff", "#fff" ] },
    87                                                 borderWidth: 1,
    88                                                 borderColor:'#555'
    89                                         }
    90                                 });
    9149
    9250                                var d6 = [];
Note: See TracChangeset for help on using the changeset viewer.