loadCountry.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <style type="text/css">
  2. .page-item.active .page-link {
  3. border-color: #2e58a6 !important;
  4. background-color: #2e58a6 !important;
  5. color: #fff !important;
  6. }
  7. .universityTable th{
  8. padding: 6px !important;
  9. }
  10. .page-item.active .page-link {
  11. border-color: #2e1153 !important;
  12. background-color: #2e1153 !important;
  13. }
  14. #custom_switch .stoggler .slabel-on, .stoggler .slabel-off {
  15. visibility: hidden;
  16. }
  17. #custom_switch .swraper.light .stoggler.on {
  18. background: #17092a;
  19. transform: translateX(-9px) !important;
  20. }
  21. #custom_switch .swraper.light .stoggler .sblob{
  22. width: 10px !important;
  23. height: 10px !important;
  24. }
  25. #custom_switch .swraper{
  26. width: 30px !important;
  27. line-height: 17px !important;
  28. }
  29. #custom_switch .swraper.light .stoggler.off {
  30. transform: translateX(-21px) !important;
  31. }
  32. </style>
  33. @if(count($countries) > 0)
  34. <table class="table table-sm table-bordered universityTable list_table" style="width: 100%; font-size: 12px;">
  35. <thead>
  36. <tr>
  37. <th class="text-center">SL</th>
  38. <th>Country</th>
  39. <th class="text-center"><i class="fa fa-cog"></i></th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. @foreach($countries as $key => $row)
  44. <tr>
  45. <td class="text-center">{{ ++$key }}</td>
  46. <td>
  47. <img class="img-responsive listFlag" src="{{ asset('/assets/img/flags/4x3').'/'.strtolower($row->iso_3166_2).'.svg' }}" alt="Flag" data-toggle="tooltip" title="" data-placement="top">
  48. {{ $row->name }}
  49. </td>
  50. <td class="text-center" id="custom_switch">
  51. <div class="pretty p-switch p-fill" style="padding: 5px 0px;">
  52. <input type="checkbox" class="checkbox" name="countries{{ $row->id }}" @if(in_array($row->id, $selected)) {{ 'checked' }} @endif data-id="{{ $row->id }}"/>
  53. <div class="state p-success">
  54. <label for="">&nbsp;</label>
  55. </div>
  56. </div>
  57. {{-- <div class="form-check form-switch" id="">
  58. <input class="form-check-input" type="checkbox" name="countries{{ $row->id }}" @if(in_array($row->id, $selected)) {{ 'checked' }} @endif data-id="{{ $row->id }}" style="height:18px; width: 30px; position: absolute;">
  59. <label class="form-check-label" for=""></label>
  60. </div> --}}
  61. {{-- <input type="checkbox" class="checkbox" name="countries{{ $row->id }}" @if(in_array($row->id, $selected)) {{ 'checked' }} @endif data-id="{{ $row->id }}"/> --}}
  62. </td>
  63. </tr>
  64. @endforeach
  65. </tbody>
  66. </table>
  67. <div class="row">
  68. <div class="col-md-12 text-center">
  69. {{ $countries->appends(request()->query())->links()}}
  70. </div>
  71. </div>
  72. @else
  73. <div class="col-md-12">
  74. <p class="text-danger text-center mb-3" style="font-size: 12px;">No information available</p>
  75. </div>
  76. @endif
  77. <script type="text/javascript">
  78. $(document).ready(function(){
  79. // $("input[type='checkbox']").rcSwitcher();
  80. });
  81. $('.page-link').on('click',function() {
  82. $('.load_list_add').load($(this).attr('href'));
  83. });
  84. $('.checkbox').on('change', function(){
  85. var id = $(this).data('id');
  86. var checked=$(this).prop("checked");
  87. var form_data={
  88. _token: "{{ csrf_token() }}",
  89. id: id,
  90. checked: checked,
  91. }
  92. $.post("{{ route('ajax-post', ['name'=>'set_country']) }}", form_data, function(res){
  93. pop_up_msg(res.msg);
  94. }).fail(function(err){
  95. pop_up_msg(err_msg(err), 'error');
  96. });
  97. });
  98. // $(".checkbox").rcSwitcher().on({'toggle.rcSwitcher': function( e, dataObj, changeType ){
  99. // if(changeType == 'turnon'){
  100. // var type = 'add';
  101. // var msg_success = 'Added Successfully.';
  102. // }else{
  103. // var type = 'remove';
  104. // var msg_success = 'Removed Successfully.';
  105. // }
  106. // var urll="{{ url('/admin/dashboard/set_country') }}/"+type+'/'+id;
  107. // var msg_error = 'Something went wrong!';
  108. // $.ajax({
  109. // url:urll,
  110. // success: function(data){
  111. // notify('success',msg_success);
  112. // },
  113. // error: function (data) {
  114. // notify('error',msg_error);
  115. // }
  116. // });
  117. // },
  118. //});
  119. </script>