Example #1
0
function show_transaction_list($template)
{
    global $TPL;
    global $tflist;
    global $transactionGroupID;
    $q = prepare("SELECT *, amount * pow(10,-currencyType.numberToBasic) as amount\n                  FROM transaction\n             LEFT JOIN currencyType on transaction.currencyTypeID = currencyType.currencyTypeID\n                 WHERE transactionGroupID = %d\n              ORDER BY transactionID\n               ", $transactionGroupID);
    $db = new db_alloc();
    $db->query($q);
    while ($row = $db->row()) {
        $transaction = new transaction();
        $transaction->read_array($row);
        $transaction->set_values();
        $tflist = add_inactive_tf($transaction->get_value("tfID"), $tflist);
        $tflist = add_inactive_tf($transaction->get_value("fromTfID"), $tflist);
        $TPL["display"] = "";
        $TPL["tfList_dropdown"] = page::select_options($tflist, $transaction->get_value("tfID"), 500);
        $TPL["fromTfList_dropdown"] = page::select_options($tflist, $transaction->get_value("fromTfID"), 500);
        $TPL["transactionType_dropdown"] = page::select_options(transaction::get_transactionTypes(), $transaction->get_value("transactionType"));
        $TPL["status_dropdown"] = page::select_options(transaction::get_transactionStatii(), $transaction->get_value("status"));
        $TPL["link"] = $transaction->get_link("transactionID");
        include_template($template);
    }
}
Example #2
0
function show_transaction_list($transactions = array(), $template)
{
    global $TPL;
    global $tflist;
    foreach ($transactions as $row) {
        $transaction = new transaction();
        $transaction->read_array($row);
        $transaction->set_values();
        $TPL["display"] = "";
        $m = new meta("currencyType");
        $currencyOptions = $m->get_assoc_array("currencyTypeID", "currencyTypeID");
        $TPL["currencyOptions"] = page::select_options($currencyOptions, $transaction->get_value("currencyTypeID"));
        $TPL["tfList_dropdown"] = page::select_options($tflist, $transaction->get_value("tfID"));
        $TPL["fromTfList_dropdown"] = page::select_options($tflist, $transaction->get_value("fromTfID"));
        $TPL["tfID_label"] = $tflist[$transaction->get_value("tfID")];
        $TPL["fromTfID_label"] = $tflist[$transaction->get_value("fromTfID")];
        if (CAN_APPROVE_TRANSACTIONS && $TPL["productSale_status"] == "admin") {
            $TPL["status"] = "<select name='status[]' class='txStatus'>";
            $TPL["status"] .= page::select_options(transaction::get_transactionStatii(), $transaction->get_value("status")) . "</select>";
        }
        $TPL["pc_productCostID"] = $row["pc_productCostID"];
        $TPL["pc_amount"] = $row["pc_amount"];
        $TPL["pc_isPercentage"] = $row["pc_isPercentage"];
        $TPL["pc_currency"] = $row["pc_currency"];
        $TPL["amountClass"] = $row["saleTransactionType"];
        include_template($template);
    }
}