本文整理汇总了PHP中ebpls_select_data函数的典型用法代码示例。如果您正苦于以下问题:PHP ebpls_select_data函数的具体用法?PHP ebpls_select_data怎么用?PHP ebpls_select_data使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ebpls_select_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
/**
* View owner data, loads data using owner id as param
*
*/
function view($owner_id)
{
$strValues[$key] = "*";
$strWhere[EBPLS_MOTORIZED_OWNER_ID] = $owner_id;
$result = ebpls_select_data($this->m_dbLink, EBPLS_MOTORIZED_OPERATOR_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$this->data_elems = $result[0];
return $result[0][EBPLS_MOTORIZED_OPERATOR_ID];
} else {
$this->setError($result, get_db_error());
return -1;
}
}
示例2: get_permit_default_requirements
/**
* Get all permit requirements of a particular type of permit type.
*
**/
function get_permit_default_requirements($permit_type)
{
$strWhere[$permit_type] = $permit_type;
$strValues[] = " * ";
$result = ebpls_select_data($dbLink, "ebpls_permit_requirements", $strValues, $strWhere, NULL, NULL, "DESC", NULL);
if (is_array($result)) {
for ($i = 0; $i < count($result); $i++) {
$record[] = $result[$i];
}
return $record;
} else {
//print_r(get_db_error());
return NULL;
}
}
示例3: view
/**
* View owner data, loads data using owner id as param
*
*/
function view($bus_code)
{
$strValues[$key] = "*";
$strWhere[BE_BUSINESS_PERMIT_ID] = $bus_code;
$result = ebpls_select_data($this->m_dbLink, EBPLS_BUSINESS_PERMIT_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$owner = new EBPLSOwner($this->m_dbLink);
$owner->view($result[0][BE_OWNER_ID]);
$this->setOwner($owner);
$this->data_elems = $result[0];
return 1;
} else {
$this->setError($result, get_db_error());
return -1;
}
}
示例4: load
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;
}
}
示例5: ebpls_select_data_bypage
function ebpls_select_data_bypage($dbLink, $strTable, $strColumns, $strWhere = NULL, $strGroupBy = NULL, $strOrder = NULL, $strOrderKey = NULL, $nPage = 1, $nMaxRecordPerPage = 20)
{
if ($nPage <= 0 || $nMaxRecordPerPage <= 0) {
set_db_error(NULL, "Invalid page values [pg={$nPage},maxrec={$nMaxRecordPerPage}]");
return ERROR_DB_FUNCS_SELECTFAILED;
}
// build select sql
$sqlArray = ebpls_select_data($dbLink, $strTable, $strColumns, $strWhere, $strGroupBy, $strOrder, $strOrderKey, 1, 1, true);
$sqlCount = $sqlArray["count_sql"];
$sqlSelect = $sqlArray["select_sql"];
$res = @mysql_query($sqlCount, $dbLink);
// count number of pages
if ($res && ($row = mysql_fetch_array($res))) {
$nTotalRecords = $row[0];
$nPageCount = floor($row[0] / $nMaxRecordPerPage);
if ($row[0] % $nMaxRecordPerPage > 0) {
$nPageCount++;
}
}
// get offset using page number
if ($nPage == 1) {
$pgOffset = 0;
} else {
$pgOffset = ($nPage - 1) * $nMaxRecordPerPage;
}
$res = ebpls_select_data($dbLink, $strTable, $strColumns, $strWhere, $strGroupBy, $strOrder, $strOrderKey, $nMaxRecordPerPage, $pgOffset);
if ($res < 0) {
set_db_error($dbLink);
return $res;
} else {
$page_record["total"] = $nTotalRecords;
$page_record["count"] = count($res);
$page_record["page"] = $nPage;
$page_record["max_pages"] = $nPageCount;
$page_record["page_count"] = $nPageCount;
return array("result" => $res, "page_info" => $page_record);
}
}
示例6: delete
function delete($owner_id)
{
$strWhere[OWNER_ID] = $owner_id;
$strValues[] = "count(*) as cnt";
// check if owner have existing transactions
$result = ebpls_select_data($this->m_dbLink, EBPLS_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 = ebpls_delete_data($this->m_dbLink, EBPLS_OCC_PERMIT_TABLE, $strWhere);
if ($result < 0) {
$this->setError($result, get_db_error());
}
return $result;
}
示例7: view
function view($code)
{
$strColumns[] = "*";
if ($code) {
$strWhere[EBPLS_TAX_FEE_CODE] = $code;
} else {
$strWhere[EBPLS_TAX_FEE_CODE] = $this->data_elems[EBPLS_TAX_FEE_CODE];
}
$ret = ebpls_select_data($this->m_dbLink, EBPLS_TAX_FEE_TABLE, $strColumns, $strWhere);
if ($ret < 0) {
$this->debug("VIEW EBPLS_TAX_FEE_TABLEFAILED [error:{$ret},msg=" . get_db_error() . "]");
$this->setError($ret, get_db_error());
return $ret;
} else {
$this->debug("VIEW EBPLS_TAX_FEE_TABLE SUCCESSFULL [{$ret}]");
$clsFormula = new TaxFeeFormula($this->m_dbLink, false);
$clsFormula->view($ret[0][EBPLS_TAX_FORMULA_ID]);
$ret[0][EBPLS_TAX_FORMULA] = unserialize($clsFormula->getData(EBPLS_FORMULAS_FORMULA_CLASS));
if ($ret[0][EBPLS_TAX_FORMULA]) {
//print_r($ret[0][EBPLS_TAX_FORMULA]->getData());
$this->setData(NULL, $ret[0]);
return $ret;
} else {
$this->setError(-2, "Invalid formula on unserialize : " . $ret[0][EBPLS_TAX_FORMULA_ID] . "!");
$this->debug("Invalid formula on unserialize : " . $ret[0][EBPLS_TAX_FORMULA_ID] . "!");
return -2;
}
}
}
示例8: view
/**
* View owner data, loads data using owner id as param
*
*/
function view($mot_code)
{
$strValues[$key] = "*";
$strWhere[MOTORIZED_OPERATOR_PERMIT_ID] = $mot_code;
//echo "<hr>code : $mot_code <hr>";
$result = ebpls_select_data($this->m_dbLink, EBPLS_MOTORIZED_OPERATOR_PERMIT_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$owner = new EBPLSOwner($this->m_dbLink);
//$owner->load( $result[0][MOTORIZED_OPERATOR_PERMIT_ID] );
$owner->view($result[0][MOTORIZED_OWNER_ID]);
$this->setOwner($owner);
$this->data_elems = $result[0];
return 1;
} else {
$this->setError($result, get_db_error());
return -1;
}
}
示例9: view
/**
* View owner data, loads data using owner id as param
*
*/
function view($ped_code)
{
$strValues[$key] = "*";
$strWhere[FRANCHISE_PERMIT_ID] = $ped_code;
$result = ebpls_select_data($this->m_dbLink, EBPLS_FRANCHISE_PERMIT_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$this->m_nOwnerId = $result[0][FRANCHISE_OWNER_ID];
$this->data_elems = $result[0];
return 1;
} else {
$this->setError($result, get_db_error());
return -1;
}
}
示例10: getTotalAmountDue
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;
}
}
示例11: existOnDefaultRequirements
function existOnDefaultRequirements($tax_fee_code)
{
if (EBPLS_PDR_PR_TYPE_TAX == $this->m_strType) {
$strWhere[EBPLS_PTR_TAX_FEE_CODE] = $tax_fee_code;
} else {
if (EBPLS_PDR_PR_TYPE_FEE == $this->m_strType) {
$strWhere[EBPLS_PFR_TAX_FEE_CODE] = $tax_fee_code;
} else {
return false;
}
}
$strValues[] = "*";
$result = ebpls_select_data($this->m_dbLink, $this->m_strTable, $strValues, $strWhere);
if (is_array($result) && count($result) > 0) {
return true;
} else {
return false;
}
}
示例12: getPaymentList
function getPaymentList($trans_id)
{
$strValues[] = "*";
if ($trans_id == NULL) {
$strWhere[TPOR_TRANS_ID] = $this->getData(TPOR_TRANS_ID);
} else {
$strWhere[TPOR_TRANS_ID] = $trans_id;
}
$records = ebpls_select_data($this->m_dbLink, TPOR_TABLE, $strValues, $strWhere);
if (is_array($records)) {
for ($i = 0; $i < count($records); $i++) {
$clsOR = new EBPLSTransactionPaymentsOR($this->m_dbLink);
$clsOR->setData(NULL, $records[$i]);
$clsOR->getPaymentDetails($strWhere[TPOR_OR_NO]);
$or_records[] = $clsOR;
}
return $or_records;
} else {
$this->setError(-1, "Unable to find OR # " . $strWhere[TPOR_OR_NO] . " Record.");
return -1;
}
}
示例13: loadCTC
function loadCTC($id)
{
if ($this->m_ctcType == CTC_TYPE_BUSINESS) {
$strWhere[CTC_BUSINESS_ID] = $id;
} else {
$strWhere[CTC_OWNER_ID] = $id;
}
$strWhere[CTC_DATE_ISSUED] = array(" like ", date("Y") . "%");
$strValues[] = "*";
$result = ebpls_select_data($this->m_dbLink, $this->m_strTable, $strValues, $strWhere);
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
$this->setData(NULL, $result[0]);
return $result;
}
}
示例14: computeTransactionTotalTaxFeeDue
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;
}
}
示例15: view
/**
* View owner data, loads data using owner id as param
*
*/
function view($fish_id)
{
$strValues[$key] = "*";
$strWhere[FISHERY_ID] = $fish_id;
$result = ebpls_select_data($this->m_dbLink, FISHERY_PERMIT_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$this->m_nOwnerId = $result[0][FISHERY_OWNER_ID];
$this->data_elems = $result[0];
return 1;
} else {
$this->setError($result, get_db_error());
return -1;
}
}