[344] | 1 | <?php
|
---|
| 2 | $base_url = base_url();
|
---|
| 3 | $this->load->view('layout/admin/header', array('base_url' => $base_url));
|
---|
| 4 | $this->load->view('layout/admin/sidebar', array('base_url' => $base_url));
|
---|
| 5 | ?>
|
---|
| 6 | <div class="main-content">
|
---|
| 7 | <div class="breadcrumbs" id="breadcrumbs">
|
---|
| 8 | <script type="text/javascript">
|
---|
| 9 | try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
|
---|
| 10 | </script>
|
---|
| 11 |
|
---|
| 12 | <ul class="breadcrumb">
|
---|
| 13 | <li>
|
---|
| 14 | <i class="icon-home home-icon"></i>
|
---|
| 15 | <a href="#">Trang chá»§</a>
|
---|
| 16 | </li>
|
---|
| 17 |
|
---|
| 18 | <li>
|
---|
| 19 | <a href="#">Quản lÜ tà i khoản</a>
|
---|
| 20 | </li>
|
---|
| 21 | <li class="active">Quản trỠviên</li>
|
---|
| 22 | </ul><!-- .breadcrumb -->
|
---|
| 23 |
|
---|
| 24 | <div class="nav-search" id="nav-search">
|
---|
| 25 | <form class="form-search">
|
---|
| 26 | <span class="input-icon">
|
---|
| 27 | <input type="text" placeholder="Tìm kiếm ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
|
---|
| 28 | <i class="icon-search nav-search-icon"></i>
|
---|
| 29 | </span>
|
---|
| 30 | </form>
|
---|
| 31 | </div><!-- #nav-search -->
|
---|
| 32 | </div>
|
---|
| 33 |
|
---|
| 34 | <div class="page-content">
|
---|
| 35 | <div class="page-header">
|
---|
| 36 | <h1>
|
---|
| 37 | Quản trỠviên
|
---|
| 38 | <small>
|
---|
| 39 | <i class="icon-double-angle-right"></i>
|
---|
| 40 | Danh sách
|
---|
| 41 | </small>
|
---|
| 42 | </h1>
|
---|
| 43 | </div><!-- /.page-header -->
|
---|
| 44 |
|
---|
| 45 | <script src="<?php echo $base_url;?>assets/js/jquery-2.0.3.min.js"></script>
|
---|
| 46 | <script src="<?php echo $base_url;?>assets/js/jquery.dataTables.min.js"></script>
|
---|
| 47 | <script src="<?php echo $base_url;?>assets/js/jquery.dataTables.bootstrap.js"></script>
|
---|
| 48 | <script type="text/javascript">
|
---|
[351] | 49 |
|
---|
[344] | 50 | jQuery(function($) {
|
---|
| 51 | var oTable1 = $('#sample-table-2').dataTable( {
|
---|
| 52 | "aoColumns": [
|
---|
| 53 | { "bSortable": false },
|
---|
| 54 | null, null,null, null, null,
|
---|
| 55 | { "bSortable": false }
|
---|
| 56 | ] } );
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | $('table th input:checkbox').on('click' , function(){
|
---|
| 60 | var that = this;
|
---|
| 61 | $(this).closest('table').find('tr > td:first-child input:checkbox')
|
---|
| 62 | .each(function(){
|
---|
| 63 | this.checked = that.checked;
|
---|
| 64 | $(this).closest('tr').toggleClass('selected');
|
---|
| 65 | });
|
---|
| 66 |
|
---|
| 67 | });
|
---|
| 68 |
|
---|
| 69 | });
|
---|
| 70 | </script>
|
---|
[370] | 71 | <?php
|
---|
| 72 | if($this->session->flashdata('insert_error'))
|
---|
| 73 | {
|
---|
| 74 | echo "Tên ÄÄng nháºp Äã ÄÆ°á»£c sá» dụng !";
|
---|
| 75 | }
|
---|
| 76 | ?>
|
---|
[344] | 77 | <div class="row">
|
---|
| 78 | <div class="col-xs-12">
|
---|
| 79 | <!-- PAGE CONTENT BEGINS -->
|
---|
| 80 | <div class="table-header" style="padding-bottom:4px">
|
---|
| 81 | Thá»ng kê tà i khoản
|
---|
| 82 |
|
---|
[370] | 83 | <button class="btn btn-success pull-right" data-toggle="modal" href="#addAdmin">
|
---|
[344] | 84 | <i class="icon-plus"></i>
|
---|
| 85 | Thêm quản trỠviên
|
---|
| 86 | </button>
|
---|
| 87 |
|
---|
| 88 | </div>
|
---|
| 89 |
|
---|
| 90 | <div class="table-responsive">
|
---|
| 91 | <table id="sample-table-2" class="table table-striped table-bordered table-hover">
|
---|
| 92 | <thead>
|
---|
| 93 | <tr>
|
---|
| 94 | <th class="center">
|
---|
| 95 | <label>
|
---|
| 96 | <input type="checkbox" class="ace" />
|
---|
| 97 | <span class="lbl"></span>
|
---|
| 98 | </label>
|
---|
| 99 | </th>
|
---|
| 100 | <th>Sá» Äiá»n thoại</th>
|
---|
| 101 | <th>HỠtên</th>
|
---|
| 102 | <th class="hidden-480">Tên ÄÄng nháºp</th>
|
---|
| 103 | <th>
|
---|
| 104 |
|
---|
| 105 | <i class="icon-time bigger-110 hidden-480"></i>
|
---|
| 106 | Ngà y ÄÄng kÜ
|
---|
| 107 | </th>
|
---|
| 108 | <th class="hidden-480">Trạng thái</th>
|
---|
| 109 |
|
---|
| 110 | <th></th>
|
---|
| 111 | </tr>
|
---|
| 112 | </thead>
|
---|
| 113 |
|
---|
| 114 | <tbody>
|
---|
| 115 | <?php foreach ($data as $key=>$value):?>
|
---|
| 116 | <tr>
|
---|
| 117 | <td class="center">
|
---|
| 118 | <label>
|
---|
| 119 | <input type="checkbox" class="ace" />
|
---|
| 120 | <span class="lbl"></span>
|
---|
| 121 | </label>
|
---|
| 122 | </td>
|
---|
| 123 |
|
---|
| 124 | <td>
|
---|
| 125 | <a href="#"><?php echo $value->phone; ?></a>
|
---|
| 126 | </td>
|
---|
| 127 | <td><?php echo $value->full_name; ?></td>
|
---|
| 128 | <td class="hidden-480"><?php echo $value->login_name; ?></td>
|
---|
| 129 | <td><?php echo $value->created_time; ?></td>
|
---|
| 130 |
|
---|
| 131 | <td class="hidden-480">
|
---|
| 132 | <span class="label label-sm label-success">KÃch hoạt</span>
|
---|
| 133 | </td>
|
---|
| 134 |
|
---|
| 135 | <td>
|
---|
| 136 | <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
|
---|
| 137 | <a class="blue" href="#">
|
---|
| 138 | <i class="icon-zoom-in bigger-130"></i>
|
---|
| 139 | </a>
|
---|
[351] | 140 | <a class="green" data-admin-index="<?php echo $key; ?>" data-toggle="modal" href="#editAdmin">
|
---|
[344] | 141 | <i class="icon-pencil bigger-130"></i>
|
---|
| 142 | </a>
|
---|
[351] | 143 | <!-- Delete -->
|
---|
| 144 | <a class="red" data-admin-id="<?php echo $value->admin_id; ?>" data-toggle="modal" href="#deleteAdmin">
|
---|
[344] | 145 | <i class="icon-trash bigger-130"></i>
|
---|
| 146 | </a>
|
---|
| 147 | </div>
|
---|
| 148 |
|
---|
| 149 | <div class="visible-xs visible-sm hidden-md hidden-lg">
|
---|
| 150 | <div class="inline position-relative">
|
---|
| 151 | <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
|
---|
| 152 | <i class="icon-caret-down icon-only bigger-120"></i>
|
---|
| 153 | </button>
|
---|
| 154 |
|
---|
| 155 | <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
|
---|
| 156 | <li>
|
---|
| 157 | <a href="#" class="tooltip-info" data-rel="tooltip" title="View">
|
---|
| 158 | <span class="blue">
|
---|
| 159 | <i class="icon-zoom-in bigger-120"></i>
|
---|
| 160 | </span>
|
---|
| 161 | </a>
|
---|
| 162 | </li>
|
---|
| 163 |
|
---|
| 164 | <li>
|
---|
[351] | 165 | <a class="green" data-admin-index="<?php echo $key; ?>" data-toggle="modal" href="#editAdmin">
|
---|
[344] | 166 | <!--a href="#" class="tooltip-success" data-rel="tooltip" title="Edit"-->
|
---|
| 167 | <span class="green">
|
---|
| 168 | <i class="icon-edit bigger-120"></i>
|
---|
| 169 | </span>
|
---|
[351] | 170 | </a>
|
---|
[344] | 171 | </button>
|
---|
| 172 | </li>
|
---|
| 173 |
|
---|
| 174 | <li>
|
---|
[351] | 175 | <a class="red" data-admin-id=<?php echo $value->admin_id; ?> data-toggle="modal" href="#deleteAdmin">
|
---|
[344] | 176 | <span class="red">
|
---|
| 177 | <i class="icon-trash bigger-120"></i>
|
---|
| 178 | </span>
|
---|
| 179 | </a>
|
---|
| 180 | </li>
|
---|
| 181 | </ul>
|
---|
| 182 | </div>
|
---|
| 183 | </div>
|
---|
| 184 | </td>
|
---|
| 185 | </tr>
|
---|
| 186 |
|
---|
| 187 | <?php endforeach; ?>
|
---|
| 188 | </tbody>
|
---|
| 189 | </table>
|
---|
| 190 | </div>
|
---|
[351] | 191 |
|
---|
[370] | 192 | <!-- Edit Admin -->
|
---|
[344] | 193 | <div tabindex="-1" class="modal fade in" id="editAdmin">
|
---|
| 194 | <div class="modal-dialog">
|
---|
| 195 | <div class="modal-content">
|
---|
| 196 | <div class="modal-header no-padding">
|
---|
| 197 | <div class="table-header">
|
---|
| 198 | <button aria-hidden="true" data-dismiss="modal" class="close" type="button">
|
---|
| 199 | <span class="white">Ã</span>
|
---|
| 200 | </button>
|
---|
| 201 | Sá»a quản trá» viên
|
---|
| 202 | </div>
|
---|
| 203 | </div>
|
---|
[351] | 204 |
|
---|
[344] | 205 | <div class="modal-body">
|
---|
[370] | 206 | <form method="post" class="form-horizontal" id="validation-edit-form" action="<?php echo $base_url; ?>admin/admin_account/update">
|
---|
[351] | 207 | <input type="hidden" name="id" id="form-field-0" value="">
|
---|
[344] | 208 | <div class="form-group">
|
---|
| 209 | <label for="form-field-1" class="col-sm-3 control-label no-padding-right"> Tà i khoản </label>
|
---|
| 210 | <div class="col-sm-9">
|
---|
[353] | 211 | <label class="block clearfix has-error">
|
---|
| 212 | <span class="input-icon">
|
---|
| 213 | <input type="text" name="username" placeholder="Tà i khoản" id="form-field-1" value="">
|
---|
| 214 | <i class="icon-user blue"></i>
|
---|
| 215 | </span>
|
---|
| 216 | <div class="help-block"> </div>
|
---|
| 217 | </label>
|
---|
[344] | 218 | </div>
|
---|
| 219 | </div>
|
---|
| 220 |
|
---|
[351] | 221 | <div class="form-group">
|
---|
| 222 | <label for="form-field-2" class="col-sm-3 control-label no-padding-right"> HỠtên </label>
|
---|
| 223 | <div class="col-sm-9">
|
---|
| 224 | <span class="input-icon">
|
---|
| 225 | <input type="text" name="fullname" placeholder="HỠtên" id="form-field-2" value="">
|
---|
| 226 | <i class="icon-user blue"></i>
|
---|
| 227 | </span>
|
---|
| 228 | </div>
|
---|
| 229 | <label class="block clearfix has-error">
|
---|
| 230 | <div class="help-block"> </div>
|
---|
| 231 | </label>
|
---|
| 232 |
|
---|
| 233 | </div>
|
---|
| 234 | <div class="form-group">
|
---|
| 235 | <label for="form-field-3" class="col-sm-3 control-label no-padding-right"> Email </label>
|
---|
| 236 | <div class="col-sm-9">
|
---|
| 237 | <span class="input-icon">
|
---|
| 238 | <input type="text" name="email" placeholder="Email" id="form-field-3" value="">
|
---|
| 239 | <i class="icon-envelope blue"></i>
|
---|
| 240 | </span>
|
---|
| 241 | </div>
|
---|
| 242 | <label class="block clearfix has-error">
|
---|
| 243 | <div class="help-block"> </div>
|
---|
| 244 | </label>
|
---|
| 245 |
|
---|
| 246 | </div>
|
---|
| 247 | <div class="form-group">
|
---|
| 248 | <label for="form-field-4" class="col-sm-3 control-label no-padding-right"> Phone </label>
|
---|
| 249 | <div class="col-sm-9">
|
---|
| 250 | <span class="input-icon">
|
---|
| 251 | <input type="text" name="phone" placeholder="Phone" id="form-field-4" value="">
|
---|
| 252 | <i class="icon-phone blue"></i>
|
---|
| 253 | </span>
|
---|
| 254 | </div>
|
---|
| 255 | <label class="block clearfix has-error">
|
---|
| 256 | <div class="help-block"> </div>
|
---|
| 257 | </label>
|
---|
| 258 |
|
---|
| 259 | </div>
|
---|
| 260 |
|
---|
[344] | 261 | <div class="space-4"></div>
|
---|
| 262 | <div class="clearfix form-actions">
|
---|
| 263 | <div class="col-md-offset-3 col-md-9">
|
---|
[351] | 264 | <button type="submit" name="submit" class="btn btn-info">
|
---|
[344] | 265 | <i class="icon-ok bigger-110"></i>
|
---|
| 266 | Hoà n tất
|
---|
| 267 | </button>
|
---|
| 268 |
|
---|
| 269 |
|
---|
| 270 | <button type="reset" name="reset" class="btn">
|
---|
| 271 | <i class="icon-undo bigger-110"></i>
|
---|
| 272 | Xóa hết
|
---|
| 273 | </button>
|
---|
| 274 | </div>
|
---|
| 275 | </div>
|
---|
| 276 | </form>
|
---|
| 277 | </div>
|
---|
| 278 | </div>
|
---|
| 279 | </div>
|
---|
| 280 | </div>
|
---|
[370] | 281 | <!-- End Edit Admin -->
|
---|
[351] | 282 |
|
---|
[370] | 283 | <!-- Delete Admin -->
|
---|
[351] | 284 | <div tabindex="-1" class="modal fade in" id="deleteAdmin">
|
---|
| 285 | <div class="modal-dialog">
|
---|
| 286 | <div class="modal-content">
|
---|
| 287 | <div class="modal-header no-padding">
|
---|
| 288 | <div class="table-header">
|
---|
| 289 | <button aria-hidden="true" data-dismiss="modal" class="close" type="button">
|
---|
| 290 | <span class="white">Ã</span>
|
---|
| 291 | </button>
|
---|
| 292 | Xóa quản trỠviên
|
---|
| 293 | </div>
|
---|
| 294 | </div>
|
---|
| 295 |
|
---|
| 296 | <div class="modal-body">
|
---|
[370] | 297 | <form method="post" class="form-horizontal" id="validation-form" action="<?php echo $base_url; ?>admin/admin_account/delete">
|
---|
[351] | 298 | <input type="hidden" name="id" id="form-field-0" value="">
|
---|
| 299 | <div class="form-group">
|
---|
| 300 | <center><h4> Chắc chắn muá»n xóa tà i khoản nà y? </h4></center>
|
---|
| 301 | </div>
|
---|
| 302 | <div class="clearfix form-actions">
|
---|
| 303 | <div class="col-md-offset-3 col-md-9">
|
---|
| 304 | <button type="submit" name="submit" class="btn btn-info">
|
---|
| 305 | <i class="icon-ok bigger-110"></i>
|
---|
| 306 | Xóa
|
---|
| 307 | </button>
|
---|
| 308 |
|
---|
| 309 |
|
---|
| 310 | <button type="reset" name="reset" class="btn" data-dismiss="modal">
|
---|
| 311 | <i class="icon-undo bigger-110"></i>
|
---|
| 312 | Há»§y
|
---|
| 313 | </button>
|
---|
| 314 | </div>
|
---|
| 315 | </div>
|
---|
| 316 | </form>
|
---|
| 317 | </div>
|
---|
| 318 | </div>
|
---|
| 319 | </div>
|
---|
| 320 | </div>
|
---|
| 321 | <!-- End Delete User -->
|
---|
| 322 |
|
---|
[344] | 323 | <script>
|
---|
[351] | 324 | $('#deleteAdmin').on('show.bs.modal', function(e) {
|
---|
| 325 | var id = parseInt($(e.relatedTarget).data('admin-id'));
|
---|
| 326 | $(e.currentTarget).find('input[name="id"]').val(id);
|
---|
| 327 | });
|
---|
| 328 |
|
---|
[344] | 329 | $('#editAdmin').on('show.bs.modal', function(e) {
|
---|
| 330 | //get data-id attribute of the clicked element
|
---|
[351] | 331 | var index = parseInt($(e.relatedTarget).data('admin-index'));
|
---|
[344] | 332 | //populate the textbox
|
---|
[351] | 333 | var ar = <?php echo json_encode($data) ?>;
|
---|
| 334 |
|
---|
| 335 | $(e.currentTarget).find('input[name="username"]').val(ar[index].login_name);
|
---|
| 336 | $(e.currentTarget).find('input[name="fullname"]').val(ar[index].full_name);
|
---|
| 337 | $(e.currentTarget).find('input[name="email"]').val(ar[index].email);
|
---|
| 338 | $(e.currentTarget).find('input[name="phone"]').val(ar[index].phone);
|
---|
| 339 | $(e.currentTarget).find('input[name="id"]').val(ar[index].admin_id);
|
---|
| 340 | });
|
---|
| 341 | </script>
|
---|
| 342 |
|
---|
| 343 | <!-- Add User -->
|
---|
[370] | 344 | <div tabindex="-1" class="modal fade in" id="addAdmin">
|
---|
[344] | 345 | <div class="modal-dialog">
|
---|
| 346 | <div class="modal-content">
|
---|
| 347 | <div class="modal-header no-padding">
|
---|
| 348 | <div class="table-header">
|
---|
| 349 | <button aria-hidden="true" data-dismiss="modal" class="close" type="button">
|
---|
| 350 | <span class="white">Ã</span>
|
---|
| 351 | </button>
|
---|
| 352 | Tạo quản trỠviên
|
---|
| 353 | </div>
|
---|
| 354 | </div>
|
---|
| 355 |
|
---|
| 356 | <div class="modal-body">
|
---|
[370] | 357 | <form method="post" class="form-horizontal" id="validation-add-form" action="<?php echo $base_url; ?>admin/admin_account/insert" >
|
---|
[344] | 358 | <div class="form-group">
|
---|
| 359 | <label for="form-field-1" class="col-sm-3 control-label no-padding-right"> Tà i khoản </label>
|
---|
[370] | 360 |
|
---|
[344] | 361 | <div class="col-sm-9">
|
---|
[370] | 362 |
|
---|
[353] | 363 | <label class="block clearfix has-error">
|
---|
| 364 | <span class="input-icon">
|
---|
| 365 | <input type="text" name="username" placeholder="Tà i khoản" id="form-field-1">
|
---|
| 366 | <i class="icon-user blue"></i>
|
---|
| 367 | </span>
|
---|
[370] | 368 | <span style="" class="help-block" id="exist"><span>
|
---|
| 369 | <div class="help-block" id="usr" > </div>
|
---|
[353] | 370 | </label>
|
---|
[370] | 371 |
|
---|
[344] | 372 | </div>
|
---|
| 373 | </div>
|
---|
| 374 |
|
---|
| 375 | <div class="form-group">
|
---|
| 376 | <label for="form-field-2" class="col-sm-3 control-label no-padding-right"> Máºt khẩu </label>
|
---|
| 377 | <div class="col-sm-9">
|
---|
[353] | 378 | <label class="block clearfix has-error">
|
---|
| 379 | <span class="input-icon">
|
---|
| 380 | <input type="password" name="password" placeholder="Máºt khẩu" id="form-field-2">
|
---|
| 381 | <i class="icon-lock blue"></i>
|
---|
| 382 | </span>
|
---|
[370] | 383 |
|
---|
| 384 | <div class="help-block" id="pwd"> </div>
|
---|
[353] | 385 | </label>
|
---|
| 386 | </div>
|
---|
[344] | 387 | </div>
|
---|
[353] | 388 | <div class="space-4"></div>
|
---|
[344] | 389 | <div class="form-group">
|
---|
[351] | 390 | <label for="form-field-3" class="col-sm-3 control-label no-padding-right"> HỠtên </label>
|
---|
[344] | 391 | <div class="col-sm-9">
|
---|
| 392 | <span class="input-icon">
|
---|
[351] | 393 | <input type="text" name="fullname" placeholder="HỠtên" id="form-field-3">
|
---|
[344] | 394 | <i class="icon-user blue"></i>
|
---|
| 395 | </span>
|
---|
| 396 | </div>
|
---|
| 397 | <div class="help-block"> </div>
|
---|
| 398 | </div>
|
---|
| 399 |
|
---|
| 400 | <div class="space-4"></div>
|
---|
| 401 |
|
---|
| 402 | <div class="form-group">
|
---|
[351] | 403 | <label for="form-field-3" class="col-sm-3 control-label no-padding-right"> Email </label>
|
---|
[344] | 404 | <div class="col-sm-9">
|
---|
| 405 | <span class="input-icon">
|
---|
[351] | 406 | <input type="text" name="email" placeholder="Email" id="form-field-3">
|
---|
[344] | 407 | <i class="icon-envelope blue"></i>
|
---|
| 408 | </span>
|
---|
| 409 | </div>
|
---|
| 410 | <div class="help-block"> </div>
|
---|
| 411 | </div>
|
---|
| 412 |
|
---|
| 413 | <div class="space-4"></div>
|
---|
| 414 |
|
---|
| 415 | <div class="form-group">
|
---|
[351] | 416 | <label for="form-field-4" class="col-sm-3 control-label no-padding-right"> Phone </label>
|
---|
[344] | 417 |
|
---|
| 418 | <div class="col-sm-9">
|
---|
| 419 | <span class="input-icon">
|
---|
[351] | 420 | <input type="text" name="phone" placeholder="Phone" id="form-field-4">
|
---|
[344] | 421 | <i class="icon-phone blue"></i>
|
---|
| 422 | </span>
|
---|
| 423 | </div>
|
---|
| 424 | <div class="help-block"> </div>
|
---|
| 425 | </div>
|
---|
| 426 |
|
---|
| 427 | <div class="space-4"></div>
|
---|
| 428 |
|
---|
| 429 | <div class="clearfix form-actions">
|
---|
| 430 | <div class="col-md-offset-3 col-md-9">
|
---|
[370] | 431 | <button id="insert-admin" type="submit" name="submit" class="btn btn-info">
|
---|
[344] | 432 | <i class="icon-ok bigger-110"></i>
|
---|
| 433 | Hoà n tất
|
---|
| 434 | </button>
|
---|
| 435 |
|
---|
| 436 |
|
---|
| 437 | <button type="reset" name="reset" class="btn">
|
---|
| 438 | <i class="icon-undo bigger-110"></i>
|
---|
| 439 | Xóa hết
|
---|
| 440 | </button>
|
---|
| 441 | </div>
|
---|
| 442 | </div>
|
---|
| 443 |
|
---|
| 444 | </div>
|
---|
| 445 | </form>
|
---|
| 446 | </div>
|
---|
| 447 | </div><!-- /.modal-content -->
|
---|
| 448 | </div><!-- /.modal-dialog -->
|
---|
| 449 | </div>
|
---|
[351] | 450 | <!-- End Add User -->
|
---|
[370] | 451 | <script>
|
---|
| 452 | $('#addAdmin').on('show.bs.modal', function(e) {
|
---|
| 453 | var isExist = false;
|
---|
| 454 | $(e.currentTarget).find('input[name="username"]').bind('input', function(){
|
---|
| 455 | var username = $(this).val();
|
---|
| 456 | $.ajax({
|
---|
| 457 | url: "<?php echo $base_url; ?>admin/admin_account/check_data",
|
---|
| 458 | type: "POST",
|
---|
| 459 | data: 'username=' + username,
|
---|
| 460 | success: function(result){
|
---|
| 461 | if(result==="1"){
|
---|
| 462 | $('#exist').html("Tà i khoản Äã tá»n tại !");
|
---|
| 463 | isExist = true;
|
---|
| 464 | $(e.currentTarget).find('input[name="username"]').focus();
|
---|
| 465 |
|
---|
| 466 | $('#insert-admin').click(function(){
|
---|
| 467 | $(e.currentTarget).find('input[name="username"]').focus();
|
---|
| 468 | });
|
---|
| 469 | }
|
---|
| 470 | else{
|
---|
| 471 | $('#exist').html("");
|
---|
| 472 | }
|
---|
| 473 | }
|
---|
| 474 | });
|
---|
| 475 | });
|
---|
| 476 |
|
---|
| 477 | $('#insert-admin').click(function(){
|
---|
| 478 | //$('#validation-add-form').valid();
|
---|
| 479 | var username = $('#username').val();
|
---|
| 480 | var password = $(e.currentTarget).find('input[name="password"]').val();
|
---|
| 481 | var fullname = $(e.currentTarget).find('input[name="fullname"]').val();
|
---|
| 482 | var email = $(e.currentTarget).find('input[name="email"]').val();
|
---|
| 483 | var phone = $(e.currentTarget).find('input[name="phone"]').val();
|
---|
| 484 | data = 'username=' + username + '&password=' + password + '&fullname=' + fullname + '&email=' + email + '&phone=' + phone;
|
---|
| 485 | if (isExist){
|
---|
| 486 | alert(isExist);
|
---|
| 487 | }
|
---|
| 488 |
|
---|
| 489 | if(username === "")
|
---|
| 490 | {
|
---|
| 491 | //alert("NULL");
|
---|
| 492 | }else
|
---|
| 493 | {
|
---|
| 494 | //alert(username);
|
---|
| 495 | }
|
---|
| 496 | /*
|
---|
| 497 | $.ajax({
|
---|
| 498 | url: "<?php echo $base_url; ?>admin/admin_account/insert",
|
---|
| 499 | type: "POST",
|
---|
| 500 | data: data,
|
---|
| 501 | success: function(result){
|
---|
| 502 |
|
---|
| 503 | }
|
---|
| 504 |
|
---|
| 505 | });
|
---|
| 506 | */
|
---|
| 507 | });
|
---|
| 508 | });
|
---|
| 509 | /*
|
---|
| 510 | $(document).ready(function() {
|
---|
| 511 | $('#insert-admin').click(function(){
|
---|
| 512 | $('#validation-add-form').valid();
|
---|
| 513 | var username = $(this).val();
|
---|
| 514 | alert($username);
|
---|
| 515 | //location.href = "<?php echo $base_url; ?>admin/admin_account/insert";
|
---|
| 516 | });
|
---|
| 517 | });*/
|
---|
| 518 | </script>
|
---|
[344] | 519 | <!-- PAGE CONTENT ENDS -->
|
---|
| 520 | </div><!-- /.col -->
|
---|
| 521 | </div><!-- /.row -->
|
---|
| 522 | </div><!-- /.page-content -->
|
---|
| 523 | </div><!-- /.main-content -->
|
---|
| 524 |
|
---|
| 525 | </div><!-- /.main-container-inner -->
|
---|
| 526 |
|
---|
| 527 | <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
|
---|
| 528 | <i class="icon-double-angle-up icon-only bigger-110"></i>
|
---|
| 529 | </a>
|
---|
| 530 | </div><!-- /.main-container -->
|
---|
| 531 | <?php
|
---|
| 532 | $this->load->view('layout/admin/footer', array('base_url' => $base_url));
|
---|
| 533 | ?> |
---|