%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
/** ScheduleVisit **/ angular.module('MetronicApp').controller("ScheduleVisit", function($scope, $http, $state, $location, $timeout, Auth){ var CR=this; CR.sdata={p:1}; CR.lists=function(p){ show_loader(); CR.sdata.p=p?p:1; $http({url: API_URL+'schedule/lists', params:CR.sdata}).success( function(res){ //res=Auth.checkRes(res); CR.result=res.result; CR.page=res.page; } ).error(function(res){showHttpErr(res);}); } CR.exportLists=function(){ location.href=API_URL+'schedule/exportLists?'+(CR.sdata); } CR.detail=function(id){ CR.yourComment=''; show_loader(); $http({url: API_URL+'schedule/detail/'+id}).success( function(res){ //res=Auth.checkRes(res); CR.dtl=res.dtl; showModal($("#dtlModal"), true); } ).error(function(res){showHttpErr(res);}); } CR.delete=function(id){ if(!confirm("Are you sure to delete?")){ return; } show_loader(); $http({url: API_URL+'schedule/delete', method:'POST', data:(( {id:id} ))}).success( function(res){ //res=Auth.checkRes(res); if(res.success=='T'){ show_alert_msg(res.msg); var pg=CR.sdata.p; if(CR.page.total==1){ pg=1; } CR.lists(pg); }else{ show_alert_msg(res.msg, 'E'); } } ).error(function(res){showHttpErr(res);}); } /** Venues */ CR.sdataV={}; CR.openVForm=function(dtl){ hide_form_errors($("#vForm")); $("#vForm").find('[type="file"]').val(''); CR.vData=dtl?dtl:{status:'1', id:''}; showModal($("#vFormModal"), true); } CR.listVenues=function(){ show_loader(); $http({url: API_URL+'schedule/venues', params:CR.sdataV}).success( function(res){ //res=Auth.checkRes(res); CR.venues=res.venues; } ).error(function(res){showHttpErr(res);}); } CR.saveVenue=function(){ var frm=$("#vForm"); hide_form_errors(frm); var formData=new FormData(frm[0]); show_loader(); $http({url:API_URL+'schedule/saveVenue', method:'POST', data:(formData), headers:{'Content-Type': undefined}}).success( function(res) { //res=Auth.checkRes(res); if(res.success=='T'){ show_alert_msg(res.msg); CR.listVenues(); hideModal($("#vFormModal")); }else{ show_form_errors(res.errors, frm); show_alert_msg(res.msg, 'E'); } } ).error(function(res){showHttpErr(res);}); } CR.editVenue=function(id){ show_loader(); $http({url: API_URL+'schedule/venueDetail/'+id}).success( function(res){ hide_loader(); //res=Auth.checkRes(res); CR.openVForm(res); } ).error(function(res){showHttpErr(res);}); } CR.deleteVenue=function(id){ if(!confirm("Are you sure to delete?")){ return; } show_loader(); $http({url: API_URL+'schedule/deleteVenue', method:'POST', data:(( {id:id} ))}).success( function(res){ //res=Auth.checkRes(res); if(res.success=='T'){ show_alert_msg(res.msg); CR.listVenues(); }else{ show_alert_msg(res.msg, 'E'); } } ).error(function(res){showHttpErr(res);}); } /** Init **/ CR.init=function(){ setBsDatepicker(); show_loader(); $http({url: API_URL+'schedule/init'}).success( function(res){ //res=Auth.checkRes(res); CR.result=res.result; CR.page=res.page; CR.venues=res.venues; CR.venuesDD=res.venues; CR.states=res.states; } ).error(function(res){showHttpErr(res);}); } CR.init(); }); //EOF