Changeset 767
- Timestamp:
- Feb 25, 2015 5:25:04 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php
r690 r767 59 59 } 60 60 } 61 62 $data ['paid_types'] = array ( 63 0 => "Tất cả", 64 1 => "SMS", 65 2 => "Card", 66 ); 67 $data ['paid_type'] = 0; 68 if ($this->input->post ( 'paid_type' )) { 69 $data ['paid_type'] = ( int ) $this->input->post ( 'paid_type' ); 70 } 71 61 72 $data['daterange_start'] = ""; 62 73 $data['daterange_end'] = ""; … … 76 87 $data['paidlogs'][$index]['username'] = @$this->get_fullname($paidlog['us_id']); 77 88 } 78 89 79 90 if ($this->input->is_ajax_request()) { 80 91 return $this->load->view('report/listview', $data); -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
r765 r767 40 40 0 => "Tất cả", 41 41 1 => "Äã ÄÄng kÜ", 42 2 => "Dùng thá»" 42 2 => "Dùng thá»", 43 3=> "Dùng thá» hạn chế", 44 4=> "Hết hạn" 43 45 ); 44 46 $data ['status'] = 0; … … 80 82 if ($userinfo) { 81 83 $u ['username'] = $userinfo ['username']; 84 $u['fullname'] = $userinfo['fullname']; 82 85 } 83 86 array_push ( $users, $u ); -
pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php
r741 r767 14 14 function getPaidlogs($data) { 15 15 $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id "; 16 if ($data['paid_type'] == 1){ 17 $sql.=" WHERE paid_type = 1"; 18 } 19 if ($data['paid_type'] == 2){ 20 $sql.=" WHERE paid_type = 2"; 21 } 22 /* 16 23 if ($data['keyword']) { 17 24 if ($data['search_field'] == "cellphone") { … … 19 26 } 20 27 }else{ 21 if(strlen($data['daterange_start'])>0){ 22 28 */ 29 if(strlen($data['daterange_start'])>0){ 30 if ($data['paid_type'] ==0){ 23 31 $sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 24 write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE); 32 //write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE); 33 }else{ 34 $sql.=" AND paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 25 35 } 26 36 } 37 //} 27 38 28 39 $order = ""; … … 36 47 } 37 48 $sql=$sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 38 // echo $sql;39 49 return $this->db->query($sql)->result_array(); 40 50 } … … 44 54 function countPaidlog($data) { 45 55 $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name." INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id"; 46 if ($data['keyword']) {56 /*if ($data['keyword']) { 47 57 if ($data['search_field'] == "cellphone") { 48 58 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')"; 49 59 } 50 60 }else{ 51 if(strlen($data['daterange_start'])>0){ 52 61 */ 62 if ($data['paid_type'] == 1){ 63 $sql.=" WHERE paid_type = 1"; 64 } 65 if ($data['paid_type'] == 2){ 66 $sql.=" WHERE paid_type = 2"; 67 } 68 if(strlen($data['daterange_start'])>0){ 69 if ($data['paid_type'] ==0){ 53 70 $sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 54 //write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE); 71 }else{ 72 $sql.=" AND paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 55 73 } 56 74 } 75 //} 57 76 58 77 -
pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
r706 r767 25 25 $sql="SELECT * FROM ".$this->table_name; 26 26 if ($data['status'] == 1){ 27 $sql.=" WHERE expire_date > NOW() ";27 $sql.=" WHERE expire_date > NOW() AND p_id <> 5"; 28 28 } 29 29 if ($data['status'] == 2){ 30 $sql.=" WHERE expire_date < NOW()"; 30 $sql.=" WHERE expire_date > NOW() AND p_id = 5"; 31 } 32 if ($data['status'] == 3){ 33 $sql.=" WHERE expire_date < NOW() AND p_id = 5"; 34 } 35 if ($data['status'] == 4){ 36 $sql.=" WHERE expire_date < NOW() AND p_id <> 5"; 31 37 } 32 38 if (isset($data['keyword'])) … … 76 82 77 83 if ($data['status'] == 1){ 78 $sql.=" WHERE expire_date > NOW() ";84 $sql.=" WHERE expire_date > NOW() AND p_id <> 5"; 79 85 } 80 86 if ($data['status'] == 2){ 81 $sql.=" WHERE expire_date < NOW()"; 87 $sql.=" WHERE expire_date > NOW() AND p_id = 5"; 88 } 89 if ($data['status'] == 3){ 90 $sql.=" WHERE expire_date < NOW() AND p_id = 5"; 91 } 92 if ($data['status'] == 4){ 93 $sql.=" WHERE expire_date < NOW() AND p_id <> 5"; 82 94 } 83 95 -
pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php
r690 r767 1 1 <div class="col-xs-12"> 2 <!-- PAGE CONTENT BEGINS --> 3 <div style="padding-bottom:4px" class="table-header"> 4 Doanh thu 5 </div> 2 6 3 4 <div class="col-xs-12"> 5 <!-- PAGE CONTENT BEGINS --> 6 <div style="padding-bottom:4px" class="table-header"> 7 Doanh thu 8 </div> 7 <div class="table-responsive"> 8 <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper"> 9 <form autocomplete="off" onsubmit="return false;" id="collaborator" > 10 <div class="row"> 11 <div class="col-sm-6"> 12 <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị 13 <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2"> 14 <?php foreach ($itemsoptions as $option) { ?> 15 <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option> 16 <?php } ?> 17 </select> bản ghi</label> 9 18 10 <div class="table-responsive"> 11 <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper"> 12 <form autocomplete="off" onsubmit="return false;" id="collaborator" > 13 <div class="row"> 14 <div class="col-sm-6"> 15 <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị 16 <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2"> 17 <?php foreach ($itemsoptions as $option) { ?> 18 <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option> 19 <?php } ?> 20 </select> bản ghi</label> 19 </div> 20 </div> 21 21 22 </div> 23 </div> 24 25 <div class="col-sm-6"> 26 <div class="dataTables_filter" id="sample-table-2_filter"> 27 <label>Tìm kiếm: 28 <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label> 29 </div> 30 <div id="daterangepicker" class="selectbox pull-right"> 31 <i class="icon-calendar"></i> 32 <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;"> 33 34 </span> 35 </div> 36 </div> 37 </div> 38 </div> 39 <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" /> 40 <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/> 41 </form> 42 <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info"> 43 <thead> 44 <tr role="row"> 45 46 <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> 47 <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> 48 <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> 49 <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th> 50 <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngày đăng ký: activate to sort column ascending">Ngày</th> 51 52 </thead> 22 <div class="col-sm-6"> 23 <!--<div class="dataTables_filter" id="sample-table-2_filter"> 24 <label>Tìm kiếm: 25 <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label> 26 </div>--> 27 <div class="dataTables_filter" id="sample-table-2_filter"><label>Lọc theo: 28 <select onchange="filter();" name="paid_type" size="1" style="width: 176px; height: 28px;"> 29 <?php foreach ($paid_types as $key => $type): ?> 30 <option <?php if ($key == $paid_type) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $type; ?></option> 31 <?php endforeach; ?> 32 </select> 33 </div> 34 <div id="daterangepicker" class="selectbox pull-right"> 35 <i class="icon-calendar"></i> 36 <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;"> 37 38 </span> 39 </div> 40 </div> 41 </div> 42 </div> 43 <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" /> 44 <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/> 45 </form> 46 <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info"> 47 <thead> 48 <tr role="row"> 49 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> 51 <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> 52 <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> 53 <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th> 54 <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngày đăng ký: activate to sort column ascending">Ngày</th> 55 56 </thead> 53 57 54 58 55 56 57 58 59 60 61 59 <tbody role="alert" aria-live="polite" aria-relevant="all"> 60 61 <?php 62 foreach ($paidlogs as $paidlog) { 63 ?> 64 <tr class="odd"> 65 62 66 63 64 65 66 67 68 69 70 67 <td class=" "> 68 <a href="#"><?php echo $paidlog['username'];?></a> 69 </td> 70 <td class=" "><?php echo $paidlog['cellphone']?></td> 71 72 <td class="hidden-480 "><?php echo number_format($paidlog['amount'],0);?></td> 73 <td class="hidden-480 "><?php if ($paidlog['paid_type']==1) {echo "SMS";} else { echo "Card";}?></td> 74 <td class=" "><?php echo $paidlog['paid_time']?></td> 71 75 72 76 73 77 74 75 76 78 79 </tr> 80 <?php } ?> 77 81 78 82 … … 82 86 83 87 84 85 86 87 88 89 90 91 92 93 94 95 88 </tbody></table><div class="row"><div class="col-sm-6"> 89 <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> 90 91 </div> 92 <div class="col-sm-6"> 93 <div class="dataTables_paginate paging_bootstrap"> 94 <ul class="pagination"> 95 <?php echo $paging; ?> 96 </ul> 97 </div> 98 </div> 99 </div> 96 100 97 98 101 </div> 102 </div> 99 103 100 101 104 105 </div> 102 106 103 107 104 108 <script type="text/javascript"> 105 106 107 108 109 window.onload = function () 110 { 111 init_page(); 112 } 109 113 110 114 -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
r765 r767 106 106 echo "sorting"; 107 107 } 108 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tà i khoản: activate to sort column ascending"> Username</th>108 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tà i khoản: activate to sort column ascending">Sá» Äiá»n thoại</th> 109 109 <th class="<?php 110 110 if ($sorting_field == 'cellphone') { … … 113 113 echo "sorting"; 114 114 } 115 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Sá» Äiá»n thoại</th> 115 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Há» tên</th> 116 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Tình trạng</th> 116 117 <th class="<?php 117 118 if ($sorting_field == 'acc_balanced') { … … 121 122 } 122 123 ?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tiá»n: activate to sort column ascending">Tà i khoản (VNÄ)</th> 123 <th style="width: 140px;">Tá»nh/TP</th> 124 <th class="<?php 124 <th class="<?php 125 125 if ($sorting_field == 'created_time') { 126 126 echo $sorting_order; … … 142 142 Ngà y hết hạn 143 143 </th> 144 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Tình trạng</th> 144 <th style="width: 140px;">Tá»nh/TP</th> 145 145 146 </tr> 146 147 </thead> … … 148 149 <tbody role="alert" aria-live="polite" aria-relevant="all"> 149 150 150 <?php151 foreach ($users as $user) { 152 ?>151 <?php 152 foreach ($users as $user): 153 ?> 153 154 <tr class="odd"> 154 155 <td class="center sorting_1"> … … 163 164 </td> 164 165 <td class=" "> 165 <?php echo $user['cellphone']; ?> 166 <?php echo $user['fullname']; ?> 167 </td> 168 <td class=" "> 169 <?php if (strtotime($user['expire_date']) > time() && $user['p_id'] != 5 ): ?> 170 <span class="label label-sm label-success">Äã ÄÄng kÜ</span> 171 <?php elseif(strtotime($user['expire_date']) > time() && $user['p_id'] == 5): ?> 172 <span class="label label-sm label-info">Dùng thá»</span> 173 <?php elseif(strtotime($user['expire_date']) < time() && $user['p_id'] == 5): ?> 174 <span class="label label-sm label-warning">Dùng thá» hạn chế</span> 175 <?php else: ?> 176 <span class="label label-sm label-danger">Hết hạn</span> 177 <?php endif; ?> 166 178 </td> 167 179 <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td> 180 <td class=" "><?php echo $user['created_time']; ?></td> 181 <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td> 168 182 <td><?php echo $user['province']; ?></td> 169 <td class=" "><?php echo $user['created_time']; ?></td>170 <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td>171 172 <td class=" ">173 <?php if (strtotime($user['expire_date']) > time()) { ?>174 <span class="label label-sm label-success">Äã ÄÄng kÜ</span>175 <?php } else { ?>176 <span class="label label-sm label-warning">Dùng thá»</span>177 <?php } ?>178 </td>179 183 180 184 </tr> 181 <?php }?>185 <?php endforeach; ?> 182 186 183 187 </tbody></table>
Note: See TracChangeset
for help on using the changeset viewer.