示例#1
0
<?php

if (!defined('DC')) {
    die("!defined('DC')");
}
// уведомления
$tpl['alert'] = @$_REQUEST['parameters']['alert'];
$tpl['currency_list'] = get_currency_list($db);
$tpl['currency_id'] = intval(@$_REQUEST['parameters']['currency_id']);
if (!$tpl['currency_id']) {
    $tpl['currency_id'] = 150;
}
if (empty($_SESSION['restricted'])) {
    // то, что еще не попало в блоки.
    $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, '
			SELECT *
			FROM `' . DB_PREFIX . MY_PREFIX . 'my_promised_amount`
			');
    while ($row = $db->fetchArray($res)) {
        $tpl['promised_amount_list']['my_pending'][] = $row;
    }
}
$tpl['variables'] = ParseData::get_all_variables($db);
get_promised_amounts($user_id);
$tpl['limits_text'] = str_ireplace(array('[limit]', '[period]'), array($tpl['variables']['limit_promised_amount'], $tpl['periods'][$tpl['variables']['limit_promised_amount_period']]), $lng['limits_text']);
$tpl['last_tx'] = get_last_tx($user_id, types_to_ids(array('new_promised_amount', 'change_promised_amount', 'del_promised_amount', 'for_repaid_fix', 'actualization_promised_amounts', 'mining')));
if (!empty($tpl['last_tx'])) {
    $tpl['last_tx_formatted'] = make_last_txs($tpl['last_tx']);
}
require_once ABSPATH . 'templates/promised_amount_list.tpl';
示例#2
0
    if ($row['del_block_id']) {
        $row['status'] = 'reduction closed';
    } else {
        if (time() - $row['time'] > $variables['cash_request_time'] && $row['status'] != 'approved') {
            $row['status'] = 'rejected';
        }
    }
    $row['time'] = date('d/m/Y H:i:s', $row['time']);
    $tpl['cash_requests'][] = $row;
}
// поиск инфы о юзере
$tpl['user_info_id'] = intval(@$_REQUEST['parameters']['user_info_id']);
if ($tpl['user_info_id']) {
    $tp['user_info']['wallets'] = get_balances($tpl['user_info_id']);
    // обещанные суммы юзера
    get_promised_amounts($tpl['user_info_id']);
    // кредиты
    $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\tSELECT sum(`amount`) as `amount`,\n\t\t\t\t\t\t `currency_id`\n\t\t\tFROM `" . DB_PREFIX . "credits`\n\t\t\tWHERE `from_user_id` = {$tpl['user_info_id']} AND\n\t\t\t\t\t\t `del_block_id` = 0\n\t\t\tGROUP BY `currency_id`\n\t\t\t");
    while ($row = $db->fetchArray($res)) {
        $tpl['credits']['debtor'][] = $row;
    }
}
/*
 * Голосование за размер обещанной суммы
 */
/*
$tpl['max_promised_amount_votes'] = array();
// берем все голоса
$res = $db->query( __FILE__, __LINE__,  __FUNCTION__,  __CLASS__, __METHOD__, "
				SELECT `currency_id`,
							  `amount`,