detail.blade.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. input, select {
  6. border: 0 !important;
  7. background: transparent !important;
  8. border-bottom: 1px solid #cdcdcd !important;
  9. }
  10. .tb-container{
  11. background: #fff;
  12. margin-top: 1em;
  13. }
  14. tbody > tr {
  15. line-height: 45px !important;
  16. min-height: 45px !important;
  17. height: 45px !important;
  18. }
  19. .ic {
  20. width: 1.5rem;
  21. height: 1.3rem;
  22. border-radius: .5rem;
  23. text-align: center;
  24. cursor:pointer;
  25. /* background: #cdcdcd; */
  26. /* padding-top: .3rem; */
  27. font-size: 1em;
  28. list-style: none;
  29. color: #000;
  30. }
  31. </style>
  32. <br/>
  33. <br/>
  34. <form action="{{route('penentuan-target.update',$data->id)}}" method="POST" id="form-edit">
  35. @csrf
  36. <div class="col">
  37. <div class="form-group">
  38. <label for="exampleInputEmail1">Program *</label>
  39. <input type="text" class="form-control" value="{{!empty($data->templateProgram)?$data->templateProgram->nama:'-'}}" readonly>
  40. <small id="tahunProgramHelp" class="form-text text-muted" style="color:red !important"></small>
  41. <!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
  42. </div>
  43. <div class="form-group">
  44. <label for="exampleInputEmail1">Tipe Target *</label>
  45. <select class="form-control" id="opt-tipe-target" name="tipe_target" disabled>
  46. <option value="0" {{$data->tipe_target==0?'selected':''}}>Spesifik UPT</option>
  47. <option value="1" {{$data->tipe_target==1?'selected':''}}>Semua</option>
  48. </select>
  49. </div>
  50. <div class="form-group" id="div-opt-periode">
  51. <label for="exampleInputEmail1">Periode *</label>
  52. <select class="form-control" id="opt-periode" name="periode" disabled>
  53. @for($i=1;$i<=$data->jumlah;$i++)
  54. <option value="{{$i}}"}} {{(!empty(Session::has('previous_periode')) && session('previous_periode')==$i)?'selected':''}}>Periode {{$i}}</option>
  55. @endfor
  56. </select>
  57. </div>
  58. <div class="form-group">
  59. <label for="exampleInputEmail1">Satuan *</label>
  60. <input type="text" class="form-control" name="satuan_target" id="satuan-target" value="{{$data->satuan_target}}">
  61. </div>
  62. <div class="btn btn-primary btn-lg btn-block" style="background: #193865;margin-top: 1em">TARGET</div>
  63. <div class="tb-container" id="table_semua" style="display:none">
  64. <table class="table table-bordered">
  65. <thead >
  66. <tr class="table-dark">
  67. <th scope="col">Periode</th>
  68. <th scope="col">Target</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. @for($row_periode=1;$row_periode<=$data->jumlah;$row_periode++)
  73. <?php
  74. $row = App\Model\TahunProgramDetailUpt::where('id_tahun_program_detail',$data->id)->where('periode',$row_periode)->first();
  75. ?>
  76. @if(!empty($row))
  77. <tr>
  78. <td>
  79. <input type="number" name="semua_periode_{{$row_periode}}" value="{{$row_periode}}" class="form-control" readonly>
  80. </td>
  81. <td>
  82. <input type="number" name="semua_target_{{$row_periode}}" class="form-control" value="{{$row->target}}" readonly>
  83. </td>
  84. </tr>
  85. @else
  86. <tr>
  87. <td>
  88. <input type="number" name="semua_periode_{{$row_periode}}" value="{{$row_periode}}" class="form-control" readonly>
  89. </td>
  90. <td>
  91. <input type="number" name="semua_target_{{$row_periode}}" class="form-control" value="0" readonly>
  92. </td>
  93. </tr>
  94. @endif
  95. @endfor
  96. </tbody>
  97. </table>
  98. </div>
  99. @for($row_periode=1;$row_periode<=$data->jumlah;$row_periode++)
  100. <div class="tb-container table_spesifik_upt_periode" id="table_spesifik_upt_periode_{{$row_periode}}" style="display:none">
  101. <table class="table table-bordered">
  102. <thead >
  103. <tr class="table-dark">
  104. <th scope="col">Periode</th>
  105. <th scope="col">UPT</th>
  106. <th scope="col">Target</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. @foreach($upt as $row_upt)
  111. <?php
  112. $row = App\Model\TahunProgramDetailUpt::where('id_tahun_program_detail',$data->id)->where('periode',$row_periode)->where('id_upt',$row_upt->office_id)->first();
  113. ?>
  114. @if(!empty($row))
  115. <tr>
  116. <td>
  117. <input type="number" name="spesifik_periode_{{$row_periode}}_{{$row_upt->office_id}}" value="{{$row_periode}}" class="form-control" readonly>
  118. </td>
  119. <td>
  120. <input type="hidden" name="spesifik_id_upt_{{$row_periode}}_{{$row_upt->office_id}}" value="{{$row_upt->office_id}}">
  121. <input type="text" class="form-control" value="{{$row_upt->office_name}}" readonly>
  122. </td>
  123. <td>
  124. <input type="number" name="spesifik_target_{{$row_periode}}_{{$row_upt->office_id}}" class="form-control" value="{{$row->target}}" readonly>
  125. </td>
  126. </tr>
  127. @else
  128. <tr>
  129. <td>
  130. <input type="number" name="spesifik_periode_{{$row_periode}}_{{$row_upt->office_id}}" value="{{$row_periode}}" class="form-control" readonly>
  131. </td>
  132. <td>
  133. <input type="hidden" name="spesifik_id_upt_{{$row_periode}}_{{$row_upt->office_id}}" value="{{$row_upt->office_id}}">
  134. <input type="text" class="form-control" value="{{$row_upt->office_name}}" readonly>
  135. </td>
  136. <td>
  137. <input type="number" name="spesifik_target_{{$row_periode}}_{{$row_upt->office_id}}" class="form-control" value="0" readonly>
  138. </td>
  139. </tr>
  140. @endif
  141. @endforeach
  142. </tbody>
  143. </table>
  144. </div>
  145. @endfor
  146. <div class="tb-container">
  147. <div class="row" style="padding:20px">
  148. <div class="col-md-10"></div>
  149. <div class="col-md-2">
  150. <a href="{{route('penentuan-target')}}" class="btn btn-primary" id="btn-back" style="background: #fff;color: #193865">Kembali</a>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </form>
  156. <script>
  157. $('#opt-tipe-target').on('change',function(){
  158. var tipe_target = $(this).val();
  159. //tipe target 0 = spesifik upt, tipe target 1 = semua
  160. if(tipe_target == 0){
  161. $('#table_spesifik_upt').css('display','block');
  162. $('#table_semua').css('display','none');
  163. $('#div-opt-periode').css('display','block');
  164. $('#opt-periode').css('display','block');
  165. $('#opt-periode').trigger('change');
  166. }else{
  167. $('#table_spesifik_upt').css('display','none');
  168. $('#table_semua').css('display','block');
  169. $('#div-opt-periode').css('display','none');
  170. $('#opt-periode').css('display','none');
  171. $('.table_spesifik_upt_periode').css('display','none');
  172. }
  173. });
  174. $('#opt-periode').on('change',function(){
  175. var periode = $(this).val();
  176. $('.table_spesifik_upt_periode').css('display','none');
  177. $('#table_spesifik_upt_periode_'+periode).css('display','block');
  178. });
  179. $('#opt-tipe-target').trigger('change');
  180. </script>
  181. @endsection