angular.module("RdmApp").controller("bobotCtrl",["$scope","$rootScope","common","DTOptionsBuilder","DTColumnBuilder","$http","$q","ApiServer",function(t,a,e,i,s,o,l,n){void 0!==a.datakelas[a.selectKelas]?void 0!==a.datakelas[a.selectKelas].bahanajar?a.bahanajar=a.datakelas[a.selectKelas].bahanajar:a.datakelas[a.selectKelas].timeline=[]:(a.posts=[],a.datakelas[a.selectKelas]=[],a.datakelas[a.selectKelas].bahanajar=[]),t.dtInstance={},t.currPg=0,t.recordsDisplay=0,t.savedataBobot=function(){$.blockUI({}),n.post("guru/kelas/savebobot/"+a.selectKelas,a.bobot,(function(t){$.unblockUI({}),null!==t&&t.success?(a.getbobotkelas(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):null==t?Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:"Data Gagal Disimpan"}):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})}))},t.dtOptions=i.newOptions().withOption("searching",!0).withOption("stateSave",!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){a.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("paging",!0).withOption("processing",!0).withOption("AutoWidth",!0).withOption("responsive",!0).withOption("columnDefs",[{width:"2%",targets:0},{width:"10%",targets:-2},{width:"16%",targets:-1},{responsivePriority:1,targets:2},{responsivePriority:2,targets:-1}]).withOption("drawCallback",(function(a){if(a.aoData.length>0){var e=this.api().page.info();t.currPg=e.page,t.recordsDisplay=e.recordsDisplay}$(".lazy").Lazy();try{t.$apply()}catch(t){}})).withPaginationType("full_numbers")}]);