function update_system_code($dbLink, $key, $value) { $strValues[$key] = $value; $strWhere["id"] = 1; $ret = ebpls_update_data($dbLink, "ebpls_codes_table", $strValues, $strWhere); //print_r(get_db_error()); return $ret; }
/** * View owner data, loads data using owner id as param * */ function update($eaid) { $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[EAID] = $eaid; $ret = ebpls_update_data($this->m_dbLink, EBPLS_LOTPIN_TABLE, $strValues, $strWhere); if ($ret < 0) { return $ret; } else { return $ret; } } else { return -1; } }
function update($admin) { $this->data_elems[EBPLS_ACCT_CODE_UPDATED] = date("Y-m-d H:i:s"); $this->data_elems[EBPLS_UPDATED_BY] = $admin; $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } $strWhere[EBPLS_ACCT_CODE] = $this->data_elems[EBPLS_ACCT_CODE]; $ret = ebpls_update_data($this->m_dbLink, EBPLS_COT_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE EBPLS_COT_TABLE FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE EBPLS_COT_TABLE SUCCESSFULL [{$ret}]"); return $ret; } }
/** * Update owner data **/ function update($occupancy_id) { $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[OCCUPANCY_TYPE_CODE] = $occupancy_id; $ret = ebpls_update_data($this->m_dbLink, EBPLS_OCCUPANCY_TYPE_TABLE, $strValues, $strWhere); if ($ret < 0) { return $ret; } else { return $ret; } } else { return -1; } }
function update($code = NULL) { $this->data_elems[EBPLS_TAX_FEE_DATE_REGISTERED] = date("Y-m-d H:i:s"); $this->data_elems[EBPLS_TAX_FEE_DATE_UPDATED] = date("Y-m-d H:i:s"); foreach ($this->data_elems as $key => $value) { if ($value != "") { $strValues[$key] = $value; } } if ($code) { $strWhere[EBPLS_TAX_FEE_CODE] = $code; } else { $strWhere[EBPLS_TAX_FEE_CODE] = $this->data_elems[EBPLS_TAX_FEE_CODE]; } $ret = ebpls_update_data($this->m_dbLink, EBPLS_TAX_FEE_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE EBPLS_TAX_FEE_TABLEFAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE EBPLS_TAX_FEE_TABLE SUCCESSFULL [{$ret}]"); return $ret; } }
function update($formula_id, $admin) { unset($this->data_elems[EBPLS_FORMULAS_FORMULA_ID]); $this->data_elems[EBPLS_FORMULAS_CREATE_TS] = date("Y-m-d H:i:s"); $this->data_elems[EBPLS_FORMULAS_UPDATE_TS] = date("Y-m-d H:i:s"); $this->data_elems[EBPLS_FORMULAS_ADMIN] = $admin; $obj = $this; unset($obj->err_code); unset($obj->err_mesg); $this->debug("Formulatype : " . $obj->getData(EBPLS_FORMULAS_FORMULA_TYPE)); $this->data_elems[EBPLS_FORMULAS_FORMULA_CLASS] = serialize($obj); foreach ($this->data_elems as $key => $value) { if ($value != "") { $strValues[$key] = $value; } } if ($formula_id) { $strWhere[EBPLS_FORMULAS_FORMULA_ID] = $formula_id; } else { $strWhere[EBPLS_FORMULAS_FORMULA_ID] = $this->data_elems[EBPLS_FORMULAS_FORMULA_ID]; } $ret = ebpls_update_data($this->m_dbLink, EBPLS_FORMULAS_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE FORMULA FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE FORMULA SUCCESSFULL [{$ret}]"); return $ret; } }
/** * Update owner data * * **/ function update($district_code) { $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[DISTRICT_CODE] = $district_code; $ret = ebpls_update_data($this->m_dbLink, EBPLS_DISTRICT_TABLE, $strValues, $strWhere); if ($ret < 0) { return $ret; } else { return $ret; } } else { return -1; } }
function update($fee_id, $admin, $user_level) { $this->debug("update( {$fee_id}, {$admin}, {$user_level} )"); if ($this->loadFeeCodeData() < 0) { $this->setError(-1, "Unable to load fee data with feecode : " . $this->getData(TRANS_FEE_ID)); $this->debug("Unable to load fee data with feecode : " . $this->getData(TRANS_FEE_ID)); return -1; } if ($this->validateData(true) > 0) { $ts = time(); $dt = date("Y-m-d H:i:s", $ts); $this->data_elems[TF_LAST_UPDATED_TS] = $dt; $this->data_elems[TF_LAST_UPDATED_BY] = $creator; $this->computeTaxTotalAmounDue(); unset($this->data_elems[TF_TAX_FORMULA]); $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } $strWhere[TF_FEE_ID] = $fee_id; $ret = ebpls_update_data($this->m_dbLink, TF_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("TF UPDATE ERROR : {$ret}"); $this->setError(-1, "TF UPDATE ERROR : {$ret}"); return $ret; } else { $this->debug("TF UPDATE OK : {$ret}"); return $ret; } } else { $this->debug("TF UPDATE TRANS REQ FAILED : {$ret}"); $this->setError(-1, "TF UPDATE TRANS REQ FAILED : {$ret}"); return -1; } }
function assignPermitCode($code) { $strValues[FRANCHISE_PERMIT_CODE] = $code; $strWhere[FRANCHISE_PERMIT_ID] = $this->data_elems[FRANCHISE_PERMIT_ID]; $ret = ebpls_update_data($this->m_dbLink, EBPLS_FRANCHISE_PERMIT_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->setError($ret, $str = get_db_error()); $this->debug("UPDATE FRA PERMIT FAILED [error:{$ret},msg=" . $str . "]"); return $ret; } else { $this->debug("UPDATE FRA PERMIT SUCCESSFULL [{$ret}]"); return $ret; } }
/** * Update owner data * * **/ function update($industry_id) { $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[INDUSTRY_SECTOR_CODE] = $industry_id; $ret = ebpls_update_data($this->m_dbLink, EBPLS_INDUSTRY_SECTOR_TABLE, $strValues, $strWhere); if ($ret < 0) { return $ret; } else { return $ret; } } else { return -1; } }
function updateDueDate($payment_id, $due_date, $remarks, $admin) { $dt = date("Y-m-d H:i:s"); $strValues[TPS_PAYMENT_LAST_UPDATED_BY] = $admin; $strValues[TPS_PAYMENT_LAST_UPDATE_TS] = $dt; $strValues[TPS_PAYMENT_DUE_DATE] = $due_date . " 23:59:59"; $strValues[TPS_PAYMENT_REMARKS] = $remarks; $strWhere[TPS_PAYMENT_ID] = $payment_id; $ret = ebpls_update_data($this->m_dbLink, TPS_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("TPS UPDATE ERROR : {$ret}"); return $ret; } else { $this->debug("TPS UPDATE OK : {$ret}"); return $ret; } }
/** * Update owner data * * **/ function update($owner_id) { $this->data_elems[OWNER_LASTUPDATED] = date("Y-d-m H:i:s"); $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[OWNER_ID] = $owner_id; $ret = ebpls_update_data($this->m_dbLink, EBPLS_OWNER_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE OWNER FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE OWNER SUCCESSFULL [{$ret}]"); return $ret; } } else { $this->debug("CREATE OWNER FAILED [error:{$ret},msg=" . get_db_error() . "]"); return -1; } }
function updateExtra($code, $desc, $tf_code, $user) { $this->setData($this->m_strCodeKey, $code); $this->setData($this->m_strDescKey, $desc); $this->setData($this->m_strAdminKey, $user); if ($this->m_strTableKeyConst == EBPLS_BUSINESS_NATURE) { $this->data_elems[SYSREF_NATURE_TAX_FEE_CODE] = $tf_code[0]; $this->data_elems[SYSREF_NATURE_TAX_FEE_CODE2] = $tf_code[1]; } if (($error_num = $this->validateData(true)) > 0) { $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } $this->setData($this->m_strUpdateKey, date("Y-m-d H:i:s")); $strWhere[$this->m_strCodeKey] = $code; $ret = ebpls_update_data($this->m_dbLink, $this->m_strTableKey, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE {$this->m_strTableKey} FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE {$this->m_strTableKey} SUCCESSFULL [{$ret}]"); return $ret; } } else { $this->debug("CREATE {$this->m_strTableKey} FAILED [error:{$ret},msg=" . get_db_error() . "]"); return -1; } }
function update($code = NULL) { $this->data_elems[$this->m_strTimeStamp] = date("Y-m-d H:i:s"); $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } $this->debug("ID : " . EBPLS_PAR_PR_ID . ", {$this->m_strPrimaryKey} = {$code}<BR>"); if ($code) { $strWhere[$this->m_strPrimaryKey] = $code; } else { $strWhere[$this->m_strPrimaryKey] = $this->data_elems[$this->m_strPrimaryKey]; } $ret = ebpls_update_data($this->m_dbLink, $this->m_strTable, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE PDF SYSREF [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE PDF SYSREF SUCCESSFULL [{$ret}]"); return $ret; } }
function update() { if (($error_num = $this->validateData(true)) > 0) { $strWhere[BUSINESS_ID] = $this->business_id; $strWhere[NATURE_BUSINESS_NATURE_CODE] = $this->data_elems[NATURE_BUSINESS_NATURE_CODE]; $this->data_elems[NATURE_UPDATED_BY] = $creator; $this->data_elems[NATURE_UPDATED_LAST_TS] = $dt; $strValues = $this->data_elems; $ret = ebpls_update_data($this->m_dbLink, NATURE_BUSINESS_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->setError($ret, get_db_error()); $this->debug("Update Business nature [error:{$ret},msg=" . get_db_error() . "]"); return $ret; } else { $this->debug("Update Business nature SUCCESSFULL [{$ret}]"); return $ret; } } else { $this->debug("Update Business nature FAILED [error:{$ret},msg=" . get_db_error() . "]"); return -1; } }
function update($veh_id) { $this->data_elems[EBPLS_MOTORIZED_VEH_UPDATED_TS] = date("Y-d-m H:i:s"); $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != "" && $arrData[$key] != NULL) { $strValues[$key] = $value; } } if (($error_num = $this->validateData(true)) > 0) { $strWhere[EBPLS_MOTORIZED_VEH_MOTOR_ID] = $veh_id; $ret = ebpls_update_data($this->m_dbLink, EBPLS_MOTORIZED_VEHICLES_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("UPDATE MOTORIZED VEHICLE FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("UPDATE MOTORIZED VEHICLE SUCCESSFULL [{$ret}]"); return $ret; } } else { $this->debug("CREATE MOTORIZED VEHICLE FAILED [error:{$ret},msg=" . get_db_error() . "]"); return -1; } }
function update() { if ($this->validateData(true) > 0) { $dt = date("Y-m-d H:i:s"); $this->data_elems[TR_REQ_ID] = NULL; $this->data_elems[TR_TS_UPDATE] = $dt; if ($this->getData(TR_STATUS) == "SUBMITTED") { $this->data_elems[TR_TS_SUBMITTED] = $dt; } $arrData = $this->getData(); foreach ($arrData as $key => $value) { if ($arrData[$key] != NULL) { $strValues[$key] = $value; } } $strWhere[TR_TRANS_ID] = $this->getData(TR_TRANS_ID); $strWhere[TR_REQUIREMENT_CODE] = $this->getData(TR_REQUIREMENT_CODE); $ret = ebpls_update_data($this->m_dbLink, TR_TABLE, $strValues, $strWhere); if ($ret < 0) { $this->debug("TR UPDATE ERROR : {$ret}"); return $ret; } else { $this->debug("TR UPDATE OK : {$ret}"); return $ret; } } else { $this->debug("TR UPDATE TRANS REQ FAILED : {$ret}"); return -1; } }
function setCheckStatus($check_no, $check_status, $admin, $remark) { if ($check_status != CHECK_STATUS_BOUNCED && $check_status != CHECK_STATUS_PENDING && $check_status != CHECK_STATUS_CLEARED) { $this->setError(-1, "Invalid check status value {$check_status}."); return -1; } if ($check_no == NULL) { $strWhere[TPC_CHECK_NO] = $this->getData(TPC_CHECK_NO); } else { $strWhere[TPC_CHECK_NO] = $check_no; } $strWhere[TPC_CHECK_STATUS] = CHECK_STATUS_PENDING; $strCols[TPC_CHECK_STATUS] = $check_status; $strCols[TPC_ADMIN] = $admin; $strCols[TPC_REMARK] = $remark; $strCols[TPC_TS_LAST_UPDATE] = date("Y-m-d H:i:s"); $ret = ebpls_update_data($this->m_dbLink, TPC_TABLE, $strCols, $strWhere); return $ret; }
function retire($trans_id, $nature_code) { $strWhere[TRANS_BUSNATURE_TRANS_ID] = $trans_id; $strWhere[TRANS_BUSNATURE_BUSINESS_NATURE_CODE] = $nature_code; $strValues[TRANS_BUSNATURE_STATUS] = "RETIRED"; $strValues[TRANS_BUSNATURE_TS_UPDATE] = date("Y-m-d H:i:s"); $ret = ebpls_update_data(TRANS_BUSNATURE_TABLE, $strValues, $strWhere); return $ret; }