function delete($sign_id) { $strWhere[SIGN_ID] = $sign_id; $strValues[] = "count(*) as cnt"; // check if owner have existing transactions $result = ebpls_delete_data($this->m_dbLink, EBPLS_SIGNATORIES_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function selectNonSystemData($formula_id = NULL, $formula_desc = NULL, $formula_type = NULL, $system_data = NULL, $page = 1, $maxrec = 20, $orderby = EBPLS_FORMULAS_CREATE_TS, $is_desc = false) { if ($formula_id != NULL && $formula_id != "") { $strWhere[EBPLS_FORMULAS_FORMULA_ID] = $formula_id; } if ($formula_desc != NULL && $formula_desc != "") { $strWhere[EBPLS_FORMULAS_FORMULA_DESC] = array("like", "{$formula_desc}%"); } if ($formula_type != NULL && $formula_type != "") { $strWhere[EBPLS_FORMULAS_FORMULA_TYPE] = $formula_type; } if (!is_null($system_data) && ($system_data == "0" || $system_data == "1")) { $strWhere[EBPLS_FORMULAS_SYSTEMDATA] = $system_data; } // select all columns $strValues[] = "*"; if ($orderby != NULL) { $strOrder[$orderby] = $orderby; } else { $strOrder[$orderkey] = EBPLS_FORMULAS_FORMULA_ID; } $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_FORMULAS_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLTaxFeeSysRef object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new TaxFeeFormula($this->m_dbLink, false); $obj = unserialize($result["result"][$i][EBPLS_FORMULAS_FORMULA_CLASS]); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
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; } }
function add() { if ($this->m_dbLink) { $this->data_elems[TRANS_BUSNATURE_FOR_YEAR] = date("Y"); $this->data_elems[TRANS_BUSNATURE_TS_CREATE] = date("Y-m-d H:i:s"); $this->data_elems[TRANS_BUSNATURE_TS_UPDATE] = date("Y-m-d H:i:s"); if (($error_num = $this->validateData()) > 0) { $strValues = $this->getData(); $ret = ebpls_insert_data($this->m_dbLink, TRANS_BUSNATURE_TABLE, $strValues); if ($ret < 0) { $this->debug("CREATE EBPLSTransactionBusinessNature FAILED [error:{$ret},msg=" . get_db_error() . "]"); $this->setError($ret, get_db_error()); return $ret; } else { $this->debug("CREATE EBPLSTransactionBusinessNature SUCCESSFULL [{$ret}]"); return 1; } } else { //print_r($this->getError()); $this->debug("CREATE EBPLSTransactionBusinessNature FAILED [error:{$ret},msg=" . get_db_error() . "]"); return $error_num; } } else { $this->debug("CREATE EBPLSTransactionBusinessNature FAILED INVALID DB LINK {$this->m_dbLink}"); $this->setError($ret, "Invalid Db link {$this->m_dbLink}"); return -1; } }
function load() { $strValues[$key] = "*"; //$strWhere[BUSINESS_ID] = $this->business_id; $strWhere[NATURE_BUSINESS_NATURE_CODE] = $this->getData(NATURE_BUSINESS_NATURE_CODE); $result = ebpls_select_data($this->m_dbLink, NATURE_BUSINESS_REF_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL); if (is_array($result)) { $this->data_elems[NATURE_BUSINESS_ID] = $this->business_id; $this->data_elems[NATURE_BUSINESS_NATURE_CODE] = $result[0][NATURE_BUSINESS_NATURE_CODE]; unset($this->data_elems[NATURE_BUSINESS_NATURE_DESC]); return 1; } else { if ($result < 0 || $result == "") { $this->setError(-1, "EBPLSEnterpriseNature with nature code " . $strWhere[NATURE_BUSINESS_NATURE_CODE] . " not found.[{$result}]"); } else { $this->setError($result, get_db_error()); } return -1; } }
function search($operator_id, $motor_model = NULL, $motor_no = NULL, $chassis_no = NULL, $plate_no = NULL, $body_no = NULL, $page = 1, $maxrec = 1000000, $orderkey = EBPLS_MOTORIZED_VEH_MOTOR_ID, $is_desc = true) { if ($operator_id != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_OPERATOR_ID] = $operator_id; } if ($motor_model != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_MOTOR_MODEL] = array("like", "{$motor_model}%"); } if ($motor_no != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_MOTOR_NO] = array("like", "{$motor_no}%"); } if ($chassis_no != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_CHASSIS_NO] = array("like", "{$chassis_no}%"); } if ($plate_no != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_PLATE_NO] = array("like", "{$plate_no}%"); } if ($body_no != NULL) { $strWhere[EBPLS_MOTORIZED_VEH_BODY_NO] = array("like", "{$body_no}%"); } // select all columns $strValues[] = "*"; if ($orderkey != NULL) { $strOrder[$orderkey] = $orderkey; } else { $strOrder = $orderkey; } if (count($strWhere) <= 0) { $this->setError(-1, "No search parameters."); return -1; } $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_MOTORIZED_VEHICLES_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLSOwner object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSMotorizedVehicle($this->m_dbLink); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
function delete($owner_id) { $strWhere[CIT_ID] = $owner_id; $strValues[] = "count(*) as cnt"; // check if owner have existing transactions $result = ebpls_delete_data($this->m_dbLink, EBPLS_CTC_INTEREST_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function delete($owner_id) { $strWhere[OCCUPANCY_TYPE_CODE] = $owner_id; //$strValues[] = "count(*) as cnt"; $result = ebpls_delete_data($this->m_dbLink, EBPLS_OCCUPANCY_TYPE_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function select($code = NULL, $page = 1, $maxrec = 100000000, $orderkey = SYSREF_CODE, $is_desc = true) { if ($code != NULL) { $strWhere[$this->m_strCodeKey] = $code; } if ($orderkey != SYSREF_CODE && $orderkey != SYSREF_DESC && $orderkey != SYSREF_CREATE_TS && $orderkey != SYSREF_UPDATE_TS && $orderkey != SYSREF_ADMIN) { $this->setError(-1, "Invalid order key value {$orderkey}."); return -1; } // select all columns $strValues[] = "*"; if ($orderkey != NULL) { $strOrder[$this->m_strTableKeyConst . $orderkey] = $this->m_strTableKeyConst . $orderkey; } else { $strOrder = $this->m_strCodeKey; } $result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTableKey, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLSSysRef object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSSysRef($this->m_dbLink, $this->m_strTableKey); $records[$i]->setData(NULL, $result["result"][$i]); $records[$i]->m_strCode = $records[$i]->getData($this->m_strCodeKey); $records[$i]->m_strDesc = $records[$i]->getData($this->m_strDescKey); $records[$i]->m_tsCreate = $records[$i]->getData($this->m_strCreateKey); $records[$i]->m_tsUpdate = $records[$i]->getData($this->m_strUpdateKey); $records[$i]->m_strAdmin = $records[$i]->getData($this->m_strAdminKey); } $result["result"] = $records; return $result; } }
/** * Find function searches Owner table for users having exact values for firstname, lastname, middlename, email address, birthdate. * * Set a NULL value to any of the parameters a users wishes not included on the search function. * * Search uses AND on query on all of the non-NULL parameters provided. Exact string match is implemented. * * Search result can be order by setting orderkey as any of the pre-defined data elements constants defined above, * set $is_desc to true to use DESC otherwise set to false. * * Paging is automatically provided by letting users of this method provide the page number and the max records per page. * Page result are automaticallly selected give these information, by rule $maxrec should be > 0 and $page should be > 1 and < maxpages * * Result of this method is a 2-dim array, having keys "page_info" and "result" * First element of result having key "page_info" contains all the information regarding the query * total = number of total records of search * max_pages = number of pages in search * count = number of records on current page * page = current page selected * Second element of array having key "result" contains result of the search. "result" search value is an array of EBLPSCTC objects * * */ function search($fname = NULL, $mname = NULL, $lname = NULL, $email = NULL, $bdate = NULL, $page = 1, $maxrec = 1000000000, $orderkey = OWNER_REG_DATE, $is_desc = true) { if ($fname != NULL) { $strWhere[OWNER_FIRST_NAME] = array("like", "{$fname}%"); } else { if ($this->data_elems[OWNER_FIRST_NAME] != "") { $strWhere[OWNER_FIRST_NAME] = array("like", $this->data_elems[OWNER_FIRST_NAME] . "%"); } } if ($mname != NULL) { $strWhere[OWNER_MIDDLE_NAME] = array("like", "{$mname}%"); } else { if ($this->data_elems[OWNER_MIDDLE_NAME] != "") { $strWhere[OWNER_MIDDLE_NAME] = array("like", $this->data_elems[OWNER_MIDDLE_NAME] . "%"); } } if ($lname != NULL) { $strWhere[OWNER_LAST_NAME] = array("like", "{$lname}%"); } else { if ($this->data_elems[OWNER_LAST_NAME] != "") { $strWhere[OWNER_LAST_NAME] = array("like", $this->data_elems[OWNER_LAST_NAME] . "%"); } } if ($address != NULL) { $strWhere[OWNER_EMAIL_ADDRESS] = array("like", "{$email}%"); } else { if ($this->data_elems[OWNER_EMAIL_ADDRESS] != "") { $strWhere[OWNER_EMAIL_ADDRESS] = array("like", $this->data_elems[OWNER_EMAIL_ADDRESS] . "%"); } } if ($bdate != NULL) { $strWhere[OWNER_BIRTH_DATE] = "{$bdate}"; } else { if ($this->data_elems[OWNER_BIRTH_DATE] != "") { $strWhere[OWNER_BIRTH_DATE] = $this->data_elems[OWNER_BIRTH_DATE]; } } // select all columns $strValues[] = "*"; if ($orderkey != NULL) { $strOrder[$orderkey] = $orderkey; } else { $strOrder = $orderkey; } if (count($strWhere) <= 0) { $this->setError(-1, "No search parameters."); return -1; } $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_OWNER_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLSOwner object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSOwner($this->m_dbLink); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
function select($permit_type = NULL, $trans_type = NULL, $page = 1, $maxrec = 10, $orderkey = "", $is_desc = true) { // either MOT,PED,BUS,OCC etc... if ($permit_type != NULL) { if (EBPLS_PDR_PR_TYPE_APP == $this->m_strType) { $strWhere[EBPLS_PAR_PERMIT_TYPE] = $permit_type; if ($trans_type != NULL) { $strWhere[EBPLS_PAR_TRANS_TYPE] = $trans_type; } if ($permit_type != NULL) { $strWhere[EBPLS_PAR_PERMIT_TYPE] = $permit_type; } } else { if (EBPLS_PDR_PR_TYPE_TAX == $this->m_strType) { $strWhere[EBPLS_PTR_PERMIT_TYPE] = $permit_type; if ($trans_type != NULL) { $strWhere[EBPLS_PTR_TRANS_TYPE] = $trans_type; } if ($permit_type != NULL) { $strWhere[EBPLS_PTR_PERMIT_TYPE] = $permit_type; } } else { if (EBPLS_PDR_PR_TYPE_FEE == $this->m_strType) { $strWhere[EBPLS_PFR_PERMIT_TYPE] = $permit_type; if ($trans_type != NULL) { $strWhere[EBPLS_PFR_TRANS_TYPE] = $trans_type; } if ($permit_type != NULL) { $strWhere[EBPLS_PFR_PERMIT_TYPE] = $permit_type; } } } } } if ($orderkey != NULL) { $strOrder[$orderkey] = $orderkey; } else { $strOrder[$this->m_strPrimaryKey] = $this->m_strPrimaryKey; } $strValues[] = "*"; $result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTable, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLSPermitDefaultRequirements object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSPermitDefaultRequirements($this->m_dbLink, false); //print_r($result["result"][$i]); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
function findBusinessCTC($ctc_code, $company, $address, $org_type, $bus_nature, $date_issued, $page, $maxrec = 10, $orderkey = CTC_DATE_ISSUED, $is_desc = true) { if ($ctc_code != NULL) { $strWhere[CTC_CODE] = $ctc_code; } if ($company != NULL) { $strWhere[CTC_COMPANY] = array("like", "{$company}%"); } if ($address != NULL) { $strWhere[CTC_COMPANY_ADDRESS] = array("like", "{$address}%"); } if ($org_type != NULL) { $strWhere[CTC_ORGANIZATION_TYPE] = $org_type; } if ($bus_nature != NULL) { $strWhere[CTC_BUSINESS_NATURE] = array("like", "{$bus_nature}%"); } if ($date_issued != NULL) { $strWhere[CTC_DATE_ISSUED] = array("regexp", "{$date_issued}"); } $strValues[] = "*"; $strOrder[$orderkey] = $orderkey; $result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTable, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->m_arrError["err_code"] = $result; $this->m_arrError["err_mesg"] = get_db_error(); return $result; } else { // transform result to EBPLCTC object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSCTC($this->m_dbLink, CTC_TYPE_INDIVIDUAL); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
function computeTransactionTotalTaxFeeDue($trans_id) { $strValues[$key] = "sum(tax_total_amount_due)"; $strWhere[TF_TRANS_ID] = $trans_id; $result = ebpls_select_data($this->m_dbLink, TF_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL); if (is_array($result)) { return $result[0][0]; } else { $this->setError($result, get_db_error()); return -1; } }
function selectWithSystemData($code = NULL, $desc = NULL, $type = NULL, $system_data = NULL, $page = 1, $maxrec = 1, $orderkey = EBPLS_TAX_FEE_CODE, $is_desc = true) { if ($code != NULL && $code != "") { $strWhere[EBPLS_TAX_FEE_CODE] = $code; } if ($desc != NULL && $desc != "") { $strWhere[EBPLS_TAX_FEE_DESC] = array("like", "{$desc}%"); } if ($type != NULL) { if (is_array($type)) { $strWhere[EBPLS_TAX_FEE_TYPE] = array("IN", " ( '" . join("','", $type) . "')"); } else { $strWhere[EBPLS_TAX_FEE_TYPE] = $type; } } if (!is_null($system_data) && ($system_data == "0" || $system_data == "1")) { $strWhere[EBPLS_TAX_SYSTEMDATA] = $system_data; } // select all columns $strValues[] = "*"; if ($orderkey != NULL) { $strOrder[$orderkey] = $orderkey; } else { $strOrder[$orderkey] = EBPLS_TAX_FEE_CODE; } $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_TAX_FEE_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLTaxFeeSysRef($this->m_dbLink, false); $clsFormula = new TaxFeeFormula($this->m_dbLink, false); $ret = $clsFormula->view($result["result"][$i][EBPLS_TAX_FORMULA_ID]); if ($ret > 0) { $result["result"][$i][EBPLS_TAX_FORMULA] = unserialize($clsFormula->getData(EBPLS_FORMULAS_FORMULA_CLASS)); if (!$result["result"][$i][EBPLS_TAX_FORMULA]) { $this->debug("<HR>Error loading formula : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!<HR>"); $this->setError(-2, "Invalid formula on unserialize : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!"); $this->debug("Invalid formula on unserialize : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!"); return -2; } $result["result"][$i][EBPLS_TAX_FORMULA]->setData(NULL, $clsFormula->getData()); $records[$i]->setData(NULL, $result["result"][$i]); } else { echo 'ID: ' . $result["result"][$i][EBPLS_TAX_FORMULA_ID]; return $ret; } } $result["result"] = $records; return $result; } }
function getTotalAmountDue($trans_id, $tax_fee_code = NULL, $payment_status = NULL) { $strValues[$key] = " sum(payment_total_amount_due) as t1,sum(payment_amount_paid) as t2,sum(payment_penalty_amount) as p1,sum(payment_penalty_amount_paid) as p2,sum(payment_interest_amount) as i1,sum(payment_interest_amount_paid) as i2 "; $strWhere[TPS_TRANS_ID] = $trans_id; if ($tax_fee_code != NULL) { $strWhere[TPS_PAYMENT_TAX_FEE_CODE] = $tax_fee_code; } if ($payment_status != NULL) { $strWhere[TPS_PAYMENT_STATUS] = $payment_status; } $result = ebpls_select_data($this->m_dbLink, TPS_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL); if (is_array($result)) { $row = $result[0]; $amount_due = floatval($row["t1"]) - floatval($row["t2"]); $amount_due += floatval($row["p1"]) - floatval($row["p2"]); $amount_due += floatval($row["i1"]) - floatval($row["i2"]); //$this->debug("getTotalAmountDue ok, return $amount_due."); return round($amount_due, 2); } else { $this->setError($result, get_db_error()); return -1; } }
function delete($economic_org_id) { $strWhere[ECONOMIC_ORG_ID] = $economic_org_id; $strValues[] = "count(*) as cnt"; $result = ebpls_delete_data($this->m_dbLink, EBPLS_ECONOMIC_ORGANIZATION_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function delete($owner_id) { $strWhere[INDUSTRY_SECTOR_CODE] = $owner_id; $strValues[] = "count(*) as cnt"; $result = ebpls_delete_data($this->m_dbLink, EBPLS_INDUSTRY_SECTOR_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function select($code = NULL, $acct_nature = NULL, $acct_no = NULL, $dept_code = NULL, $extra_code = NULL, $desc = NULL, $page = 1, $maxrec = 10, $orderkey = EBPLS_ACCT_CODE, $is_desc = true) { if ($code != NULL) { $strWhere[EBPLS_ACCT_CODE] = $code; } if ($acct_nature != NULL) { $strWhere[EBPLS_ACCT_NATURE] = array("like", "{$acct_nature}%"); } if ($acct_no != NULL) { $strWhere[EBPLS_ACCT_NO] = array("like", "{$acct_no}%"); } if ($extra_code != NULL) { $strWhere[EBPLS_EXTRA_CODE] = array("like", "{$extra_code}%"); } if ($desc != NULL) { $strWhere[EBPLS_ACCT_DESC] = array("like", "{$desc}%"); } // select all columns $strValues[] = "*"; if ($orderkey != NULL) { $strOrder[$orderkey] = $orderkey; } else { $strOrder[$orderkey] = EBPLS_ACCT_CODE; } $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_COT_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLTaxFeeSysRef object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLChartOfAccountsSysRef($this->m_dbLink, false); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } }
function delete($temp_id) { $strWhere[TEMP_ID] = $temp_id; $strValues[] = "count(*) as cnt"; $result = ebpls_delete_data($this->m_dbLink, EBPLS_ZIP_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function getBusinessNatureTaxFees($nature_code, $page = 1, $maxrec = 20, $orderby = EBPLS_BUSINESS_NATURE_TAXFEES_CREATE_TS, $is_desc = false) { $strWhere[EBPLS_BUSINESS_NATURE_NATURE_CODE] = $nature_code; $strValues[] = "*"; $strOrder[$orderby] = $orderby; //return; //ebpls_select_data_bypage( $this->m_dbLink, EBPLS_TAX_FEE_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc?"DESC":"ASC", $page, $maxrec ); $result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_BUSINESS_NATURE_TAXFEES_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec); if (!is_array($result) && $result < 0) { $this->setError($result, get_db_error()); return $result; } else { // transform result to EBPLSBusinessNatureTaxes object for ($i = 0; $i < count($result["result"]); $i++) { $records[$i] = new EBPLSBusinessNatureTaxes($this->m_dbLink, false); $records[$i]->getTaxFee(); $records[$i]->setData(NULL, $result["result"][$i]); } $result["result"] = $records; return $result; } return $result; }
function delete($economic_area_id) { $strWhere[ECONOMIC_AREA_ID] = $economic_area_id; $strValues[] = "count(*) as cnt"; // check if owner have existing transactions $result = ebpls_delete_data($this->m_dbLink, EBPLS_ECONOMIC_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function delete($zip_code) { $strWhere[ZIP_CODE] = $zip_code; $strValues[] = "count(*) as cnt"; // check if owner have existing transactions $result = ebpls_delete_data($this->m_dbLink, EBPLS_ZIP_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }
function listReq($trans_id, $status = NULL) { $strValues[$key] = "*"; $strWhere[TR_TRANS_ID] = $trans_id; if ($status != NULL) { $strWhere[TR_STATUS] = $status; } $result = get_application_requirement_list($this->m_dbLink, $trans_id, $status); if (is_array($result)) { for ($i = 0; $i < count($result); $i++) { $req[$i] = new EBPLSTransactionRequirement($this->m_dbLink); $req[$i]->setData(NULL, $result[$i]); } return $req; } else { $this->setError($result, get_db_error()); return -1; } }
$browse_url_string = join("&", $browse_url_array); if (isset($browse_string_array) && is_array($browse_string_array)) { $browse_string = join(' AND ', $browse_string_array); } if (isset($query_array) && is_array($query_array)) { $query_display_string = join(' AND ', $query_array); } $ordering = 'ASC'; if ($orderby == 'year' || $orderby == 'addition_date' || $orderby == 'rating' || $orderby == 'id') { $ordering = 'DESC'; } $dbHandle->sqliteCreateFunction('regexp_match', 'sqlite_regexp', 3); if ($column_string == 'all') { if (!isset($total_files_array)) { $result = $dbHandle->query("SELECT id FROM library {$all_in} ORDER BY {$orderby} COLLATE NOCASE {$ordering}"); get_db_error($dbHandle, basename(__FILE__), __LINE__); $total_files_array = $result->fetchAll(PDO::FETCH_COLUMN); $result = null; save_export_files($total_files_array); } $display_files_array = array_slice($total_files_array, $from, $limit); $display_files = join(",", $display_files_array); $display_files = "id IN ({$display_files})"; $result = $dbHandle->query("SELECT id,file,authors,title,journal,secondary_title,year,volume,pages,abstract,uid,doi,url,addition_date,rating,bibtex\r\n\t\t\t\t\tFROM library WHERE {$display_files}"); } elseif ($column_string == 'miscellaneous') { if (array_key_exists('No PDF', $_GET['browse'])) { $pdfs = array(); chdir('library'); $pdfs = glob('*.pdf', GLOB_NOSORT); $pds_string = join("','", (array) $pdfs); $pds_string = "file NOT IN ('" . $pds_string . "')";
function delete($owner_id) { $strWhere[OWNER_ID] = $owner_id; $strValues[] = "count(*) as cnt"; // check if owner have existing transactions $result = etoms_select_data($this->m_dbLink, ETOMS_TRANSACTION_TABLE, $strValues, $strWhere, NULL, NULL, NULL, NULL); if (is_array($result) && $result[0]["cnt"] > 0) { $this->debug("DELETE OWNER FAILED, OWNER HAVE AN EXISTING TRANSACTION"); return -1; } else { if ($result < 0) { $this->debug("DELETE OWNER FAILED [error:{$ret},msg=" . get_db_error() . "]"); return -1; } } $result = etoms_delete_data($this->m_dbLink, ETOMS_PAYEE_TABLE, $strWhere); if ($result < 0) { $this->setError($result, get_db_error()); } return $result; }