angular.module("RdmApp").controller("absenCtrl",["$scope","$rootScope","common","DTOptionsBuilder","DTColumnBuilder","$http","$q","ApiServer",function(a,i,n,t,s,l,o,e){a.dtInstance={},i.knilai={},i.sakitAll={},i.ijinAll={},i.aplaAll={},a.setsakitAll=function(a){null!==a&&angular.forEach(i.walassiswa,(function(i){i.absen.sakit=a}))},a.setijinAll=function(a){console.log(a),null!==a&&angular.forEach(i.walassiswa,(function(i){i.absen.ijin=a}))},a.setalpaAll=function(a){null!==a&&angular.forEach(i.walassiswa,(function(i){i.absen.alpa=a}))},a.tambahpas=function(){i.knilai.edit=!1,$(".edit-modal").modal("show"),$(".modal-dialog").draggable({handle:".modal-header"})},a.simpanAbsen=function(){i.knilai={},i.knilai.absen=[],angular.forEach(i.walassiswa,(function(a){var n={};n.siswa_id=a.siswa_id,n.sakit=a.absen.sakit,n.ijin=a.absen.ijin,n.alpa=a.absen.alpa,i.knilai.absen.push(n)})),$(".edit-modal").modal("hide"),$.blockUI({}),e.post("guru/walas/saveabsen/"+i.walas,i.knilai,(function(a){$.unblockUI({}),a.success?(i.getwalassiswa(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:a.message}).then((a=>{a.value&&$(".edit-modal").modal("show")}))}))},a.dtOptions=t.newOptions().withOption("searching",!0).withOption("stateSave",!0).withOption("paging",!1).withOption("responsive",!0).withOption("ordering",!1).withOption("processing",!1),a.dtOptions2=t.newOptions().withOption("searching",!0).withOption("stateSave",!0).withOption("paging",!1).withOption("ordering",!1).withOption("processing",!1)}]);