Example #1
0
 function updateGenInfo()
 {
     $tableName = 'HS_HR_GENINFO';
     $arrRecordsList[0] = "'001'";
     $arrRecordsList[1] = "'" . $this->getGenInfoKeys() . "'";
     $arrRecordsList[2] = "'" . $this->getGenInfoValues() . "'";
     $arrFieldList[0] = 'CODE';
     $arrFieldList[1] = 'GENINFO_KEYS';
     $arrFieldList[2] = 'GENINFO_VALUES';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $compStruct_newTitle = explode("|", $arrRecordsList[2]);
     $compStruct_newTitle = substr($compStruct_newTitle[0], 1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     $compStructObj = new CompStruct();
     $compStructObj->setaddStr($compStruct_newTitle);
     $compStructObj->setid(1);
     $compStructObj->setlocation('');
     $compStructObj->updateCompStruct();
     return $message2;
 }
Example #2
0
 public function updateSalaryGrades()
 {
     if ($this->isSalaryGradeNameExists($this->getSalGrdDesc())) {
         throw new SalaryGradesException('Salary grade name already exists', SalaryGradesException::UNKNOWN_EXCEPTION);
         // Error code is set to comply with ViewController.php
     }
     $this->getSalGrdId();
     $arrRecordsList[0] = "'" . $this->getSalGrdId() . "'";
     $arrRecordsList[1] = "'" . $this->getSalGrdDesc() . "'";
     $arrFieldList[0] = 'SAL_GRD_CODE';
     $arrFieldList[1] = 'SAL_GRD_NAME';
     $tableName = 'HS_PR_SALARY_GRADE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
 function updateMembershipInfo()
 {
     if ($this->_isDuplicateName(true)) {
         throw new MembershipInfoException("Duplicate name", 1);
     }
     $this->getMembershipInfoId();
     $arrRecordsList[0] = "'" . $this->getMembershipInfoId() . "'";
     $arrRecordsList[1] = "'" . $this->getMembershipInfoDesc() . "'";
     $arrRecordsList[2] = "'" . $this->getMembershipTypeId() . "'";
     $arrFieldList[0] = 'MEMBSHIP_CODE';
     $arrFieldList[1] = 'MEMBSHIP_NAME';
     $arrFieldList[2] = 'MEMBTYPE_CODE';
     $tableName = 'HS_HR_MEMBERSHIP';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #4
0
 function updateEmpContact()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpStreet1() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpStreet2() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpCity() . "'";
     $arrRecordsList[4] = "'" . $this->getEmpCountry() . "'";
     $arrRecordsList[5] = "'" . $this->getEmpProvince() . "'";
     $arrRecordsList[6] = "'" . $this->getEmpZipCode() . "'";
     $arrRecordsList[7] = "'" . $this->getEmpHomeTelephone() . "'";
     $arrRecordsList[8] = "'" . $this->getEmpMobile() . "'";
     $arrRecordsList[9] = "'" . $this->getEmpWorkTelephone() . "'";
     $arrRecordsList[10] = "'" . $this->getEmpWorkEmail() . "'";
     $arrRecordsList[11] = "'" . $this->getEmpOtherEmail() . "'";
     $tableName = 'HS_HR_EMPLOYEE';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'EMP_STREET1';
     $arrFieldList[2] = 'EMP_STREET2';
     $arrFieldList[3] = 'CITY_CODE';
     $arrFieldList[4] = 'COUN_CODE';
     $arrFieldList[5] = 'PROVIN_CODE';
     $arrFieldList[6] = 'EMP_ZIPCODE';
     $arrFieldList[7] = 'EMP_HM_TELEPHONE';
     $arrFieldList[8] = 'EMP_MOBILE';
     $arrFieldList[9] = 'EMP_WORK_TELEPHONE';
     $arrFieldList[10] = 'EMP_WORK_EMAIL';
     $arrFieldList[11] = 'EMP_OTH_EMAIL';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     //echo $sqlQString;
     //$log = new LogFileWriter();
     //$log->writeLogDB($sqlQString);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #5
0
 function updateEmpBasSal()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpSalGrdCode() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpCurrCode() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpBasSal() . "'";
     $arrRecordsList[4] = empty($this->payPeriod) ? "null" : "'" . $this->payPeriod . "'";
     $tableName = 'hs_hr_emp_basicsalary';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'SAL_GRD_CODE';
     $arrFieldList[2] = 'CURRENCY_ID';
     $arrFieldList[3] = 'EBSAL_BASIC_SALARY';
     $arrFieldList[4] = 'PAYPERIOD_CODE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(2);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #6
0
 private function _update()
 {
     $fields[0] = self::DB_FIELD_ACTIVITY_ID;
     $fields[1] = self::DB_FIELD_NAME;
     $fields[2] = self::DB_FIELD_PROJECT_ID;
     $fields[3] = self::DB_FIELD_DELETED;
     $values[0] = "'{$this->id}'";
     $values[1] = "'{$this->name}'";
     $values[2] = "'{$this->projectId}'";
     $values[3] = "'" . intval($this->deleted) . "'";
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = self::TABLE_NAME;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $fields;
     $sqlBuilder->arr_updateRecList = $values;
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new ProjectActivityException("Update failed. SQL={$sql}");
     }
 }
 /**
  * Update existing CustomExport data
  */
 private function _update()
 {
     $fields[0] = self::DB_FIELDS_ID;
     $fields[1] = self::DB_FIELDS_NAME;
     $fields[2] = self::DB_FIELDS_FIELDS;
     $fields[3] = self::DB_FIELDS_HEADINGS;
     $values[0] = $this->id;
     $values[1] = "'{$this->name}'";
     $values[2] = "'" . implode(",", $this->assignedFields) . "'";
     $values[3] = empty($this->headings) ? "''" : "'" . implode(",", $this->headings) . "'";
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = self::TABLE_NAME;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $fields;
     $sqlBuilder->arr_updateRecList = $values;
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new CustomExportException("Update failed. SQL={$sql}", CustomExportException::DB_EXCEPTION);
     }
 }
Example #8
0
 function updateEducation()
 {
     $this->getEduId();
     $arrRecordsList[0] = "'" . $this->getEduId() . "'";
     $arrRecordsList[1] = "'" . $this->getEduUni() . "'";
     $arrRecordsList[2] = "'" . $this->getEduDeg() . "'";
     $arrFieldList[0] = 'EDU_CODE';
     $arrFieldList[1] = 'EDU_UNI';
     $arrFieldList[2] = 'EDU_DEG';
     $tableName = 'HS_HR_EDUCATION';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #9
0
 /**
  * Update existing object
  */
 private function _update()
 {
     $fields[0] = self::DB_FIELD_ID;
     $fields[1] = self::DB_FIELD_NAME;
     $fields[2] = self::DB_FIELD_DESC;
     $fields[3] = self::DB_FIELD_DUTIES;
     $values[0] = $this->id;
     $values[1] = "'{$this->name}'";
     $values[2] = "'{$this->desc}'";
     $values[3] = "'{$this->duties}'";
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = self::TABLE_NAME;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $fields;
     $sqlBuilder->arr_updateRecList = $values;
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new JobSpecException("Update failed. SQL={$sql}", JobSpecException::DB_ERROR);
     }
     return $this->id;
 }
Example #10
0
 function updateEmpEducation()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEduCode() . "'";
     $arrRecordsList[2] = "'" . $this->getEduMajor() . "'";
     $arrRecordsList[3] = "'" . $this->getEduYear() . "'";
     $arrRecordsList[4] = "'" . $this->getEduGPA() . "'";
     $arrRecordsList[5] = $this->getEduStartDate();
     // Quotes removed to accept null values
     $arrRecordsList[6] = $this->getEduEndDate();
     $tableName = 'HS_HR_EMP_EDUCATION';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'EDU_CODE';
     $arrFieldList[2] = 'EDU_MAJOR';
     $arrFieldList[3] = 'EDU_YEAR';
     $arrFieldList[4] = 'EDU_GPA';
     $arrFieldList[5] = 'EDU_START_DATE';
     $arrFieldList[6] = 'EDU_END_DATE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     //echo  $sqlQString;
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
 function updateEEOJobCat()
 {
     if ($this->_isDuplicateName(true)) {
         throw new EEOJobCatException("Duplicate name", 1);
     }
     $this->getEEOJobCatId();
     $arrRecordsList[0] = "'" . $this->getEEOJobCatId() . "'";
     $arrRecordsList[1] = "'" . $this->getEEOJobCatDesc() . "'";
     $arrFieldList[0] = 'EEC_CODE';
     $arrFieldList[1] = 'EEC_DESC';
     $tableName = 'HS_HR_EEC';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #12
0
 function updateLocation()
 {
     $this->getLocationId();
     $arrRecordsList[0] = "'" . $this->getLocationId() . "'";
     $arrRecordsList[1] = "'" . $this->getLocationName() . "'";
     $arrRecordsList[2] = "'" . $this->getLocationCountry() . "'";
     $arrRecordsList[3] = "'" . $this->getLocationState() . "'";
     $arrRecordsList[4] = "'" . $this->getLocationCity() . "'";
     $arrRecordsList[5] = "'" . $this->getLocationAddress() . "'";
     $arrRecordsList[6] = "'" . $this->getLocationZIP() . "'";
     $arrRecordsList[7] = "'" . $this->getLocationPhone() . "'";
     $arrRecordsList[8] = "'" . $this->getLocationFax() . "'";
     $arrRecordsList[9] = "'" . $this->getLocationComments() . "'";
     $arrFieldList[0] = 'LOC_CODE';
     $arrFieldList[1] = 'LOC_NAME';
     $arrFieldList[2] = 'LOC_COUNTRY';
     $arrFieldList[3] = 'LOC_STATE';
     $arrFieldList[4] = 'LOC_CITY';
     $arrFieldList[5] = 'LOC_ADD';
     $arrFieldList[6] = 'LOC_ZIP';
     $arrFieldList[7] = 'LOC_PHONE';
     $arrFieldList[8] = 'LOC_FAX';
     $arrFieldList[9] = 'LOC_COMMENTS';
     $tableName = 'HS_HR_LOCATION';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #13
0
 function updateEmpMembership()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpMemCode() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpMemTypeCode() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpMemSubOwn() . "'";
     $arrRecordsList[4] = "'" . $this->getEmpMemSubAmount() . "'";
     $arrRecordsList[5] = $this->getEmpMemCommDat();
     // Quotes removed to accept null values
     $arrRecordsList[6] = $this->getEmpMemRenDat();
     $tableName = 'HS_HR_EMP_MEMBER_DETAIL';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'MEMBSHIP_CODE';
     $arrFieldList[2] = 'MEMBTYPE_CODE';
     $arrFieldList[3] = 'EMEMB_SUBSCRIPT_OWNERSHIP';
     $arrFieldList[4] = 'EMEMB_SUBSCRIPT_AMOUNT';
     $arrFieldList[5] = 'EMEMB_COMMENCE_DATE';
     $arrFieldList[6] = 'EMEMB_RENEWAL_DATE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(2);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #14
0
 /**
  * Update existing object
  */
 private function _update()
 {
     // Update name if not set.
     if (empty($this->name)) {
         $this->_updateName();
     }
     $fields[0] = self::DB_FIELD_ID;
     $fields[1] = self::DB_FIELD_EMP_NUMBER;
     $fields[2] = self::DB_FIELD_CODE;
     $fields[3] = self::DB_FIELD_NAME;
     $fields[4] = self::DB_FIELD_START_DATE;
     $fields[5] = self::DB_FIELD_END_DATE;
     $values[0] = $this->id;
     $values[1] = $this->empNumber;
     $values[2] = $this->code;
     $values[3] = isset($this->name) ? $this->name : 'null';
     $values[4] = $this->startDate;
     $values[5] = isset($this->endDate) ? $this->endDate : 'null';
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = $this->tableName;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $fields;
     $sqlBuilder->arr_updateRecList = $values;
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new EmpHistoryException("Update failed. SQL={$sql}", EmpHistoryException::DB_ERROR);
     }
     return $this->id;
 }
Example #15
0
 /**
  * To update the records reuse this function
  */
 private function updateRecord($tableName, $arrFieldList, $arrRecordsList)
 {
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(0);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #16
0
 function updateEmpLang()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpLangCode() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpLangType() . "'";
     $arrRecordsList[3] = "'" . $this->empLangRatGrd . "'";
     $tableName = 'HS_HR_EMP_LANGUAGE';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'LANG_CODE';
     $arrFieldList[2] = 'ELANG_TYPE';
     $arrFieldList[3] = 'COMPETENCY';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(2);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #17
0
 function updateEmpLicenses()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpLicCode() . "'";
     $arrRecordsList[2] = $this->getempLicDat();
     // Quotes removed to accept null values
     $arrRecordsList[3] = $this->getempLicrenewalDat();
     $tableName = 'HS_HR_EMP_LICENSES';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'LICENSES_CODE';
     $arrFieldList[2] = 'LICENSES_DATE';
     $arrFieldList[3] = 'LICENSES_RENEWAL_DATE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #18
0
 function updateEmpWorkExp()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpExpSeqNo() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpExpEmployer() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpExpJobTitle() . "'";
     $arrRecordsList[4] = $this->getEmpExpFromDate();
     // Quotes removed to allow null values
     $arrRecordsList[5] = $this->getEmpExpToDate();
     $arrRecordsList[6] = "'" . $this->getEmpExpComments() . "'";
     $arrRecordsList[7] = "'" . $this->getEmpExpInternal() . "'";
     $tableName = 'HS_HR_EMP_WORK_EXPERIENCE';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'EEXP_SEQNO';
     $arrFieldList[2] = 'EEXP_EMPLOYER';
     $arrFieldList[3] = 'EEXP_JOBTIT';
     $arrFieldList[4] = 'EEXP_FROM_DATE';
     $arrFieldList[5] = 'EEXP_TO_DATE';
     $arrFieldList[6] = 'EEXP_COMMENTS';
     $arrFieldList[7] = 'EEXP_INTERNAL';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #19
0
 function updateEmpBasSal($object = null)
 {
     $tableName = 'hs_hr_emp_basicsalary';
     $sql_builder = new SQLQBuilder();
     if (is_array($object)) {
         $fields[0] = 'emp_number';
         $fields[1] = 'sal_grd_code';
         $fields[2] = 'currency_id';
         $fields[3] = 'ebsal_basic_salary';
         $fields[4] = 'payperiod_code';
         $newObject = $object['new'];
         $values[0] = $newObject->getEmpId();
         $values[1] = "'" . $newObject->getEmpSalGrdCode() . "'";
         $values[2] = "'" . $newObject->getEmpCurrCode() . "'";
         $values[3] = "'" . $newObject->getEmpBasSal() . "'";
         $values[4] = empty($newObject->payPeriod) ? "null" : $newObject->payPeriod;
         $oldObject = $object['old'];
         $updateCondition[] = "SAL_GRD_CODE = '" . $oldObject->getEmpSalGrdCode() . "'";
         $updateCondition[] = "CURRENCY_ID = '" . $oldObject->getEmpCurrCode() . "'";
         $sqlQString = $sql_builder->simpleUpdate($tableName, $fields, $values, $updateCondition, false);
     } else {
         $sql_builder->table_name = $tableName;
         $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
         $arrRecordsList[1] = "'" . $this->getEmpSalGrdCode() . "'";
         $arrRecordsList[2] = "'" . $this->getEmpCurrCode() . "'";
         $arrRecordsList[3] = "'" . $this->getEmpBasSal() . "'";
         $arrRecordsList[4] = empty($this->payPeriod) ? "null" : "'" . $this->payPeriod . "'";
         $sql_builder->flg_update = 'true';
         $sql_builder->arr_update = $arrFieldList;
         $sql_builder->arr_updateRecList = $arrRecordsList;
         $sqlQString = $sql_builder->addUpdateRecord1(2);
     }
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
 function updateNationalityInfo()
 {
     if ($this->_isDuplicateName(true)) {
         throw new NationalityInfoException("Duplicate name", 1);
     }
     $this->getNationalityInfoId();
     $arrRecordsList[0] = "'" . $this->getNationalityInfoId() . "'";
     $arrRecordsList[1] = "'" . $this->getNationalityInfoDesc() . "'";
     $arrFieldList[0] = 'NAT_CODE';
     $arrFieldList[1] = 'NAT_NAME';
     $tableName = 'HS_HR_NATIONALITY';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #21
0
 function updateEmpDep()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpDSeqNo() . "'";
     $arrRecordsList[2] = "'" . mysql_real_escape_string($this->getEmpDepName()) . "'";
     $arrRecordsList[3] = "'" . mysql_real_escape_string($this->getEmpDepRel()) . "'";
     $tableName = 'HS_HR_EMP_DEPENDENTS';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'ED_SEQNO';
     $arrFieldList[2] = 'ED_NAME';
     $arrFieldList[3] = 'ED_RELATIONSHIP';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #22
0
 /**
  * Update the custom field
  */
 public function updateCustomField()
 {
     $fields[0] = self::DB_FIELDS_NUM;
     $fields[1] = self::DB_FIELDS_NAME;
     $fields[2] = self::DB_FIELDS_TYPE;
     $fields[3] = self::DB_FIELDS_EXTRA_DATA;
     $values[0] = $this->fieldNumber;
     $values[1] = "'{$this->name}'";
     $values[2] = "'{$this->fieldType}'";
     $values[3] = "'{$this->extraData}'";
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = self::TABLE_NAME;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $fields;
     $sqlBuilder->arr_updateRecList = $values;
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new CustomFieldsException("Update failed. SQL={$sql}");
     }
 }
Example #23
0
 function updateJobTitles()
 {
     $arrRecordsList[0] = "'" . $this->getJobId() . "'";
     $arrRecordsList[1] = "'" . $this->getJobName() . "'";
     $arrRecordsList[2] = "'" . $this->getJobDesc() . "'";
     $arrRecordsList[3] = "'" . $this->getJobComm() . "'";
     $arrRecordsList[4] = "'" . $this->getJobSalGrd() . "'";
     $arrRecordsList[5] = isset($this->jobSpecId) ? $this->jobSpecId : 'null';
     $arrFieldList[0] = 'JOBTIT_CODE';
     $arrFieldList[1] = 'JOBTIT_NAME';
     $arrFieldList[2] = 'JOBTIT_DESC';
     $arrFieldList[3] = 'JOBTIT_COMM';
     $arrFieldList[4] = 'SAL_GRD_CODE';
     $arrFieldList[5] = self::DB_FIELD_JOBSPEC_ID;
     $tableName = 'HS_HR_JOB_TITLE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #24
0
 /**
  * Update existing object
  */
 private function _update()
 {
     $values = $this->_getFieldValuesAsArray();
     $sqlBuilder = new SQLQBuilder();
     $sqlBuilder->table_name = self::TABLE_NAME;
     $sqlBuilder->flg_update = 'true';
     $sqlBuilder->arr_update = $this->dbFields;
     $sqlBuilder->arr_updateRecList = $this->_getFieldValuesAsArray();
     $sql = $sqlBuilder->addUpdateRecord1(0);
     $conn = new DMLFunctions();
     $result = $conn->executeQuery($sql);
     // Here we don't check mysql_affected_rows because update may be called
     // without any changes.
     if (!$result) {
         throw new JobApplicationException("Update failed. SQL={$sql}", JobApplicationException::DB_ERROR);
     }
     return $this->id;
 }
Example #25
0
 function updateEmpSkill()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpSkillCode() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpYearsOfExp() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpComments() . "'";
     $tableName = 'HS_HR_EMP_SKILL';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'SKILL_CODE';
     $arrFieldList[2] = 'YEARS_OF_EXP';
     $arrFieldList[3] = 'COMMENTS';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     //echo  $sqlQString;
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #26
0
 function updateEmpAtt()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpAttId() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpAttDesc() . "'";
     $tableName = 'HS_HR_EMP_ATTACHMENT';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'EATTACH_ID';
     $arrFieldList[2] = 'EATTACH_DESC';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1, false);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #27
0
 function updateJobTitEmpStat()
 {
     $arrRecordsList[0] = "'" . $this->getJobTitId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpStatId() . "'";
     $arrFieldList[0] = 'JOBTIT_CODE';
     $arrFieldList[1] = 'ESTAT_CODE';
     $tableName = 'HS_HR_JOBTIT_EMPSTAT';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #28
0
 function updateSalaryGrades()
 {
     $this->getSalGrdId();
     $arrRecordsList[0] = "'" . $this->getSalGrdId() . "'";
     $arrRecordsList[1] = "'" . $this->getSalGrdDesc() . "'";
     $arrFieldList[0] = 'SAL_GRD_CODE';
     $arrFieldList[1] = 'SAL_GRD_NAME';
     $tableName = 'HS_PR_SALARY_GRADE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1();
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
 function updateConExt()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpConExtId() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpConExtStartDat() . "'";
     $arrRecordsList[3] = "'" . $this->getEmpConExtEndDat() . "'";
     $tableName = 'HS_HR_EMP_CONTRACT_EXTEND';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'ECON_EXTEND_ID';
     $arrFieldList[2] = 'ECON_EXTEND_START_DATE';
     $arrFieldList[3] = 'ECON_EXTEND_END_DATE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }
Example #30
0
 function updateEmpPP()
 {
     $arrRecordsList[0] = "'" . $this->getEmpId() . "'";
     $arrRecordsList[1] = "'" . $this->getEmpPPSeqNo() . "'";
     $arrRecordsList[2] = "'" . $this->getEmpPPNo() . "'";
     $arrRecordsList[3] = $this->getEmpPPIssDat();
     $arrRecordsList[4] = $this->getEmpPPExpDat();
     $arrRecordsList[5] = "'" . $this->getEmpPPComment() . "'";
     $arrRecordsList[6] = "'" . $this->getEmppassportflag() . "'";
     $arrRecordsList[7] = "'" . $this->getEmpI9Status() . "'";
     $arrRecordsList[8] = $this->getEmpI9ReviewDat();
     $arrRecordsList[9] = "'" . $this->getEmpNationality() . "'";
     $tableName = 'HS_HR_EMP_PASSPORT';
     $arrFieldList[0] = 'EMP_NUMBER';
     $arrFieldList[1] = 'EP_SEQNO';
     $arrFieldList[2] = 'EP_PASSPORT_NUM';
     $arrFieldList[3] = 'EP_PASSPORTISSUEDDATE';
     $arrFieldList[4] = 'EP_PASSPORTEXPIREDATE';
     $arrFieldList[5] = 'EP_COMMENTS';
     $arrFieldList[6] = 'EP_PASSPORT_TYPE_FLG';
     $arrFieldList[7] = 'EP_I9_STATUS';
     $arrFieldList[8] = 'EP_I9_REVIEW_DATE';
     $arrFieldList[9] = 'COU_CODE';
     $sql_builder = new SQLQBuilder();
     $sql_builder->table_name = $tableName;
     $sql_builder->flg_update = 'true';
     $sql_builder->arr_update = $arrFieldList;
     $sql_builder->arr_updateRecList = $arrRecordsList;
     $sqlQString = $sql_builder->addUpdateRecord1(1);
     $dbConnection = new DMLFunctions();
     $message2 = $dbConnection->executeQuery($sqlQString);
     //Calling the addData() function
     return $message2;
 }