Changeset 777


Ignore:
Timestamp:
Mar 3, 2015 4:43:43 PM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/admin
Files:
4 edited

Legend:

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

    r767 r777  
    7979        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    8080        $data['total'] = $this->paidlog_model->countPaidlog($data);
    81         $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data);
    82 
     81        $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data)['paid_logs'];
     82                $data['total_amount'] = $this->paidlog_model->getPaidlogs($data)['total_amount'];
     83               
    8384        $data['paging_url'] = base_url() . "/admin/doanh_thu_tong_hop/trang/";
    8485        $data['num_links'] = 2;
  • pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php

    r767 r777  
    1313        }
    1414        function getPaidlogs($data) {
     15                if ($data['paid_type'] == 0){
     16                        $sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog";
     17                }else{
     18                        $sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog WHERE paid_type = ".$data['paid_type'];
     19                }
     20                $r = $this->db->query($sql)->row_array();
     21                $total_amount = (int)$r['total_amount'];
    1522        $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id ";
    1623                if ($data['paid_type'] == 1){
     
    4754        }
    4855        $sql=$sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
    49         return $this->db->query($sql)->result_array();
     56        //return $this->db->query($sql)->result_array();
     57                $re = $this->db->query($sql)->result_array();
     58                $result['paid_logs'] = $re;
     59                $result['total_amount'] = $total_amount;
     60                return $result;
    5061    }
    5162
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php

    r690 r777  
    210210</div><!-- /.modal-dialog -->
    211211<?php
    212 $this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js')));
     212$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js', 'assets/js/admin/user.js')));
    213213?>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php

    r767 r777  
    6666
    6767                                                        <td class=" ">
    68                                                                 <a href="#"><?php echo $paidlog['username'];?></a>
     68                                                                <a onclick="getUserHistory(<?php echo $paidlog['us_id']; ?>, 1);" data-toggle="modal"><?php echo $paidlog['username'];?></a>
    6969                                                        </td>
    7070                                                        <td class=" "><?php echo $paidlog['cellphone']?></td>
     
    8585
    8686
    87 
     87                                                <tr>
     88                                                <td colspan=2>
     89                                                Tổng tiền
     90                                                </td>
     91                                                <td colspan=3>
     92                                                <?php echo $total_amount; ?>
     93                                                </td>                   
     94                                                </tr>
    8895                                        </tbody></table><div class="row"><div class="col-sm-6">
    8996                                                        <div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>
     
    104111               
    105112        </div>
    106 
     113<!-- Modal User History -->
     114<div class="modal fade" id="user-history" tabindex="-1" role="dialog"aria-hidden="true">
     115    <div class="modal-dialog">
     116        <div class="modal-content">
     117            <div class="modal-header">
     118                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
     119                <h4 class="modal-title">Lịch sử</h4>
     120            </div>
     121            <div class="modal-body">
     122                <ul class="nav nav-tabs padding-16">
     123                    <li class="active" >
     124                        <a id="regis-tab" href="#regis" data-toggle="tab">
     125                            Giao dịch
     126                        </a>
     127                    </li>
     128                    <li>
     129                        <a id="trade-tab" href="#trade" data-toggle="tab">
     130                            Thông tin
     131                        </a>
     132                    </li>
     133                </ul>
     134                <div class="tab-content history-tab-content">
     135                    <div class="tab-pane in active" id="regis">
     136                        <div class="table-responsive">
     137                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
     138                                <thead>
     139                                    <tr>
     140                                        <th class="center">
     141                                            Từ
     142                                        </th>
     143                                                                                <th class="center"> Số tiền (VNĐ) </th>
     144                                        <th class="center"> Gói dịch vụ </th>
     145                                        <th>
     146                                            <i class="icon-time bigger-110 hidden-480"></i>
     147                                            Thời gian
     148                                        </th>
     149                                    </tr>
     150                                </thead>
     151                                <tbody id="content-regis-histoty">
     152                                </tbody>
     153                            </table>
     154                            <div>
     155                                <div class="dataTables_paginate paging_bootstrap">
     156                                    <ul class="pagination" id="regis-pagination">
     157                                    </ul>
     158                                </div>
     159                            </div>
     160                        </div><!-- /.table-responsive -->
     161                    </div>
     162                    <div class="tab-pane" id="trade">
     163                        <div class="row">
     164                           
     165                                <div id="content-trade-histoty">
     166                                </div>
     167                       
     168                            </div>
     169                        </div><!-- /.table-responsive -->
     170                    </div>
     171                </div>
     172            </div><!-- Modal Body -->
     173        </div> <!-- Modal Content -->
     174    </div>
    107175
    108176<script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.