[375] | 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 | <script type="text/javascript">
|
---|
| 7 | function init_page()
|
---|
| 8 | {
|
---|
| 9 | $(".ajax_paging").click(function () {
|
---|
| 10 | $.ajax({
|
---|
| 11 | url: $(this).attr("href"),
|
---|
| 12 | type: "POST",
|
---|
| 13 | data: $("#admin").serialize(),
|
---|
| 14 | success: function (data, textStatus, jqXHR)
|
---|
| 15 | {
|
---|
| 16 | $("#content").html(data);
|
---|
| 17 | init_page();
|
---|
| 18 | },
|
---|
| 19 | error: function (jqXHR, textStatus, errorThrown)
|
---|
| 20 | {
|
---|
| 21 | $(".ajaxloading").hide();
|
---|
| 22 | }
|
---|
| 23 | });
|
---|
| 24 | return false;
|
---|
| 25 | });
|
---|
[390] | 26 |
|
---|
[380] | 27 | $('#keyword').bind('input', function(){
|
---|
| 28 | filter();
|
---|
| 29 | });
|
---|
| 30 |
|
---|
| 31 | $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
|
---|
| 32 | var current_class=$( this ).attr('class');
|
---|
| 33 | $(".sorting_desc").attr("class","sorting");
|
---|
| 34 | $(".sorting_asc").attr("class","sorting");
|
---|
| 35 |
|
---|
| 36 | if(current_class=='sorting')
|
---|
| 37 | {
|
---|
| 38 | $(this).attr("class","sorting_desc");
|
---|
| 39 | }
|
---|
| 40 | else
|
---|
| 41 | {
|
---|
| 42 | if(current_class=='sorting_desc')
|
---|
| 43 | {
|
---|
| 44 | $(this).attr("class","sorting_asc");
|
---|
| 45 | }
|
---|
| 46 | else
|
---|
| 47 | {
|
---|
| 48 | if(current_class=='sorting_asc')
|
---|
| 49 | {
|
---|
| 50 | $(this).attr("class","sorting");
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
[390] | 54 | console.log($( this ).attr('class'));
|
---|
[380] | 55 | $("#sorting_field").val($(this).attr("id"));
|
---|
| 56 | $("#sorting_order").val($(this).attr("class"));
|
---|
| 57 | filter();
|
---|
| 58 | });
|
---|
[423] | 59 |
|
---|
| 60 | $('[data-toggle="ajaxModal"]').on('click',
|
---|
| 61 | function(e) {
|
---|
| 62 | $('#ajaxModal').remove();
|
---|
| 63 | e.preventDefault();
|
---|
| 64 | var $this = $(this)
|
---|
| 65 | , $remote = $this.data('remote') || $this.attr('href')
|
---|
| 66 | , $modal = $('<div class="modal" id="ajaxModal"><div class="modal-body"></div></div>');
|
---|
| 67 | $('body').append($modal);
|
---|
| 68 | $modal.modal({backdrop: 'static', keyboard: false});
|
---|
| 69 | $modal.load($remote);
|
---|
| 70 | }
|
---|
| 71 | );
|
---|
[375] | 72 | }
|
---|
| 73 |
|
---|
| 74 | function filter()
|
---|
| 75 | {
|
---|
| 76 | $.ajax({
|
---|
[461] | 77 | url: '<?php echo base_url();?>admin/quan_tri_vien/trang/1',
|
---|
[375] | 78 | type: "POST",
|
---|
| 79 | data: $("#admin").serialize(),
|
---|
| 80 | success: function (data, textStatus, jqXHR)
|
---|
| 81 | {
|
---|
| 82 | $("#content").html(data);
|
---|
| 83 | init_page();
|
---|
[380] | 84 | $("#keyword").focus();
|
---|
| 85 | $("#keyword").setCursorToTextEnd();
|
---|
[375] | 86 |
|
---|
| 87 | },
|
---|
| 88 | error: function (jqXHR, textStatus, errorThrown)
|
---|
| 89 | {
|
---|
| 90 | $(".ajaxloading").hide();
|
---|
| 91 | }
|
---|
| 92 | });
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | </script>
|
---|
| 96 |
|
---|
| 97 | <div class="main-content" id="content">
|
---|
| 98 | <?php echo $content; ?>
|
---|
| 99 | </div><!-- /.main-content -->
|
---|
| 100 | </div><!-- /.main-container-inner -->
|
---|
| 101 | <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
|
---|
| 102 | <i class="icon-double-angle-up icon-only bigger-110"></i>
|
---|
| 103 | </a>
|
---|
| 104 | </div><!-- /.main-container -->
|
---|
| 105 |
|
---|
| 106 | <!-- Add Admin -->
|
---|
| 107 | <div tabindex="-1" class="modal fade in" id="addAdmin">
|
---|
| 108 | <div class="modal-dialog">
|
---|
| 109 | <div class="modal-content">
|
---|
| 110 | <div class="modal-header no-padding">
|
---|
| 111 | <div class="table-header">
|
---|
| 112 | <button aria-hidden="true" data-dismiss="modal" class="close" type="button">
|
---|
| 113 | <span class="white">Ã</span>
|
---|
| 114 | </button>
|
---|
| 115 | Tạo quản trỠviên
|
---|
| 116 | </div>
|
---|
| 117 | </div>
|
---|
| 118 |
|
---|
| 119 | <div class="modal-body">
|
---|
| 120 | <form id="add_frm" onsubmit="return false;" class="form-horizontal" role="form">
|
---|
| 121 | <div class="form-group">
|
---|
[377] | 122 | <label for="form-field-1" class="col-sm-3 control-label no-padding-right"> HỠtên </label>
|
---|
[375] | 123 | <div class="col-sm-9">
|
---|
| 124 | <label class="block clearfix has-error">
|
---|
| 125 | <span class="input-icon">
|
---|
[377] | 126 | <input type="text" name="full_name" placeholder="HỠtên" id="form-field-1">
|
---|
[375] | 127 | <i class="icon-user blue"></i>
|
---|
| 128 | </span>
|
---|
[590] | 129 | <small><div class="help-block" id="full_name_err" > </div><small>
|
---|
[375] | 130 | </label>
|
---|
| 131 | </div>
|
---|
| 132 | <div class="help-block"> </div>
|
---|
| 133 | </div>
|
---|
| 134 |
|
---|
| 135 | <div class="form-group">
|
---|
[377] | 136 | <label for="form-field-2" class="col-sm-3 control-label no-padding-right"> Tà i khoản </label>
|
---|
[375] | 137 |
|
---|
| 138 | <div class="col-sm-9">
|
---|
| 139 |
|
---|
| 140 | <label class="block clearfix has-error">
|
---|
| 141 | <span class="input-icon">
|
---|
[377] | 142 | <input type="text" name="login_name" placeholder="Tà i khoản" id="form-field-2">
|
---|
[375] | 143 | <i class="icon-user blue"></i>
|
---|
| 144 | </span>
|
---|
[590] | 145 | <small><div class="help-block" id="login_name_err" > </div></small>
|
---|
[375] | 146 | </label>
|
---|
| 147 |
|
---|
| 148 | </div>
|
---|
| 149 | </div>
|
---|
| 150 |
|
---|
| 151 | <div class="form-group">
|
---|
[377] | 152 | <label for="form-field-3" class="col-sm-3 control-label no-padding-right"> Máºt khẩu </label>
|
---|
[375] | 153 | <div class="col-sm-9">
|
---|
| 154 | <label class="block clearfix has-error">
|
---|
| 155 | <span class="input-icon">
|
---|
[377] | 156 | <input type="password" name="passwd" placeholder="Máºt khẩu" id="form-field-3">
|
---|
[375] | 157 | <i class="icon-lock blue"></i>
|
---|
| 158 | </span>
|
---|
| 159 |
|
---|
[590] | 160 | <small><div class="help-block" id="pwd1_err"> </div></small>
|
---|
[375] | 161 | </label>
|
---|
| 162 | </div>
|
---|
| 163 | </div>
|
---|
| 164 | <div class="space-4"></div>
|
---|
| 165 |
|
---|
| 166 | <div class="form-group">
|
---|
[377] | 167 | <label for="form-field-4" class="col-sm-3 control-label no-padding-right">Xác nháºn máºt khẩu </label>
|
---|
[375] | 168 | <div class="col-sm-9">
|
---|
| 169 | <label class="block clearfix has-error">
|
---|
| 170 | <span class="input-icon">
|
---|
[377] | 171 | <input type="password" name="pwd2" placeholder="Nháºp lại máºt khẩu" id="form-field-4">
|
---|
[375] | 172 | <i class="icon-lock blue"></i>
|
---|
| 173 | </span>
|
---|
| 174 |
|
---|
[590] | 175 | <small><div class="help-block" id="pwd2_err"> </div></small>
|
---|
[375] | 176 | </label>
|
---|
| 177 | </div>
|
---|
| 178 | </div>
|
---|
| 179 | <div class="space-4"></div>
|
---|
| 180 |
|
---|
| 181 | <div class="form-group">
|
---|
[377] | 182 | <label for="form-field-5" class="col-sm-3 control-label no-padding-right"> Email </label>
|
---|
[375] | 183 | <div class="col-sm-9">
|
---|
| 184 | <label class="block clearfix has-error">
|
---|
| 185 | <span class="input-icon">
|
---|
[377] | 186 | <input type="text" name="email" placeholder="Email" id="form-field-5">
|
---|
[375] | 187 | <i class="icon-envelope blue"></i>
|
---|
| 188 | </span>
|
---|
[590] | 189 | <small><div class="help-block" id="email_err"> </div></small>
|
---|
[375] | 190 | </label>
|
---|
| 191 | </div>
|
---|
| 192 | <div class="help-block"> </div>
|
---|
| 193 | </div>
|
---|
| 194 |
|
---|
| 195 | <div class="space-4"></div>
|
---|
| 196 |
|
---|
| 197 | <div class="form-group">
|
---|
[377] | 198 | <label for="form-field-6" class="col-sm-3 control-label no-padding-right"> Phone </label>
|
---|
[375] | 199 |
|
---|
| 200 | <div class="col-sm-9">
|
---|
| 201 | <label class="block clearfix has-error">
|
---|
| 202 | <span class="input-icon">
|
---|
[377] | 203 | <input type="text" name="phone" placeholder="Phone" id="form-field-6">
|
---|
[375] | 204 | <i class="icon-phone blue"></i>
|
---|
| 205 | </span>
|
---|
[590] | 206 | <small><div class="help-block" id="phone_err"> </div></small>
|
---|
[375] | 207 | </label>
|
---|
| 208 | </div>
|
---|
| 209 | <div class="help-block"> </div>
|
---|
| 210 | </div>
|
---|
| 211 | <div class="space-4"></div>
|
---|
| 212 |
|
---|
[590] | 213 | <div class="form-group">
|
---|
| 214 | <label for="form-field-7" class="col-sm-3 control-label no-padding-right"> Phân quyá»n </label>
|
---|
| 215 |
|
---|
| 216 | <div class="col-sm-9">
|
---|
| 217 | <label class="block clearfix has-error">
|
---|
| 218 | <span class="input-icon">
|
---|
| 219 | <select name="role_id" id="form-field-7">
|
---|
| 220 | <?php foreach ($roles as $role):?>
|
---|
| 221 | <option value=<?php echo $role['role_id']; ?>><?php echo $role['role_name']; ?></option>
|
---|
| 222 | <?php endforeach; ?>
|
---|
| 223 | </select>
|
---|
| 224 | </span>
|
---|
| 225 | <small><div class="help-block" id="role_err"> </div></small>
|
---|
| 226 | </label>
|
---|
| 227 | </div>
|
---|
| 228 | <div class="help-block"> </div>
|
---|
| 229 | </div>
|
---|
| 230 | <div class="space-4"></div>
|
---|
| 231 |
|
---|
[375] | 232 | <div class="clearfix form-actions">
|
---|
| 233 | <div class="col-md-offset-3 col-md-9">
|
---|
| 234 | <button class="btn btn-info" id="add" type="button">
|
---|
| 235 | <i class="icon-ok bigger-110"></i>
|
---|
| 236 | Hoà n tất
|
---|
| 237 | </button>
|
---|
| 238 |
|
---|
| 239 |
|
---|
| 240 | <button type="reset" name="reset" class="btn">
|
---|
| 241 | <i class="icon-undo bigger-110"></i>
|
---|
| 242 | Xóa hết
|
---|
| 243 | </button>
|
---|
| 244 | </div>
|
---|
| 245 | </div>
|
---|
| 246 |
|
---|
| 247 | </div>
|
---|
| 248 | </form>
|
---|
| 249 | </div>
|
---|
| 250 | </div>
|
---|
| 251 | </div><!-- /.modal-content -->
|
---|
| 252 | </div><!-- /.modal-dialog -->
|
---|
| 253 | <!-- Delete Admin -->
|
---|
| 254 | <div tabindex="-1" class="modal fade in" id="deleteAdmin">
|
---|
| 255 | <div class="modal-dialog">
|
---|
| 256 | <div class="modal-content">
|
---|
| 257 | <div class="modal-header no-padding">
|
---|
| 258 | <div class="table-header">
|
---|
| 259 | <button aria-hidden="true" data-dismiss="modal" class="close" type="button">
|
---|
| 260 | <span class="white">Ã</span>
|
---|
| 261 | </button>
|
---|
| 262 | Xóa quản trỠviên
|
---|
| 263 | </div>
|
---|
| 264 | </div>
|
---|
| 265 |
|
---|
| 266 | <div class="modal-body">
|
---|
| 267 | <form id="delete_frm" onsubmit="return false;" class="form-horizontal" role="form">
|
---|
| 268 | <div class="form-group">
|
---|
[415] | 269 | <center>
|
---|
| 270 | <label>Tà i khoản: <span class="blue" id="us"></span></label>
|
---|
| 271 | <h4> Chắc chắn muá»n xóa tà i khoản nà y? </h4>
|
---|
| 272 | </center>
|
---|
[375] | 273 | </div>
|
---|
| 274 | <div class="clearfix form-actions">
|
---|
| 275 | <div class="col-md-offset-3 col-md-9">
|
---|
| 276 | <button type="button" id="delete" class="btn btn-info">
|
---|
| 277 | <i class="icon-ok bigger-110"></i>
|
---|
| 278 | Xóa
|
---|
| 279 | </button>
|
---|
| 280 |
|
---|
| 281 |
|
---|
| 282 | <button type="reset" name="reset" class="btn" data-dismiss="modal">
|
---|
| 283 | <i class="icon-undo bigger-110"></i>
|
---|
| 284 | Há»§y
|
---|
| 285 | </button>
|
---|
| 286 | </div>
|
---|
| 287 | </div>
|
---|
| 288 | </form>
|
---|
| 289 | </div>
|
---|
| 290 | </div>
|
---|
| 291 | </div>
|
---|
| 292 | </div>
|
---|
| 293 | <!-- End Delete User -->
|
---|
| 294 | <?php
|
---|
| 295 | $this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/admin.js')));
|
---|
| 296 | ?> |
---|