<?php
/*
Author : Nikolius
Email : n1colius.lau@gmail.com
Date : 11-Jul-2015 02:32 PM
*/
require_once $cfg->mValue['docroot'] . "module/sia_setting/business/sia_setting.class.php";
class Penghasilan extends SiaSetting {

   function Penghasilan(&$configObject, $dataProceed) {
      SiaSetting::SiaSetting($configObject, $dataProceed);
      $this->AppendSqlQueries("module/penghasilan/business/penghasilan.sql.php");
   }

   function GetDataPenghasilanForSync(){
      $dataList = $this->GetProperty("DataProceed");

      $this->StartTransaction();
      $prosesInsertUpdate = TRUE;

      for ($i=0; $i < count($dataList); $i++) {
         $p = array(
            $dataList[$i]['id_penghasilan'],
            $dataList[$i]['nm_penghasilan'],
            $dataList[$i]['batas_bawah'],
            $dataList[$i]['batas_atas'],
            $dataList[$i]['nm_penghasilan'],
            $dataList[$i]['batas_bawah'],
            $dataList[$i]['batas_atas']
         );
         $proses = $this->ExecuteUpdateQuery($this->mSqlQueries['syncDataPenghasilan'], $p);
         if($proses == FALSE) $prosesInsertUpdate = FALSE;
      }

      $this->CompleteTransaction($prosesInsertUpdate);
      return $prosesInsertUpdate;
   }
}

?>