index.blade.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses'); ?>
  2. @extends('dev.core.using')
  3. @section('content')
  4. <style>
  5. .parent-list {
  6. list-style: none;
  7. }
  8. .arr-btn{
  9. font-size: 20px;
  10. margin-right: .5em;
  11. cursor: pointer;
  12. width: 1.3rem;
  13. height: 1.3rem;
  14. border-radius: .5rem;
  15. text-align: center;
  16. }
  17. .arr-btn:hover{
  18. background: #cdcdcd
  19. }
  20. .ic-container{
  21. /* margin-top: .3em; */
  22. gap:.5em;
  23. }
  24. .ic-container > .ic {
  25. width: 1.5rem;
  26. height: 1.3rem;
  27. border-radius: .5rem;
  28. text-align: center;
  29. cursor:pointer;
  30. background: #cdcdcd;
  31. /* padding-top: .3rem; */
  32. font-size: .8em;
  33. list-style: none;
  34. color: #000;
  35. }
  36. .ic-container > .ic:hover {
  37. background: #eee;
  38. }
  39. @media only screen and (max-width: 700px) {
  40. .option-item{
  41. white-space: nowrap;
  42. overflow: hidden;
  43. text-overflow: ellipsis;
  44. max-width: 200px;
  45. padding-left:0px !important;
  46. }
  47. }
  48. </style>
  49. <br/>
  50. <br/>
  51. <div class="card card-stats">
  52. <div class="card-body">
  53. <div class="row">
  54. <div class="col-md-12">
  55. <a type="button" href="{{route('definisi-satuan.add')}}" class="btn btn-primary" style="background: #193865;color: #fff"><i class="fa fa-plus"></i> Tambah Baru</a>
  56. </div>
  57. </div><br>
  58. <ul class="parent-list" id="par-list">
  59. @foreach($data as $row)
  60. <li class="row" style="padding-top:7px">
  61. <div class="col-xs-4 col-sm-4 col-md-7 option-item"><b>{{$row->label}}</b></div>
  62. <div class="ic-container" style="display:flex">
  63. <a href="{{route('definisi-satuan.edit',$row->id)}}" class="ic"><i class="fas fa-edit" ></i></a>
  64. <a href="{{route('definisi-satuan.detail',$row->id)}}" class="ic"><i class="fas fa-eye" ></i></a>
  65. <a href="#" data-toggle="modal" id="btn-delete-{{$row->id}}" data-nama="{{$row->label}}" data-target="#modal-delete" onClick="deleteData({{$row->id}})" class="ic"><i class="fas fa-trash" ></i></a>
  66. </div>
  67. </li>
  68. @endforeach
  69. </ul>
  70. </div>
  71. </div>
  72. <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" id="modal-delete">
  73. <form action="" method="POST" id="form-delete">
  74. @csrf
  75. <div class="modal-dialog" role="document">
  76. <div class="modal-content">
  77. <div class="modal-header">
  78. <h5 class="modal-title" id="exampleModalLabel">Konfirmasi</h5>
  79. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  80. <span aria-hidden="true">&times;</span>
  81. </button>
  82. </div>
  83. <div class="modal-body">
  84. <input type="hidden" id="delete-id">
  85. <center>Anda yakin akan menghapus Program <span id="delete-nama" style="font-weight:bold"></span> ?</center>
  86. </div>
  87. <div class="modal-footer">
  88. <div class="form-group center">
  89. <button type="button" class="btn btn-secondary" data-dismiss="modal">Batalkan</button>
  90. <button type="submit" class="btn btn-danger">Hapus Data</button>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </form>
  96. </div>
  97. <script>
  98. function deleteData(id){
  99. var nama = $('#btn-delete-'+id).attr('data-nama');
  100. $('#form-delete').attr("action","{{url('pengaturan/definisi-satuan/delete')}}/"+id);
  101. $('#delete-id').val(id);
  102. $('#delete-nama').text();
  103. $('#delete-nama').text(nama);
  104. }
  105. </script>
  106. @endsection