<!-- Page Heading -->

          <div class="d-sm-flex align-items-center justify-content-between mb-4">

            <h1 class="h3 mb-0 text-gray-800">Rekap Evaluasi Triwulan</h1>

            <!-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> -->

          </div>

          <!-- Content Row -->

          <div class="row">


            <div class="col-xl-12 col-md-12 mb-4">

              <div class="card border-left-primary shadow h-100 py-2">

                <div class="card-body">

                  <div class="row no-gutters align-items-center">

                    <div class="col">

                      <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Rekap Evaluasi Triwulan</div>

                      <div class="h5 mb-0 font-weight-bold text-gray-800 row">

                        <div class="input-group mb-3 input-group-sm col-md-3">

                          <div class="input-group-prepend">

                            <label class="input-group-text" for="periode_thn"><i class="fas fa-calendar-alt"></i></label>

                          </div>

                          <select class="custom-select" id="periode_thn">

                          </select>

                        </div>
                        <div class="input-group mb-3 input-group-sm col-md-3">

                          <div class="input-group-prepend">

                            <label class="input-group-text" for="triwulan"><i class="fas fa-calendar-alt"></i></label>

                          </div>

                          <select class="custom-select" id="triwulan">
                            <option value="all">Semua Triwulan</option>
                            <option value="1">Triwulan 1</option>
                            <option value="2">Triwulan 2</option>
                            <option value="3">Triwulan 3</option>
                            <option value="4">Triwulan 4</option>
                          </select>

                        </div>

                        <div class="col-md-3">

                          <button id="btn-laporan_rekap_evaluasi_pertriwulan_excel_user" class="d-none btn-block d-sm-inline-block btn btn-sm btn-success shadow-sm"><i class="fas fa-file-excel fa-sm text-white-50"></i>&nbsp Export Laporan</button>

                        </div>

                        <div class="col-md-3">

                          <button id="btn-laporan_rekap_evaluasi_pertriwulan_pdf_user" class="d-none btn-block d-sm-inline-block btn btn-sm btn-info shadow-sm"><i class="fas fa-file-excel fa-sm text-white-50"></i>&nbsp Laporan PDF</button>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

              </div>

            </div>



<script type="text/javascript">

$(document).ready(function(){

    var base_url = "<?=base_url()?>";

	/////////////////////////////////////////////////

    var periode_thn_all = function(){

      jQuery.ajax({

        url: base_url+"Periode_thn/data_periode_thn",

        dataType:'json',

        success:function(response){

        	// console.log(response)

        	// alert(JSON.stringify(response))

          var data = response;

          var $id = $('#periode_thn');

          $id.empty();

          $id.append('<option value="" selected>- Pilih Periode Tahun -</option>');

        //   alert(param)

          for (var i = 0; i < data.length; i++) {

            $id.append('<option value="'+data[i].periode_thn+'">' + data[i].periode_thn +'</option>');

          }        

        }            

      });

    }

    periode_thn_all();


    $("#btn-laporan_rekap_evaluasi_pertriwulan_pdf_user").click(function(){
      var periode = $("#periode_thn").val();

      var triwulan = $("#triwulan").val();
      var unit_misioner = $("#unit_misioner").val();

      if (periode == "") {

        Command: toastr["warning"]("Periode Belum Dipilih", "warning");

      }else{

        window.open(base_url+"laporan_rekap_ev_tri/laporan_rekap_evaluasi_pertriwulan_pdf_user/"+periode.replace('/', '-')+"/"+triwulan, "PKA", "fullscreen=yes, scrollbars=yes");

        // window.location = base_url+"Laporan_excel/cetak_excel_dashboard_user/"+periode.replace('/', '-');

      }

    });
    $("#btn-laporan_rekap_evaluasi_pertriwulan_excel_user").click(function(){
      var periode = $("#periode_thn").val();

      var triwulan = $("#triwulan").val();
      var unit_misioner = $("#unit_misioner").val();

      if (periode == "") {

        Command: toastr["warning"]("Periode Belum Dipilih", "warning");

      }else{

        window.location = base_url+"laporan_rekap_ev_tri/laporan_rekap_evaluasi_pertriwulan_excel_user/"+periode.replace('/', '-')+"/"+triwulan;

      }

    });

})

    ////////////////////////////////////////////////

</script>