<?php
/*
Author : Nikolius
Email : n1colius.lau@gmail.com
Date : 11-Jul-2015 01:45 PM
*/
require_once $cfg->mValue['docroot'] . "module/sia_setting/business/sia_setting.class.php";
class Pangkat_golongan extends SiaSetting {
   function Pangkat_golongan(&$configObject, $dataProceed) {
      SiaSetting::SiaSetting($configObject, $dataProceed);
      $this->AppendSqlQueries("module/pangkat_golongan/business/pangkat_golongan.sql.php");
   }

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

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

      for ($i=0; $i < count($dataList); $i++) {
         $p = array(
            $dataList[$i]['id_pangkat_gol'],
            $dataList[$i]['kode_gol'],
            $dataList[$i]['nm_pangkat'],
            $dataList[$i]['kode_gol'],
            $dataList[$i]['nm_pangkat']
         );
         $proses = $this->ExecuteUpdateQuery($this->mSqlQueries['syncDataPangGol'], $p);
         if($proses == FALSE) $prosesInsertUpdate = FALSE;
      }

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

?>