public function actionPeriode()
 {
     if (isset($_GET['token'])) {
         if ($_GET['token'] == $this->token) {
             $data['periode'] = PayrollHelper::getCurrentPayPeriode();
             $data['status'] = 'data ditemukan';
             echo json_encode($data);
         }
     }
 }
 public function actionGenerate()
 {
     $model = new GenerateAttendanceForm();
     if (isset($_POST['GenerateAttendanceForm'])) {
         $model->attributes = $_POST['GenerateAttendanceForm'];
         $model->generateEmployeeSalaries();
     } else {
         $model->periode_type = 'current';
     }
     $currentPeriode = PayrollHelper::getCurrentPayPeriode();
     if ($model->periode_type == 'current') {
         if ($model->start_date == '') {
             $model->start_date = $currentPeriode['from'];
         }
         if ($model->end_date == '') {
             $model->end_date = $currentPeriode['to'];
         }
     }
     $this->render("generate", array('model' => $model, 'currentPeriode' => $currentPeriode));
 }