Changeset 408 for pro-violet-viettel/sourcecode/application/modules/admin
- Timestamp:
- Nov 4, 2014 6:48:37 PM (11 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
r396 r408 3 3 class User extends MX_Controller 4 4 { 5 6 const TOKENPW = 'violet'; 7 5 8 public function __construct() 6 9 { … … 29 32 $data['itemsoptions'] = array(10, 25, 50, 100); 30 33 $data['perpage'] = 10; 34 $data['statusoptions'] = array(0=>"Tất cả", 1=>"KÃch hoạt", 2=>"Tạm ngưng"); 35 $data['status'] = 0; 36 if ($this->input->post('status')) 37 { 38 $data['status'] = (int)$this->input->post('status') ; 39 } 31 40 $data['keyword'] = ""; 32 41 $data['sorting_order']="sorting_desc"; … … 48 57 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 49 58 $data['total'] = $this->user_model->get_total_users($data); 50 $data['users'] = $this->user_model->get_list_users($data); 59 $us = $this->user_model->get_list_users($data); 60 $users = array(); 61 foreach($us as $u): 62 $id = $u['us_id']; 63 $username = $this->get_username($id); 64 $u['username'] = $username; 65 array_push($users, $u); 66 endforeach; 67 68 $data['users'] = $users; 51 69 $data['paging_url'] = base_url() . "admin/nguoi_dung/trang/"; 52 70 $data['num_links'] = 2; … … 132 150 } 133 151 152 private function get_username($us_id) 153 { 154 $src = 'violet'; 155 $token = md5($us_id.self::TOKENPW); 156 $this->load->model('user_model'); 157 $data = $this->user_model->get_user_info($src, $us_id, $token); 158 if (strlen($data) > 0){ 159 $arr_users = explode("&", $data); 160 $str_username = $arr_users[1]; 161 $arr_username = explode("=", $str_username); 162 return $arr_username[1]; 163 }else 164 { 165 return ""; 166 } 167 168 } 169 134 170 } -
pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
r397 r408 10 10 { 11 11 parent::__construct(); 12 $this->vservices->setApiUrl($this->config->item('api_url')); 13 $this->vservices->setConnection($this->curl); 12 14 } 13 15 … … 26 28 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') "; 27 29 } 30 if ($data['status'] == 1){ 31 $sql.=" WHERE expire_date > NOW()"; 32 } 33 if ($data['status'] == 2){ 34 $sql.=" WHERE expire_date < NOW()"; 35 } 28 36 $order = ""; 29 37 if ($data['sorting_order'] != "sorting") { 30 $sort = "DESC"; 31 if ($data['sorting_order'] == "sorting_asc") 32 $sort = "ASC"; 33 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 38 if($data['sorting_field'] != "status"){ 39 $sort = "DESC"; 40 if ($data['sorting_order'] == "sorting_asc") 41 $sort = "ASC"; 42 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 43 } 34 44 } 35 45 return $this->db->query($sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array(); … … 39 49 { 40 50 $sql="SELECT COUNT(".$this->id_name.") AS total FROM ".$this->table_name; 51 52 if ($data['status'] == 1){ 53 $sql.=" WHERE expire_date > NOW()"; 54 } 55 if ($data['status'] == 2){ 56 $sql.=" WHERE expire_date < NOW()"; 57 } 58 41 59 if (isset($data['keyword'])) 42 60 { 43 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') "; 61 if (strlen($data['keyword'])>0) 62 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') "; 44 63 } 45 64 return $this->db->query($sql)->row_array()['total']; 46 65 } 66 67 function get_user_info($src, $us_id, $token) 68 { 69 $data = $this->vservices->actionExecute('getinfo', array('src' => $src, 'us_id' => $us_id, 'token'=>$token), 'user'); 70 return $data; 71 } 47 72 } -
pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/listview.php
r390 r408 90 90 Ngà y ÄÄng kÜ 91 91 </th> 92 <th class="hidden-480 sorting" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Trạng thái: activate to sort column ascending">Trạng thái</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr> 92 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Trạng thái: activate to sort column ascending">Trạng thái</th> 93 <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr> 93 94 </thead> 94 95 -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php
r396 r408 51 51 } 52 52 } 53 console.log($( this ).attr('class'));54 53 $("#sorting_field").val($(this).attr("id")); 55 54 $("#sorting_order").val($(this).attr("class")); … … 104 103 105 104 <div class="modal-body"> 106 <form id="add_ user" onsubmit="return false;" class="form-horizontal" role="form">105 <form id="add_frm" onsubmit="return false;" class="form-horizontal" role="form"> 107 106 <div class="form-group"> 108 107 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Sá» Äiá»n thoại </label> -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
r396 r408 41 41 <div style="padding-bottom:4px" class="table-header"> 42 42 Danh sách 43 44 43 <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right"> 45 44 <i class="icon-plus"></i> … … 55 54 <div class="col-sm-6"> 56 55 <div id="sample-table-2_length" class="dataTables_length"><label>Hiá»n thá» 57 <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2"> 56 <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2"> 58 57 <?php foreach ($itemsoptions as $option) { ?> 59 58 <option <?php if($option == $perpage) echo "selected"; ?> value="<?=$option?>"><?=$option?></option> … … 63 62 </div> 64 63 </div> 65 64 66 65 <div class="col-sm-6"> 67 66 <div class="dataTables_filter" id="sample-table-2_filter"> … … 70 69 </div> 71 70 </div> 71 <div class="col-sm-6"> 72 <div class="dataTables_status" id="sample-table-2_status"><label>Lá»c 73 <select onchange="filter();" name="status" size="1" aria-controls="sample-table-2" class=""> 74 <?php foreach ($statusoptions as $key=>$option):?> 75 <option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option> 76 <?php endforeach; ?> 77 </select> 78 </div> 79 </div> 72 80 </div> 81 73 82 <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" /> 74 83 <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/> … … 83 92 </label> 84 93 </th> 94 <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: 176px;" aria-label="Tà i khoản: activate to sort column ascending">Tà i khoản</th> 85 95 <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: 176px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Sá» Äiá»n thoại</th> 86 96 <th class="<?php if ($sorting_field == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th> … … 93 103 Ngà y hết hạn 94 104 </th> 95 <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr> 105 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;">Tình trạng</th> 106 </tr> 96 107 </thead> 97 108 … … 108 119 </label> 109 120 </td> 110 121 <td class=" "> 122 <a href="#"><?php echo $user['username']; ?></a> 123 </td> 111 124 <td class=" "> 112 < a href="#"><?php echo $user['cellphone']; ?></a>125 <?php echo $user['cellphone']; ?> 113 126 </td> 114 <td class="hidden-480 "><?php echo $user['acc_balanced'] ; ?></td>127 <td class="hidden-480 "><?php echo $user['acc_balanced']. " VNÄ"; ?></td> 115 128 <td class=" "><?php echo $user['created_time']; ?></td> 116 129 <td class=" "><?php echo $user['expire_date']; ?></td> 130 <td class=" "> 131 <?php if(strtotime($user['expire_date'])>time()){ ?> 132 <span class="label label-sm label-success">Äã kÃch hoạt</span> 133 <?php }else{ ?> 134 <span class="label label-sm label-warning">Tạm ngưng</span> 135 <?php } ?> 136 </td> 117 137 118 <td class=" ">119 <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">120 <a href="#" class="blue">121 <i class="icon-zoom-in bigger-130"></i>122 </a>123 124 <a href="#editUser" data-toggle="modal" data-us-id=<?php echo $user['us_id']; ?> class="green">125 <i class="icon-pencil bigger-130"></i>126 </a>127 128 <a href="#deleteUser" data-toggle="modal" data-us-id=<?php echo $user['us_id']; ?> class="red">129 <i class="icon-trash bigger-130"></i>130 </a>131 </div>132 133 <div class="visible-xs visible-sm hidden-md hidden-lg">134 <div class="inline position-relative">135 <button data-toggle="dropdown" class="btn btn-minier btn-yellow dropdown-toggle">136 <i class="icon-caret-down icon-only bigger-120"></i>137 </button>138 139 <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">140 <li>141 <a title="" data-rel="tooltip" class="tooltip-info" href="#" data-original-title="View">142 <span class="blue">143 <i class="icon-zoom-in bigger-120"></i>144 </span>145 </a>146 </li>147 148 <li>149 <a title="" data-rel="tooltip" class="tooltip-success" href="#" data-original-title="Edit">150 <span class="green">151 <i class="icon-edit bigger-120"></i>152 </span>153 </a>154 </li>155 156 <li>157 <a title="" data-rel="tooltip" class="tooltip-error" href="#" data-original-title="Delete">158 <span class="red">159 <i class="icon-trash bigger-120"></i>160 </span>161 </a>162 </li>163 </ul>164 </div>165 </div>166 </td>167 138 </tr> 168 139 <?php } ?> 169 170 171 172 173 174 175 140 176 141 </tbody></table><div class="row"><div class="col-sm-6">
Note: See TracChangeset
for help on using the changeset viewer.