|
263 | 263 | </div>
|
264 | 264 | </div>
|
265 | 265 | </div>
|
| 266 | +<div class="modal fade text-center" id="backdrop" tabindex="-1" role="dialog" aria-labelledby="myModalLabel20" aria-hidden="true"> |
| 267 | + <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xs" role="document"> |
| 268 | + <div class="modal-content"> |
| 269 | + <div class="modal-header"> |
| 270 | + <h4 class="modal-title" id="code_title"></h4> |
| 271 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 272 | + <span aria-hidden="true">×</span> |
| 273 | + </button> |
| 274 | + </div> |
| 275 | + <div class="modal-body"> |
| 276 | + <p id="code_url"> |
| 277 | + |
| 278 | + </p> |
| 279 | + <img id="code_preview" src="" width="200"> |
| 280 | + </div> |
| 281 | + <div class="modal-footer"> |
| 282 | + <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> |
| 283 | + </div> |
| 284 | + </div> |
| 285 | + </div> |
| 286 | +</div> |
266 | 287 | <!-- END: Content-->
|
267 | 288 | <div class="sidenav-overlay"></div>
|
268 | 289 | <div class="drag-target"></div>
|
|
451 | 472 | })
|
452 | 473 | function lockUser(state, user_id) {
|
453 | 474 | if (state) {
|
| 475 | + $.ajax({ |
| 476 | + url: "{{ url('/setlockuser') }}", |
| 477 | + data: {state : 1, user_id: user_id}, |
| 478 | + dataType: "text", |
| 479 | + success : function (data) { |
| 480 | + toastr.success('That user was locked successfully.', 'Notification', { |
| 481 | + "showMethod": "fadeIn", |
| 482 | + "hideMethod": "fadeOut", |
| 483 | + "closeButton": true, |
| 484 | + "progressBar": true, |
| 485 | + timeOut: 2000 |
| 486 | + }); |
| 487 | + }, |
| 488 | + failure: function () { |
454 | 489 |
|
455 |
| - toastr.success('That user was locked successfully.', 'Notification', { |
456 |
| - "showMethod": "fadeIn", |
457 |
| - "hideMethod": "fadeOut", |
458 |
| - "closeButton": true, |
459 |
| - "progressBar": true, |
460 |
| - timeOut: 2000 |
| 490 | + } |
461 | 491 | });
|
462 | 492 | }else{
|
463 |
| - toastr.success('That user was unlocked successfully.', 'Notification', { |
464 |
| - "showMethod": "fadeIn", |
465 |
| - "hideMethod": "fadeOut", |
466 |
| - "closeButton": true, |
467 |
| - "progressBar": true, |
468 |
| - timeOut: 2000 |
| 493 | + $.ajax({ |
| 494 | + url: "{{ url('/setlockuser') }}", |
| 495 | + data: {state : 0, user_id: user_id}, |
| 496 | + dataType: "text", |
| 497 | + success : function (data) { |
| 498 | + toastr.success('That user was unlocked successfully.', 'Notification', { |
| 499 | + "showMethod": "fadeIn", |
| 500 | + "hideMethod": "fadeOut", |
| 501 | + "closeButton": true, |
| 502 | + "progressBar": true, |
| 503 | + timeOut: 2000 |
| 504 | + }); |
| 505 | + }, |
| 506 | + failure: function () { |
| 507 | +
|
| 508 | + } |
469 | 509 | });
|
470 | 510 | }
|
471 | 511 | }
|
472 | 512 | function deleteUser(user_id) {
|
473 | 513 | if(!confirm("Are you really?")) return;
|
474 |
| - toastr.info('That user was deleted successfully.', 'Notification', { |
475 |
| - "showMethod": "fadeIn", |
476 |
| - "hideMethod": "fadeOut", |
477 |
| - "closeButton": true, |
478 |
| - "progressBar": true, |
479 |
| - timeOut: 2000 |
| 514 | + $.ajax({ |
| 515 | + url: "{{ url('/deleteuser') }}", |
| 516 | + data: {user_id: user_id}, |
| 517 | + dataType: "text", |
| 518 | + success : function (data) { |
| 519 | + toastr.info('That user was deleted successfully.', 'Notification', { |
| 520 | + "showMethod": "fadeIn", |
| 521 | + "hideMethod": "fadeOut", |
| 522 | + "closeButton": true, |
| 523 | + "progressBar": true, |
| 524 | + timeOut: 2000 |
| 525 | + }); |
| 526 | + user_table.row($("#btn_" + user_id).parents("tr")).remove().draw(); |
| 527 | + }, |
| 528 | + failure: function () { |
| 529 | +
|
| 530 | + } |
480 | 531 | });
|
481 |
| - user_table.row($("#btn_" + user_id).parents("tr")).remove().draw(); |
482 | 532 | }
|
483 | 533 | function deleteCode(id) {
|
484 | 534 | if(!confirm("Are you really?")) return;
|
485 |
| - toastr.info('That QR Code was deleted successfully.', 'Notification', { |
486 |
| - "showMethod": "fadeIn", |
487 |
| - "hideMethod": "fadeOut", |
488 |
| - "closeButton": true, |
489 |
| - "progressBar": true, |
490 |
| - timeOut: 2000 |
| 535 | + $.ajax({ |
| 536 | + url: "{{ url('/deletecode') }}", |
| 537 | + data: {qrcode_id: id}, |
| 538 | + dataType: "text", |
| 539 | + success : function (data) { |
| 540 | + toastr.info('That QR Code was deleted successfully.', 'Notification', { |
| 541 | + "showMethod": "fadeIn", |
| 542 | + "hideMethod": "fadeOut", |
| 543 | + "closeButton": true, |
| 544 | + "progressBar": true, |
| 545 | + timeOut: 2000 |
| 546 | + }); |
| 547 | + qrcode_table.row($("#code_delete_" + id).parents("tr")).remove().draw(); |
| 548 | + }, |
| 549 | + failure: function () { |
| 550 | +
|
| 551 | + } |
491 | 552 | });
|
492 |
| - qrcode_table.row($("#code_delete_" + id).parents("tr")).remove().draw(); |
493 | 553 | }
|
494 | 554 | function reviewCode(id) {
|
| 555 | + $.ajax({ |
| 556 | + url: "{{ url('/reviewcode') }}", |
| 557 | + data: {qrcode_id: id}, |
| 558 | + dataType: "json", |
| 559 | + success : function (data) { |
| 560 | + $("#code_url").text(data.url); |
| 561 | + $("#code_title").text(data.qrcode); |
| 562 | + $("#code_preview").attr("src", "/qrcode/" + data.id); |
| 563 | + $("#backdrop").modal(); |
| 564 | + }, |
| 565 | + failure: function () { |
495 | 566 |
|
| 567 | + } |
| 568 | + }); |
496 | 569 | }
|
497 | 570 | function initBarChart() {
|
498 | 571 | let campaigns = @php echo $campaigns; @endphp;
|
|
0 commit comments