Ignore:
Timestamp:
Nov 18, 2014 5:13:28 PM (11 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/frontend
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php

    r556 r559  
    2727            $data['packages'] = $this->servicepackage_model->getAllPackages();
    2828            $data['is_viettel'] = $user_info['is_viettel'];
     29                        $paidlogs = $this->user_model->getPaidlog($us_id);
     30                        $data['paidlogs'] = $paidlogs;
    2931            parse_str($user, $info);
    3032            $data = array_merge($data, $u);
    3133            $data = array_merge($data, $user_info);
     34                        //var_dump($data);
     35                       
    3236            $this->load->view('frontend/user_profile', $data);
    3337        } else {
  • pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r556 r559  
    365365                        $user ['updated_time'] = date ( 'Y-m-d H:i:s' );
    366366                        $this->updateUser ( $us_id, $user );
    367                         $sms = "Qui vi da nap thanh cong " . $amount . " VND vao tai khoan " . $username . " tren soanbaigiang.smas.vn";
     367                        $sms = "Qui vi da nap thanh cong " . $amount . " VNĐ vao tai khoan " . $username . " tren soanbaigiang.smas.vn";
    368368                        $status = 1;
    369369                } else {
     
    445445                $paidlog ['paidType'] = $paidType;
    446446                $paidlog ['amount'] = $amount;
     447                $paidlog['source'] = "";
     448                if ($paidType == 1)
     449                {
     450                        $paidlog['source'] = $sentNumber;
     451                       
     452                }else
     453                {
     454                        $paidlog['source'] = "Thẻ cào";
     455                }
    447456                $paidlog ['paidTime'] = $paidTime;
    448457                $this->db->query ( 'UNLOCK TABLES' );
    449                 $sql = 'INSERT INTO tblpaidlog(us_id, paid_type, amount, paid_time) VALUES (?,?,?,?)';
     458                $sql = 'INSERT INTO tblpaidlog(us_id, paid_type, amount, source, paid_time) VALUES (?,?,?,?,?)';
    450459                $query = $this->db->query ( $sql, $paidlog );
    451460        }
     
    469478                $query = $this->db->query ($sql, $cardlog);
    470479        }
     480       
     481        public function getPaidlog($us_id)
     482        {
     483                $this->db->query ( 'UNLOCK TABLES' );
     484                $sql = 'SELECT * FROM tblpaidlog where us_id = ?';
     485                $query = $this->db->query ( $sql, array (
     486                                $us_id
     487                ) );
     488                $row = $query->result_array();
     489                return $row;
     490        }
    471491}
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php

    r557 r559  
    328328                            <tr>
    329329                                <th class="center">
    330                                     <label>
    331                                         <input type="checkbox" class="ace" />
    332                                         <span class="lbl"></span>
    333                                     </label>
     330                                                                        Từ
    334331                                </th>
    335332                                <th>Số tiền</th>
     
    343340
    344341                        <tbody>
     342                                                        <?php if ($paidlogs) {?>
     343                                                        <?php foreach($paidlogs as $paidlog): ?>
    345344                            <tr>
    346345                                <td class="center">
    347                                     <label>
    348                                         <input type="checkbox" class="ace" />
    349                                         <span class="lbl"></span>
    350                                     </label>
     346                                                                <?php echo $paidlog['source']; ?>
    351347                                </td>
    352                                 <td>$45</td>
    353                                 <td>Feb 12</td>
     348                                <td><?php echo $paidlog['amount']; ?></td>
     349                                <td><?php echo date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));?></td>
    354350                            </tr>
     351                                                        <?php endforeach; ?>
     352                                                        <?php }else{ ?>
     353                                                        <tr>
     354                                <td class="center" colspan=3>Quí vị chưa có giao dịch nào!</td>
     355                                                        </tr>
     356                                                        <?php } ?>
    355357                        </tbody>
    356358                    </table>
Note: See TracChangeset for help on using the changeset viewer.