<?php if (isset($component)) { $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AppLayout::class, [] + (isset($attributes) ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $constructor = (new ReflectionClass(App\View\Components\AppLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
   <?php $__env->slot('header', null, []); ?> 
    <h2 class="font-semibold text-xl text-gray-800 leading-tight">
      <?php echo e(__('Laporan Tagihan Wi-Fi')); ?>

    </h2>
   <?php $__env->endSlot(); ?>



   <?php $__env->slot('slot', null, []); ?> 

    

    <div style="width: 90%; margin-left: 5%; margin-right: 5%;" align="center">


      <?php
        try{
          $gettahun = $_GET['tahun'];
          $getpage = $_GET['page'];
          $getsearch = $_GET['search'];
          $getsearchtype = $_GET['searchtype'];

        }catch(Exception $e){
          header("Location: ".URL::to('/')."/dashboard?tahun=".date("Y")."&page=0&search=&searchtype="); 
          exit();
        }

      ?>

      <div class="card">
        <div class="card-header">
          <div class="row align-items-center">
            <div class="col-6 ">
             Laporan Tagihan Wi-Fi
           </div>
           <div class="col-6">
            
            <button type="button" style="float: right;" class="btn btn-info btn-sm " data-toggle="modal" data-target="#myModal">
              Tambah Pelanggan
            </button>
          </div>

        </div>


      </div>
      <div class="card-body" >
                <div class="container1">
                  <div class="row">
                    <div class="col-5" >
                      <div class="input-group mb-3 bg-danger">
                        <div class="input-group-prepend bg-info">
                          
                          <select name="searchtype" id="searchtype" class="bg-success text-white">
                            <option value="nama">nama</option>
                            <option value="alamat">alamat</option> 
                          </select>
                        </div>

                        <input type="text" id="fieldCariNama" class="form-control">
                        <div class="input-group-append">
                          <button class="btn btn-success" type="button" onclick="searchNama()">Cari</button>
                        </div>
                      </div>
                    </div>
                    <div class="col-5">
                      
                    </div>
                    <div class="col-2">
                      <select class="form-control form-control-lg bg-danger text-white" name="optTahun" id="optTahun" style="float: right;" onchange="changeTahun()">
                      <option id="tahun2026" value="2026">2026</option>
                      <option id="tahun2025" value="2025">2025</option>
                      <option id="tahun2024" value="2024">2024</option>
                      <option id="tahun2023" value="2023">2023</option>
                      <option id="tahun2022" value="2022">2022</option>
                      <option id="tahun2021" value="2021">2021</option>
                      <option id="tahun2020" value="2020">2020</option>
                    
                    </select>
                    </div>
                  </div>
                </div>

        <div class="table-responsive">

          


          <table class="table table-striped table-bordered" style="overflow: auto;">
            <thead>
              <tr>
                
                <th colspan="1" rowspan="2" >ID Pelanggan</th>
                <th colspan="1" rowspan="2">Edit Cust</th>
                <th colspan="1" rowspan="2">Hapus Cust</th>
                <th colspan="1" rowspan="2" >Nama</th>
                <th colspan="1" rowspan="2" >Telepon</th>
                <th colspan="1" rowspan="2" >Alamat</th>
                <th colspan="1" rowspan="2" >Tanggal Pasang</th>
                <th colspan="1" rowspan="2" >Speed (Mb)</th>
                <th colspan="1" rowspan="2" >Nominal Tagihan</th>

                <th colspan="12" align="center">
                  <div class="dropdown">
                    Pembayaran Bulan
                    
                  </div>
                </th>
              </tr>
              <tr>
                <th>Jan</th>
                <th>Feb</th>
                <th>Mar</th>
                <th>Apr</th>
                <th>Mei</th>
                <th>Jun</th>
                <th>Jul</th>
                <th>Agus</th>
                <th>Sept</th>
                <th>Okt</th>
                <th>Nop</th>
                <th>Des</th>
              </tr>
            </thead>
            <tbody>

              <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <tr>
                
                <td><?php echo e($customer['customer_id']); ?> </td>
                <td><button type="button" style="float: right;" data-toggle="modal" data-target="#myModaleditcust" onclick="editcustomer('<?php echo e($customer['customer_id']); ?>','<?php echo e($customer['nama']); ?>','<?php echo e($customer['speed']); ?>','<?php echo e($customer['nominal_tagihan']); ?>','<?php echo e($customer['telepon']); ?>','<?php echo e($customer['tgl_pasang']); ?>','<?php echo e($customer['alamat']); ?>')" class="btn btn-warning btn-sm"> Edit </td>
                  <td><button type="button" style="float: right;" data-toggle="modal" data-target="#myModalhapuscust" class="btn btn-danger btn-sm" onclick="hapuscustomer('<?php echo e($customer['customer_id']); ?>','<?php echo e($customer['nama']); ?>')">hapus</td>
                <td><?php echo e($customer['nama']); ?></td>
                <td><?php echo e($customer['telepon']); ?></td>
                <td><?php echo e($customer['alamat']); ?></td>
                <td>
                <?php if($customer['tgl_pasang'] != ""): ?>
                <?php echo e(date_format(date_create($customer['tgl_pasang']),"d-M-Y")); ?>

                <?php else: ?>
                Belum Diisi
                <?php endif; ?>
                </td>
                <td><?php echo e($customer['speed']); ?></td>
                <td>Rp.<?php echo e(number_format($customer['nominal_tagihan'])); ?>,-</td>

                <?php for($i = 1; $i<=12 ; $i++): ?>
                <td>
                  <?php if($customer['bulan'.$i] == "Belum Bayar"): ?>
                  <button id="<?php echo e($customer['customer_id']); ?>_<?php echo e($i); ?>" type="button" disabled="" style="float: right;" data-toggle="modal" data-target="#myModalbayar" onclick="getDetailPembayaran('<?php echo e($customer['customer_id']); ?>','<?php echo e($customer['nama']); ?>','<?php echo e($i); ?>','<?php echo e($customer['tahun']); ?>','<?php echo e($customer['speed']); ?>','<?php echo e($customer['nominal_tagihan']); ?>'); cekradio()" value="0" class="btn_status_bayar btn btn-danger btn-sm"> Belum Bayar
                  <?php else: ?>
                  <button id="<?php echo e($customer['customer_id']); ?>_<?php echo e($i); ?>" type="button" disabled="" style="float: right;" data-toggle="modal" data-target="#myModalbayar" onclick="getDetailPembayaran('<?php echo e($customer['customer_id']); ?>','<?php echo e($customer['nama']); ?>','<?php echo e($i); ?>','<?php echo e($customer['tahun']); ?>','<?php echo e($customer['speed']); ?>', '<?php echo e($customer['nominal_tagihan']); ?>'); cekradio()" value="1" class="btn_status_bayar btn btn-success btn-sm"> Sudah Bayar
                  <?php endif; ?>
                  </button>
                </td>
                <?php endfor; ?>

              </tr>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
          </table>
           <ul class="pagination pagination-sm" style="float: right;">
                
                <li id="previous_button"   class="page-item"><a class="page-link" 
                  href="<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=<?php echo e($getpage-1 ?? '0'); ?>&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>">Previous</a></li>
                <?php for($i = 0; $i<= $pagecount; $i++): ?>


                  <?php if($i < $_GET['page'] && $i > $_GET['page']-9): ?>
                  <li id="page<?php echo e($i); ?>" class="page-item"><a class="page-link" 
                  href="<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=<?php echo e($i); ?>&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>"><?php echo e($i+1); ?></a></li>
                  <?php endif; ?>

                  <?php if($i == $_GET['page']): ?>
                 <li id="page<?php echo e($i); ?>" class="page-item active"><a class="page-link" 
                  href="<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=<?php echo e($i); ?>&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>"><?php echo e($i+1); ?></a></li>
                  <?php endif; ?>

                   <?php if($i > $_GET['page'] && $i < $_GET['page']+9): ?>
                  <li id="page<?php echo e($i); ?>" class="page-item"><a class="page-link" 
                  href="<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=<?php echo e($i); ?>&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>"><?php echo e($i+1); ?></a></li>
                  <?php endif; ?>

                <?php endfor; ?>
                <li id="next_button"   class="page-item"><a id="next_button" class="page-link" 
                  href="<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=<?php echo e($getpage+1); ?>&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>">Next</a></li>
              </ul>   

        </div> 
      </div>
    </div>

  </div>

  <!-- The Modal tambah pelanggan -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog">
      <div class="modal-content">

        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title">Tambah Pelanggan</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>

        <!-- Modal body -->
        <div class="modal-body">
         <form action="<?php echo e(url('funcTambahPelanggan')); ?>">
          <div class="form-group">
            <label for="nama">Nama</label>
            <input type="text" class="form-control" id="nama" name="nama" required >
          </div>
          <div class="form-group">
           <label for="Telepon">Telepon</label>
           <input type="text" class="form-control" id="telepon" name="telepon" required >
         </div>

         <div class="form-group">
           <label for="Alamat">Alamat</label>
           <input type="text" class="form-control" id="alamat" name="alamat" required >
         </div>

         <div class="form-group">
           <label for="tgl_pasang">Tanggal Pasang</label>
           <input type="date" class="form-control" id="tgl_pasang" name="tgl_pasang" required>
         </div>

         <div class="form-group">
           <label for="speed">SPEED (Mb)</label>
           <input type="text" class="form-control" id="speed" name="speed" required >
         </div>

         <div class="form-group">
           <label for="tgl_pasang">Nominal Tagihan (angka tanpa tanda)</label>
           <input type="number" class="form-control" id="nominal_tagihan" name="nominal_tagihan" required >
         </div>


       </div>
       <div class="modal-footer">
        <button type="submit" class="btn btn-primary">Submit</button>
        <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>

      </form>
    </div>

    <!-- Modal footer -->


  </div>
</div>
</div>




<!-- The Modal pembayaran -->
<div class="modal fade" id="myModalbayar">
  <div class="modal-dialog" >
    <div class="modal-content" id="modal_overlay">

      <!-- Modal Header -->
      <div class="modal-header">
        <h4 class="modal-title">Pembayaran</h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body" id="modal-body1">


        <form id="modalbayar">
          <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="customerid">ID Pelanggan</label>
                <input type="text" class="form-control" id="customerid" name="customerid" readonly="">    
              </div> 
              <div class="col-8">
                <label for="bayarnama">Nama</label>
                <input type="text" class="form-control" id="bayarnama" name="bayarnama" readonly="">    
              </div>  
            </div>
          </div>

           <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="customerid">Speed</label>
                <input type="text" class="form-control" id="bayarspeed" name="bayarspeed" readonly="">    
              </div> 
              <div class="col-8">
                <label for="bayarnama">Nominal Tagihan</label>
                <input type="text" class="form-control" id="bayarnominaltagihan" name="bayarnominaltagihan" readonly="">    
              </div>  
            </div>
          </div>

          <div class="form-group">

            <div class="row">
              <div class="col-6">
                <label for="bayarbulan">Bulan</label>
                <input type="text" class="form-control" id="bayarbulan" name="bayarbulan" readonly="">  
              </div>

              <div class="col-6">
                <label for="bayartahun">Tahun</label>
                <input type="text" class="form-control" id="bayartahun" name="bayartahun" readonly="">  
              </div>  
            </div>
          </div>

          <div class="row">
            <div class="col-12" align="center">

              <div class="custom-control custom-radio custom-control-inline" style="margin-top: 15px">
                <input type="radio" class="custom-control-input" id="radio_belum_bayar" name="example" onchange="changeBayar(0)">
                <label class="custom-control-label" for="radio_belum_bayar" ><h4>Belum Bayar</h4></label>
              </div>
              <div class="custom-control custom-radio custom-control-inline">
                <input type="radio" class="custom-control-input" id="radio_sudah_bayar" name="example" onchange="changeBayar(1)">
                <label class="custom-control-label" for="radio_sudah_bayar" value="postBayar" ><h4>Sudah Bayar</h4></label>
              </div>  

            </div>
          </div>

            <div class="row">

                <div class="col-md-12" align="center">

                    <button type="button" id="printinv_button" class="btn btn-success" style="margin-top: 25px"  onclick="print_invoice()" disabled="disable">Print Invoice.</button>
                    
                </div>
                
            </div>

          
        </form>
      </div>




      <div class="modal-body" id="modal-body2" style="display: none;">

        <div class="row">
          <div class="col-12" align="center">
            <h4>Mohon Tunggu, Memproses Pembayaran....</h4>    
          </div>
          <div class="col-12" align="center">
            <div class="spinner-border text-warning"></div>
          </div>
        </div>

      </div>

      <!-- Modal footer -->


    </div>
  </div>
</div> 



<!-- The Modal edit cust -->
<div class="modal fade" id="myModaleditcust">
  <div class="modal-dialog" >
    <div class="modal-content" id="modal_overlay">

      <!-- Modal Header -->
      <div class="modal-header">
        <h4 class="modal-title">Edit Data Pelanggan</h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body" id="modal-body2">


        <form id="modaleditcust" action="<?php echo e(URL::to('/')); ?>/funcEditPelanggan" method="get">
          <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="customerid">ID Pelanggan</label>
                <input type="text" class="form-control" id="customerid_edit" name="customerid_edit" readonly="">    
              </div> 
              <div class="col-8">
                <label for="editnama">Nama</label>
                <input type="text" class="form-control" id="editnama" name="editnama">    
              </div>  
            </div>
          </div>

           <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="editspeed">Speed</label>
                <input type="text" class="form-control" id="editspeed" name="editspeed" >    
              </div> 
              <div class="col-8">
                <label for="editnama">Nominal Tagihan</label>
                <input type="number" class="form-control" id="editnominaltagihan" name="editnominaltagihan">    
              </div>  
            </div>
          </div>

          <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="editspeed">Telepon</label>
                <input type="text" class="form-control" id="edittelepon" name="edittelepon" >    
              </div> 
              <div class="col-8">
                <label for="editnama">Tanggal Pasang</label>
                <input type="date" class="form-control" id="edittglpasang" name="edittglpasang">    
                <input type="text" name="editurl" id="editurl" style="visibility: hidden;">
              </div>  
            </div>
          </div>

          <div class="form-group">
            <div class="row">
              <div class="col-12">
                <label for="editalamat">Alamat</label>
                <input type="text" class="form-control" id="editalamat" name="editalamat" >    
              </div> 
            </div>
          </div>

            <div class="row">

                <div class="col-md-12" align="center">

                    <button type="submit" id="simpan_button" class="btn btn-success" style="margin-top: 25px" >Simpan</button>
                    
                </div>
                
            </div>

          
        </form>
      </div>




      <div class="modal-body" id="modal-body2" style="display: none;">

        <div class="row">
          <div class="col-12" align="center">
            <h4>Mohon Tunggu, Memproses Pengeditan....</h4>    
          </div>
          <div class="col-12" align="center">
            <div class="spinner-border text-warning"></div>
          </div>
        </div>

      </div>

      <!-- Modal footer -->


    </div>
  </div>
</div> 


<!-- The Modal HAPUS CUST -->
<div class="modal fade" id="myModalhapuscust">
  <div class="modal-dialog" >
    <div class="modal-content" id="modal_overlay">

      <!-- Modal Header -->
      <div class="modal-header">
        <h4 class="modal-title">HAPUS Pelanggan</h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body" id="modal-body2">


        <form id="modalhapuscust" action="<?php echo e(URL::to('/')); ?>/funcHapusPelanggan" method="get">
          <div class="form-group">
            <div class="row">
              <div class="col-4">
                <label for="customerid">ID Pelanggan</label>
                <input type="text" class="form-control" id="customerid_hapus" name="customerid_hapus" readonly="">    
              </div> 
              <div class="col-8">
                <label for="editnama">Nama</label>
                <input type="text" class="form-control" id="hapusnama" name="hapusnama">    
                <input type="text" name="hapusurl" id="hapusurl" style="visibility: hidden;">
              </div>  
            </div>
          </div>

            <div class="row">

                <div class="col-md-12" align="center">

                    <button type="submit" id="simpan_button" class="btn btn-danger" style="margin-top: 25px" >HAPUS</button>
                    
                </div>
                
            </div>

          
        </form>
      </div>




      <div class="modal-body" id="modal-body2" style="display: none;">

        <div class="row">
          <div class="col-12" align="center">
            <h4>Mohon Tunggu, Memproses Pengeditan....</h4>    
          </div>
          <div class="col-12" align="center">
            <div class="spinner-border text-warning"></div>
          </div>
        </div>

      </div>

      <!-- Modal footer -->


    </div>
  </div>
</div> 

              <script type="text/javascript"> //check if page fully loaded

                window.addEventListener('load', function () { // check if page fully loaded
                  // alert("It's loaded!")
                  var x = document.getElementsByClassName("btn_status_bayar");
                  // console.log(x);
                  for (var i = 0; i < x.length; i++) {
                    x[i].disabled = false;
                  }
                  checkPage();
                  document.getElementById("tahun"+<?php echo e($_GET['tahun']); ?>).selected = "selected";
                })

              </script>

              <script type="text/javascript">

                function getDetailPembayaran(customer_id, nama, bulan, tahun, speed, nominaltagihan){

                  document.getElementById("customerid").value = customer_id;
                  document.getElementById("bayarnama").value = nama;
                  document.getElementById("bayarbulan").value = bulan;
                  document.getElementById("bayartahun").value = tahun;
                  document.getElementById("bayarspeed").value = speed;
                  document.getElementById("bayarnominaltagihan").value = nominaltagihan;
                }

                function changeBayar(value){

                  if (value == 0) {
                    console.log("proses bayar");
                    document.getElementById("modal-body1").style.display = "none";
                    document.getElementById("modal-body2").style.display = "";
                    postTidakBayar();

                  }else if (value == 1) {
                    console.log("proses bayar");
                    document.getElementById("modal-body1").style.display = "none";
                    document.getElementById("modal-body2").style.display = "";
                    postBayar();
                  } 

                }

                function postBayar (){

                  var str = $( "#modalbayar" ).serializeArray();
                  // console.log(str);
                  var cust_id = str[0].value;
                  var bulan = str[4].value;
                  $.ajaxSetup({
                    url: "<?php echo e(url('postbayar')); ?>",
                    type: "post",
                    data:{ 
                      "customer_id":str[0].value,
                      "bulan":str[4].value,
                      "tahun":str[5].value,
                      "nominal":100000
                    },
                    headers: {
                      'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    success: function(result){

                        document.getElementById("modal-body1").style.display = "";
                        document.getElementById("modal-body2").style.display = "none";
                        document.getElementById(cust_id+"_"+bulan).classList.add("btn-success");
                        document.getElementById(cust_id+"_"+bulan).classList.remove("btn-danger");
                        document.getElementById(cust_id+"_"+bulan).innerHTML = "Sudah Bayar";
                        document.getElementById(cust_id+"_"+bulan).value = 1;
                        document.getElementById("printinv_button").disabled = false;
                      }
                    });
                  $.ajax();

                }

                function postTidakBayar(){

                  var str = $( "#modalbayar" ).serializeArray();
                  // console.log(str);
                  var cust_id = str[0].value;
                  var bulan = str[4].value;
                  $.ajaxSetup({
                    url: "<?php echo e(url('posttidakbayar')); ?>",
                    type: "post",
                    data:{ 
                          "customer_id":str[0].value,
                          "bulan":str[4].value,
                          "tahun":str[5].value,
                        },
                        headers: {
                          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        },
                        success: function(result){
                            document.getElementById("modal-body1").style.display = "";
                            document.getElementById("modal-body2").style.display = "none";
                            document.getElementById(cust_id+"_"+bulan).classList.add("btn-danger");
                            document.getElementById(cust_id+"_"+bulan).classList.remove("btn-success");
                            document.getElementById(cust_id+"_"+bulan).innerHTML = "Belum Bayar";
                            document.getElementById(cust_id+"_"+bulan).value = 0;
                            document.getElementById("printinv_button").disabled = true;
                        }
                      });
                  $.ajax();

                }

              </script>


              <script type="text/javascript">

                var searchField = document.getElementById("fieldCariNama");

                 searchField.addEventListener("keyup", function(event) {
                    // Number 13 is the "Enter" key on the keyboard
                    if (event.keyCode === 13) {
                      // Cancel the default action, if needed
                      event.preventDefault();
                      // Trigger the button element with a click
                      // document.getElementById("myBtn").click();
                      searchNama();

                    }
                  });

                function reloadPage(){
                  location.reload();
                }

                function cekradio(){
                  var str = $( "#modalbayar" ).serializeArray();
                  console.log(str);
                  var cust_id = str[0].value;
                  var bulan = str[4].value;
                  if (document.getElementById(cust_id+"_"+bulan).value == 0) {
                    document.getElementById("radio_belum_bayar").checked = true;  
                    document.getElementById("printinv_button").disabled = true;
                  }else if(document.getElementById(cust_id+"_"+bulan).value == 1) {
                    document.getElementById("radio_sudah_bayar").checked = true;  
                    document.getElementById("printinv_button").disabled = false;
                  }
                  
                }

                function print_invoice(){

                     var str = $( "#modalbayar" ).serializeArray();
                     console.log(str);
                     window.open('<?php echo e(URL::to('/')); ?>/print_invoice?nama='+str[1].value+'&nomor='+str[0].value+'&id='+str[0].value+'&bulan='+str[4].value+'&tahun='+str[5].value);
                }

                function checkPage(){
                  if ( <?php echo $getpage ?> == 0) {
                    console.log('disabled prev');
                    document.getElementById("previous_button").classList.add("disabled");  
                  }else if( <?php echo $getpage ?> == <?php echo e($pagecount); ?>){
                    console.log('disabled next');
                    document.getElementById("next_button").classList.add("disabled");  
                  }

                  document.getElementById("page<?php  echo $getpage ?>").classList.add("active");  
                }

                function searchNama(){
                  console.log('testing');
                  var searchValue = document.getElementById("fieldCariNama").value;
                  var searchtype = document.getElementById("searchtype");
                  // window.alert(searchtype.value);
                  window.location.replace('<?php echo e(URL::to('/')); ?>/dashboard?tahun=<?php echo e($_GET['tahun']); ?>&page=0&search='+searchValue+'&searchtype='+searchtype.value);

                }

                function changeTahun(){
                  var e = document.getElementById("optTahun");
                  var strUser = e.options[e.selectedIndex].value;
                  window.location.replace('<?php echo e(URL::to('/')); ?>/dashboard?tahun='+strUser+'&page=0&search=<?php echo e($getsearch); ?>&searchtype=<?php echo e($getsearchtype); ?>');
                }

                function editcustomer(customer_id, nama, speed, nominal,telepon,tgl_pasang,alamat){

                  console.log(customer_id+ nama + speed + nominal);
                  document.getElementById("customerid_edit").value = customer_id;
                  document.getElementById("editnama").value = nama;
                  document.getElementById("editspeed").value = speed;
                  document.getElementById("editnominaltagihan").value = nominal;
                  document.getElementById("edittelepon").value = telepon;
                  document.getElementById("edittglpasang").value = tgl_pasang;
                  document.getElementById("editalamat").value = alamat;
                  document.getElementById("editurl").value = window.location.href;

                } 

                 function hapuscustomer(customer_id, nama){

                  // console.log(customer_id+ nama + speed + nominal);
                  document.getElementById("customerid_hapus").value = customer_id;
                  document.getElementById("hapusnama").value = nama;

                  document.getElementById("hapusurl").value = window.location.href;

                } 

                function update_cust(customer_id){
                  location.href();
                }

                // function simpan_perubahan(){

                //    var str = $( "#modaleditcust" ).serializeArray();
                //   console.log(str);
                //   $.ajaxSetup({
                //     url: "<?php echo e(url('funcEditPelanggan')); ?>",
                //     type: "post",
                //     data:{ 
                //           "customer_id":str[0].value,
                //           "nama":str[1].value,
                //           "speed":str[2].value,
                //           "nominal":str[3].value
                //         },
                //         headers: {
                //           'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                //         },
                //         success: function(result){
                //           console.log(result);
                //         }
                //       });
                //   $.ajax();


                // }

              </script>




             <?php $__env->endSlot(); ?>

           <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da)): ?>
<?php $component = $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da; ?>
<?php unset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da); ?>
<?php endif; ?>
<?php /**PATH /home/distudi1/domains/distudiomalang.my.id/public_html/baynet/resources/views/dashboard.blade.php ENDPATH**/ ?>