angular.module("RdmApp").controller("kelasCtrl",["$scope","$rootScope","common","DTOptionsBuilder","DTColumnBuilder","$http","$q","ApiServer",function(t,e,a,i,l,o,s,n){t.dtInstance={},t.datakelasedit={},t.selectData={},t.selectData.tingkat_id="",t.deletekelas=function(t){Swal.fire({type:"warning",title:"Perhatian",confirmButtonText:"Yes, Hapus!",showCancelButton:!0,html:"Apakah Anda yakin akan menghapus kelas ini?"}).then((a=>{a.value&&($.blockUI({}),n.post("proktor/kelas/delkelas",t,(function(t){$.unblockUI({}),t.success?(e.getdatakelas(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Dihapus",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})})))}))},t.saveeditkelas=function(){$(".edit-modal").modal("hide"),$.blockUI({}),n.post("proktor/kelas/save",t.datakelasedit,(function(t){$.unblockUI({}),t.success?(e.getdatakelas(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message}).then((t=>{t.value&&($(".edit-modal").modal("show"),$(".modal-dialog").draggable({handle:".modal-header"}))}))}))},t.tambahKelas=function(e){t.datakelasedit={},t.datakelasedit.edit=!1},t.editkelas=function(e){t.datakelasedit=e,t.datakelasedit.edit=!0,$(".edit-modal").modal("show"),$(".modal-dialog").draggable({handle:".modal-header"})},t.dtOptions=i.newOptions().withOption("searching",!0).withButtons([{extend:"copy",text:'<i class="fa fa-files-o"></i> Copy',titleAttr:"Copy"},{extend:"pdfHtml5",text:'<i class="fa fa-print" aria-hidden="true"></i> Print',download:"open",exportOptions:{columns:[0,1,2,3]},titleAttr:"Print",customize:function(t){e.customepdf(t,"Absen Siswa","Rapor Digital Madrasah")}},{extend:"excelHtml5",text:'<i class="fa fa-file-text-o"></i> Excel',exportOptions:{columns:[0,2,3]},titleAttr:"Excel"}]).withOption("stateSave",!0).withOption("paging",!0).withOption("processing",!0).withPaginationType("full_numbers")}]);