ShowPaySlip_CAAT.Controller.js 2.33 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
'use strict'

angular.module('EPAYSLIP').controller('ShowPaySlip', ['$scope', '$http', 'EpayslipCtrl', function($scope, $http, EpayslipCtrl){
 	$scope.headerepay = {};
 	$scope.bodyepay= [];
 	$scope.paramlist = {
    gettype: 'showpayslip',
    prgcode: $('input[name="prgcode"]').val(),
    period: $('input[name="period"]').val(),
    months: $('input[name="months"]').val(),
    years: $('input[name="years"]').val(),
    round: $('input[name="round"]').val(),
    salatype: $('input[name="salatype"]').val()
 	};

 	if ($('input[name="authen"]').val() == '1'){
    EpayslipCtrl.manageEpaySlip.query($scope.paramlist).$promise.then(function(data){
     	$scope.headerepay = data.header;
     	$scope.bodyepay = data.body;
     	console.log(data);
    });
 	}

 	$scope.generateDate = function(){
    var nowdate = new Date();
    setCalendarLang(getLang());

    return nowdate.getDate()+" "+getMonthFullName(nowdate.getMonth()+1)+" "+nowdate.getFullYear();
 	}
	$scope.alertbox = {
    tha: '** เงินเดือนถือเป็นความลับระหว่างพนักงานกับสำนักงานฯ ห้ามเปิดเผยกับผู้ใด',
    eng: '** เงินเดือนถือเป็นความลับระหว่างพนักงานกับสำนักงานฯ ห้ามเปิดเผยกับผู้ใด', // ** The infomation is confidential. please do not reveal it to anyone.
    getString : function(){
       if (getLang() == 'tha'){
          return this.tha;
       }else{
          return this.eng;
       }
    }
  }
	$scope.alertbox2 = {
    tha: 'เอกสารนี้เป็นต้นฉบับบจริงที่ออกโดยสำนักงานการบินพลเรือนแห่งประเทศไทย สามารถใช้ทำธุรกรรมได้',
    eng: 'เอกสารนี้เป็นต้นฉบับบจริงที่ออกโดยสำนักงานการบินพลเรือนแห่งประเทศไทย สามารถใช้ทำธุรกรรมได้',
    getString : function(){
       if (getLang() == 'tha'){
          return this.tha;
       }else{
          return this.eng;
       }
    }
  }
}]);