  <!-- Modal Keraian -->
  <div class="modal fade" id="keraianModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLongTitle">Keraian</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <form name="KeraianForm" method="post" action="{{ route('khazanah.createpanjar') }}" novalidate onsubmit="return checkformpanjar(this);">
          @csrf
        <div class="modal-body text-center">
                <input type="hidden" name="jenismodal" value="keraian"/>

                <input type="hidden" name="ambilansen1" value=""/>
                <input type="hidden" name="ambilansen5" value=""/>
                <input type="hidden" name="ambilansen10" value=""/>
                <input type="hidden" name="ambilansen20" value=""/>
                <input type="hidden" name="ambilansen50" value=""/>

                <input type="hidden" name="ambilanring1" value=""/>
                <input type="hidden" name="ambilanring5" value=""/>
                <input type="hidden" name="ambilanring10" value=""/>
                <input type="hidden" name="ambilanring20" value=""/>
                <input type="hidden" name="ambilanring50" value=""/>
                <input type="hidden" name="ambilanring100" value=""/>


                <div class="row">
                  <div class="col-4">
                    <label>Baucer No: </label>
                  </div>
                  <div class="col-8 mb-4 flex-wrap">
                    <input type="text" name="baucer" class="form-control-plaintext baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tarikh: </label>
                  </div>
                  <div class="col-8 mb-4 flex-wrap"> 
                    <input type="date" class="form-control" name="tarikh" required/>
                    <span name="errortarikh" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tuntutan Oleh: </label> 
                  </div>
                  <div class="col-8 mb-4">
                    <select name="tuntutan" class="form-control" required>
                      @foreach($usercawangan as $user)
                      <option value="{{ $user->name }}">{{ $user->name }}</option>
                      @endforeach
                    </select>
                    <span name="errortuntutan" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tarikh Bil: </label> 
                  </div>
                  <div class="col-8 mb-4 flex-wrap">
                    <input type="date" class="form-control" name="tarikhbil" required/>
                    <span name="errorbil" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Deskripsi:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <textarea row="3" name="deskripsi" class="form-control" minlength='6' maxlength='25' required> </textarea>
                    <span name="errordeskripsi" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Bayaran (RM): </label> 
                  </div>
                  <div class="col-8">
                    <div class="row pl-3">
                      <input type="text" class="form-control col-8" name="bayaran" required readonly/>
                      <button type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                      <span name="errorbayaran" style="color:red;"></span>
                    </div>
                  </div>
                </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
            <button type="submit" id="terima_transaksi_keraian" class="btn btn-success">Terima</button>
        </div>
      </form>
      </div>
    </div>
  </div>

  <!-- Modal SelenggaraModal -->
  <div class="modal fade" id="SelenggaraModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLongTitle">Selenggara</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <form name="frmmodal" method="post" action="{{ route('khazanah.createpanjar') }}" onsubmit="return checkformpanjar(this);">
          @csrf
        <div class="modal-body text-center">
                <input type="hidden" name="jenismodal" value="selenggara"/>

                <input type="hidden" name="ambilansen1" value=""/>
                <input type="hidden" name="ambilansen5" value=""/>
                <input type="hidden" name="ambilansen10" value=""/>
                <input type="hidden" name="ambilansen20" value=""/>
                <input type="hidden" name="ambilansen50" value=""/>

                <input type="hidden" name="ambilanring1" value=""/>
                <input type="hidden" name="ambilanring5" value=""/>
                <input type="hidden" name="ambilanring10" value=""/>
                <input type="hidden" name="ambilanring20" value=""/>
                <input type="hidden" name="ambilanring50" value=""/>
                <input type="hidden" name="ambilanring100" value=""/>

                <div class="row">
                  <div class="col-4">
                    <label>Baucer No:</label>
                    </div>
                    <div class="col-8">
                    <input type="text" name="baucer" class="form-control mb-4 baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tarikh:
                    </div>
                    <div class="col-8 mb-4">
                    <input type="date" name="tarikh" class="form-control"/>
                    <span name="errortarikh" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tuntutan Oleh:</label>
                    </div>
                    <div class="col-8 mb-4">
                    <select name="tuntutan" class="form-control">
                      @foreach($usercawangan as $user)
                        <option value="{{ $user->name }}">{{ $user->name }}</option>
                      @endforeach
                    </select>
                    <span name="errortuntutan" style="color:red;"></span>
                    {{-- <input type="text" name="tuntutan" class="form-control mb-4"/> --}}
                  </div>
                  <div class="col-4">
                    <label>Tarikh Bil:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <input type="date" name="tarikhbil" class="form-control"/>
                    <span name="errorbil" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Deskripsi:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <textarea row="3" name="deskripsi" class="form-control"> </textarea>
                    <span name="errordeskripsi" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Bayaran (RM):</label>
                  </div>
                  <div class="col-8">
                    <div class="row pl-3">
                      <input type="text" name="bayaran" readonly class="form-control col-8"/>
                      <button type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                      <span name="errorbayaran" style="color:red;"></span>
                    </div>
                  </div>
                </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
            <button type="submit" id="terima_transaksi_selenggara" class="btn btn-success">Terima</button>
        </div>
      </form>
      </div>
    </div>
  </div>

    <!-- Modal BelanjaamModal -->
    <div class="modal fade" id="BelanjaamModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLongTitle">Belanja AM</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <form name="frmmodal" method="post" action="{{ route('khazanah.createpanjar') }}" onsubmit="return checkformpanjar(this);">
              @csrf
            <div class="modal-body text-center">
              <input type="hidden" name="jenismodal" value="belanjaam"/>

              <input type="hidden" name="ambilansen1" value=""/>
              <input type="hidden" name="ambilansen5" value=""/>
              <input type="hidden" name="ambilansen10" value=""/>
              <input type="hidden" name="ambilansen20" value=""/>
              <input type="hidden" name="ambilansen50" value=""/>

              <input type="hidden" name="ambilanring1" value=""/>
              <input type="hidden" name="ambilanring5" value=""/>
              <input type="hidden" name="ambilanring10" value=""/>
              <input type="hidden" name="ambilanring20" value=""/>
              <input type="hidden" name="ambilanring50" value=""/>
              <input type="hidden" name="ambilanring100" value=""/>

              <div class="row">
                <div class="col-4">
                  <label>Baucer No:</label>
                </div>
                <div class="col-8">
                  <input type="text" name="baucer" class="form-control mb-4 baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Tarikh:</label>
                </div>
                <div class="col-8 mb-4">
                  <input type="date" name="tarikh" class="form-control"/>
                  <span name="errortarikh" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Tuntutan Oleh:</label>
                </div>
                <div class="col-8 mb-4">
                  <select name="tuntutan" class="form-control">
                    @foreach($usercawangan as $user)
                      <option value="{{ $user->name }}">{{ $user->name }}</option>
                    @endforeach
                  </select>
                  <span name="errortuntutan" style="color:red;"></span>
                  {{-- <input type="text" name="tuntutan" class="form-control mb-4"/> --}}
                </div>
                <div class="col-4">
                  <label>Tarikh Bil:</label>
                </div>
                <div class="col-8 mb-4">
                  <input type="date" name="tarikhbil" class="form-control"/>
                  <span name="errorbil" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Deskripsi:</label>
                </div>
                <div class="col-8 mb-4">
                  <textarea row="3" name="deskripsi" class="form-control"> </textarea>
                  <span name="errordeskripsi" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Bayaran (RM):</label>
                </div>
                <div class="col-8">
                  <div class="row pl-3">
                    <input type="text" name="bayaran" readonly class="form-control col-8"/>
                    <button type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                    <span name="errorbayaran" style="color:red;"></span>
                  </div>
                </div>
              </div>

            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
              <button type="submit" id="terima_transaksi_belanjaam" class="btn btn-success">Terima</button>
            </div>
          </form>
          </div>
        </div>
      </div>


       <!-- Modal PerubatanModal -->
    <div class="modal fade" id="PerubatanModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLongTitle">Perubatan</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <form name="frmmodal" method="post" action="{{ route('khazanah.createpanjar') }}" onsubmit="return checkformpanjar(this);">
            @csrf
          <div class="modal-body text-center">
              <input type="hidden" name="jenismodal" value="perubatan"/>

              <input type="hidden" name="ambilansen1" value=""/>
              <input type="hidden" name="ambilansen5" value=""/>
              <input type="hidden" name="ambilansen10" value=""/>
              <input type="hidden" name="ambilansen20" value=""/>
              <input type="hidden" name="ambilansen50" value=""/>

              <input type="hidden" name="ambilanring1" value=""/>
              <input type="hidden" name="ambilanring5" value=""/>
              <input type="hidden" name="ambilanring10" value=""/>
              <input type="hidden" name="ambilanring20" value=""/>
              <input type="hidden" name="ambilanring50" value=""/>
              <input type="hidden" name="ambilanring100" value=""/>

              <div class="row">
                <div class="col-4">
                  <label>Baucer No:</label>
                </div>
                <div class="col-8">
                  <input type="text" name="baucer" class="form-control mb-4 baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Tarikh:</label>
                </div>
                <div class="col-8 mb-4">
                  <input type="date" name="tarikh" class="form-control"/>
                  <span name="errortarikh" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Tuntutan Oleh:</label>
                </div>
                <div class="col-8 mb-4">
                  <select name="tuntutan" class="form-control">
                    @foreach($usercawangan as $user)
                      <option value="{{ $user->name }}">{{ $user->name }}</option>
                    @endforeach
                  </select>
                  <span name="errortuntutan" style="color:red;"></span>
                  {{-- <input type="text" name="tuntutan" class="form-control mb-4"/> --}}
                </div>
                <div class="col-4">
                  <label>Tarikh Bil:</label>
                </div>
                <div class="col-8 mb-4">
                  <input type="date" name="tarikhbil" class="form-control"/>
                  <span name="errorbil" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Deskripsi:</label>
                </div>
                <div class="col-8 mb-4">
                  <textarea row="3" name="deskripsi" class="form-control"> </textarea>
                  <span name="errordeskripsi" style="color:red;"></span>
                </div>
                <div class="col-4">
                  <label>Bayaran (RM):</label>
                </div>
                <div class="col-8">
                  <div class="row pl-3">
                    <input type="text" name="bayaran" readonly class="form-control col-8"/>
                    <button type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                    <span name="errorbayaran" style="color:red;"></span>
                  </div>
                </div>
              </div>

          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
            <button type="submit" id="terima_transaksi_perubatan" class="btn btn-success">Terima</button>
          </div>
        </form>
        </div>
      </div>
    </div>

      <!-- Modal DapurModal -->
      <div class="modal fade" id="DapurModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLongTitle">Dapur</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <form name="frmmodal" method="post" action="{{ route('khazanah.createpanjar') }}" onsubmit="return checkformpanjar(this);">
              @csrf
            <div class="modal-body text-center">
                <input type="hidden" name="jenismodal" value="dapur"/>

                <input type="hidden" name="ambilansen1" value=""/>
                <input type="hidden" name="ambilansen5" value=""/>
                <input type="hidden" name="ambilansen10" value=""/>
                <input type="hidden" name="ambilansen20" value=""/>
                <input type="hidden" name="ambilansen50" value=""/>
  
                <input type="hidden" name="ambilanring1" value=""/>
                <input type="hidden" name="ambilanring5" value=""/>
                <input type="hidden" name="ambilanring10" value=""/>
                <input type="hidden" name="ambilanring20" value=""/>
                <input type="hidden" name="ambilanring50" value=""/>
                <input type="hidden" name="ambilanring100" value=""/>

                <div class="row">
                  <div class="col-4">
                    <label>Baucer No:</label>
                  </div>
                  <div class="col-8">
                    <input type="text" name="baucer" class="form-control mb-4 baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                  </div>

                  <div class="col-4">
                    <label>Tarikh:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <input type="date" name="tarikh" class="form-control"/>
                    <span name="errortarikh" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tuntutan Oleh:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <select name="tuntutan" class="form-control">
                      @foreach($usercawangan as $user)
                        <option value="{{ $user->name }}">{{ $user->name }}</option>
                      @endforeach
                    </select>
                    <span name="errortuntutan" style="color:red;"></span>
                    {{-- <input type="text" name="tuntutan" class="form-control mb-4"/> --}}
                  </div>
                  <div class="col-4">
                    <label>Tarikh Bil:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <input type="date" name="tarikhbil" class="form-control"/>
                    <span name="errorbil" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Deskripsi:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <textarea row="3" name="deskripsi" class="form-control"> </textarea>
                    <span name="errordeskripsi" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Bayaran (RM):</label>
                  </div>
                  <div class="col-8">
                    <div class="row pl-3">
                      <input type="text" name="bayaran" readonly class="form-control col-8"/>
                      <button type="button" type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                    </div>
                  </div>
                </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
              <button type="submit" id="terima_transaksi_dapur" class="btn btn-success">Terima</button>
            </div>
          </form>
          </div>
        </div>
      </div>
      
      <!-- Modal PosModal -->
      <div class="modal fade" id="PosModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLongTitle">Perbelanjaan Pos</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <form name="frmmodal" method="post" action="{{ route('khazanah.createpanjar') }}" onsubmit="return checkformpanjar(this);">
              @csrf
            <div class="modal-body text-center">
                <input type="hidden" name="jenismodal" value="pos"/>

                <input type="hidden" name="ambilansen1" value=""/>
                <input type="hidden" name="ambilansen5" value=""/>
                <input type="hidden" name="ambilansen10" value=""/>
                <input type="hidden" name="ambilansen20" value=""/>
                <input type="hidden" name="ambilansen50" value=""/>
  
                <input type="hidden" name="ambilanring1" value=""/>
                <input type="hidden" name="ambilanring5" value=""/>
                <input type="hidden" name="ambilanring10" value=""/>
                <input type="hidden" name="ambilanring20" value=""/>
                <input type="hidden" name="ambilanring50" value=""/>
                <input type="hidden" name="ambilanring100" value=""/>
                
                <div class="row">
                  <div class="col-4">
                    <label>Baucer No:</label>
                  </div>
                  <div class="col-8">
                    <input type="text" name="baucer" class="form-control mb-4 baucer" readonly/>
                    <span name="errorbaucer" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tarikh:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <input type="date" name="tarikh" class="form-control"/>
                    <span name="errortarikh" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Tarikh Bil:</label>
                  </div>
                  <div class="col-8 mb-4">
                    <input type="date" name="tarikhbil" class="form-control"/>
                    <span name="errorbil" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Deskripsi:</label>
                  </div>
                  <div class="col-8 mb-4">
                    {{-- <input type="text" name="deskripsi" class="form-control mb-4"/> --}}
                    <textarea row="3" name="deskripsi" class="form-control"> </textarea>
                    <span name="errordeskripsi" style="color:red;"></span>
                  </div>
                  <div class="col-4">
                    <label>Bayaran (RM):</label>
                  </div>
                  <div class="col-8">
                    <div class="row pl-3">
                      <input type="text" readonly name="bayaran" class="form-control col-8"/>
                      <button type="button" type="button" class="btn btn-primary ml-1 col-3" onclick="openupdeno();">Deno</button>
                    </div>
                  </div>
                </div>
  
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
              <button type="submit" id="terima_transaksi_pos" class="btn btn-success">Terima</button>
            </div>
          </form>
          </div>
        </div>
      </div>


       <!-- Modal Baki Perubatan -->
       <div class="modal fade" id="BakiPerubatanModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLongTitle">Perbelanjaan Pos</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            
            <div class="modal-body text-center">
                
              <table class='table table-striped table-hover' id='table-bakiperubatan' style="width:100%;">
                <thead class="thead-dark">
                    <tr>
                        <th>bil</th>
                        <th>Nama Staff</th>
                        <th>Baki Perubatan(RM)</th>
                    </tr>
                </thead>
                <tbody>
                  @foreach($usercawangan as $index1=>$usercaw)
                  <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $usercaw->name }}</td>
                    <td>{{ number_format($usercaw->perubatan,2) }}</td>
                  </tr>
                  @endforeach
                </tbody>
              </table>

            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
            </div>
          </div>
        </div>
      </div>
  

      