Ignore:
Timestamp:
Nov 10, 2014 11:07:50 AM (11 years ago)
Author:
quyenla
Message:

paidlogs

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

Legend:

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

    r441 r442  
    66class Report extends MX_Controller {
    77
     8    const TOKENPW = 'violet';
    89    public function __construct() {
    910        parent::__construct();
     
    140141        $data['num_links'] = 2;
    141142        $data['paging'] = pagging($data);
    142 
     143        foreach ($data['paidlogs'] as $index=>$paidlog)
     144        {
     145        $data['paidlogs'][$index]['username']= @$this->get_username($paidlog['us_id']);
     146        }
     147     
    143148        if ($this->input->is_ajax_request()) {
    144149            return $this->load->view('report/listview', $data);
     
    146151        return $this->load->view('report/listview', $data, true);
    147152    }
     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        }
    148171
    149172    public function addPaidlog() {
  • pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php

    r441 r442  
    1010        {
    1111                parent::__construct();
     12
    1213        }
    1314        function getPaidlogs($data) {
     
    1516        if ($data['keyword']) {
    1617            if ($data['search_field'] == "cellphone") {
    17                 $sql.=" WHERE (service_id LIKE '%" . $data['keyword'] . "%')";
    18             } else {
    19                 $sql.=" WHERE (sms_content LIKE '%" . $data['keyword'] . "%' OR sms_reply LIKE '%" . $data['keyword'] . "%') ";
    20             }
     18                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     19            }
    2120        }
    2221
     
    5150
    5251    function countPaidlog($data) {
    53         $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name;
     52        $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name." INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id";
    5453        if ($data['keyword']) {
    5554            if ($data['search_field'] == "cellphone") {
    56                 $sql.=" WHERE (service_id LIKE '%" . $data['keyword'] . "%')";
    57             } else {
    58                 $sql.=" WHERE (sms_content LIKE '%" . $data['keyword'] . "%' OR sms_reply LIKE '%" . $data['keyword'] . "%') ";
    59             }
     55                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     56            }
    6057        }
     58       
    6159        $result = $this->db->query($sql)->row_array();
    6260        return $result['total'];
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php

    r441 r442  
    4848                                    </label>
    4949                                </th>
    50                                 <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "sorting";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Họ tên</th>
     50                                <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Họ tên</th>
    5151                                <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="Họ tên: activate to sort column ascending">Số điện thoại</th>
    5252                                <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Số tiền</th>
     
    7171
    7272                                <td class=" ">
    73                                     <a href="#">Ho va ten</a>
     73                                    <a href="#"><?php echo $paidlog['username'];?></a>
    7474                                </td>
    7575                                <td class=" "><?php echo $paidlog['cellphone']?></td>
Note: See TracChangeset for help on using the changeset viewer.