No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

update.blade.php 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @extends('admin.layouts.app')
  2. @section('content')
  3. <div class="row px-5">
  4. <div class="col-xl-12">
  5. <div class="card shadow">
  6. <div class="card-header bg-transparent">
  7. <div class="row align-items-center">
  8. <div class="col">
  9. <h6 class="text-uppercase text-muted ls-1 mb-1">User Management | Petugas UDD</h6>
  10. <h2 class="mb-0">Edit Petugas UDD</h2>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="card-body">
  15. <form action="{{ route($route.'update_action') }}" class="form-global-handle" method="POST" enctype="multipart/form-data">
  16. @csrf
  17. <input type="hidden" name="petugas_id" value="{{ Hashids::encode($data->id) }}">
  18. <div class="form-group">
  19. <label for="RoleName">Nama <span class="text-danger">*</span></label>
  20. <input type="text" name="nama" value="{{ $data->nama }}" required class="form-control" id="RoleName" placeholder="Example : Admin">
  21. </div>
  22. <div class="form-group">
  23. <label for="RoleName">Email <span class="text-danger">*</span></label>
  24. <input type="text" name="email" value="{{ $data->user->email }}" required class="form-control" id="RoleName" placeholder="Example : Admin">
  25. </div>
  26. <div class="form-group">
  27. <label for="password">Password <span class="text-danger">*</span></label>
  28. <input type="password" name="password" class="form-control" id="password" placeholder="Example : *******">
  29. <div>
  30. <small>Minimal adalah 6 karakter</small>
  31. </div>
  32. </div>
  33. <div class="row">
  34. <div class="col-lg-6">
  35. @if (!empty($udds))
  36. <div class="form-group">
  37. <label> List UDD <span class="text-danger">*</span> </label>
  38. @foreach ($udds as $key => $value)
  39. <div class="card mr-2 my-2 p-3">
  40. @foreach ($value as $key_value => $value_udd)
  41. <div class="custom-control custom-control-alternative custom-radio mb-3">
  42. <input class="custom-control-input" name="unit_donor_darah_id" value="{{ $value_udd->id }}" {{ $data->udd->id == $value_udd->id ? 'checked' : null }} required id="udd{{$key.$key_value}}" type="radio">
  43. <label class="custom-control-label" for="udd{{$key.$key_value}}">{{ $value_udd->nama }}</label>
  44. </div>
  45. @endforeach
  46. </div>
  47. @endforeach
  48. </div>
  49. @endif
  50. </div>
  51. <div class="col-lg-6">
  52. <div class="form-group">
  53. <label> List Role <span class="text-danger">*</span></label>
  54. @php
  55. $role_petugas = $data->user->roles()->get()->pluck('id')->toArray();
  56. @endphp
  57. @foreach ($roles as $key => $value)
  58. <div class="card mr-2 my-2 p-3">
  59. @foreach ($value as $key_value => $value_role)
  60. <div class="custom-control custom-control-alternative custom-checkbox mb-3">
  61. <input class="custom-control-input" name="role_id[]" value="{{ $value_role->id }}" {{ in_array($value_role->id, $role_petugas) ? 'checked' : null }} id="role{{$key.$key_value}}" type="checkbox">
  62. <label class="custom-control-label" for="role{{$key.$key_value}}">{{ $value_role->name }}</label>
  63. </div>
  64. @endforeach
  65. </div>
  66. @endforeach
  67. </div>
  68. </div>
  69. </div>
  70. <div class="group">
  71. <button type="submit" class="btn btn-success">Simpan</button>
  72. <a class="btn btn-default bg-back" href="{{ route($route.'index') }}">Kembali</a>
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. @endsection
  80. {{-- load JS yang lu perluin, selain itu no --}}
  81. @push('js')
  82. <script src="{{ asset('assets') }}/js/blockUI.js"></script>
  83. <script src="{{ asset('assets') }}/js/sweetalert2.js"></script>
  84. <script src="{{ asset('assets') }}/js/custom.js"></script>
  85. @endpush