$data = ''; } } } $promised_amounts = ''; if ($data && $data['amount'] > 1) { $promised_amounts = round($data['amount']) . ' ' . $currency_list[$data['currency_id']] . '<br>'; $prognosis[$data['currency_id']] += (pow(1 + $data['pct_sec'], $sec) - 1) * $data['amount']; } if ($promised_amounts) { $promised_amounts = '<strong>' . substr($promised_amounts, 0, -4) . '</strong><br>' . $lng['promised'] . '<hr>'; } /* * На кошельках * */ $balances = get_balances($user_id); $balances_currency = array(); foreach ($balances as $data) { $balances_currency[$data['currency_id']] = $data; } if (!empty($balances_currency[72])) { $data = $balances_currency[72]; } else { if (!empty($balances_currency[58])) { $data = $balances_currency[58]; } else { if (!empty($balances_currency[23])) { $data = $balances_currency[23]; } else { $data = ''; }
$res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\tSELECT *\n\t\tFROM `" . DB_PREFIX . "cash_requests`\n\t\tORDER BY `id` DESC\n\t\tLIMIT 20\n\t\t"); while ($row = $db->fetchArray($res)) { 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__, "
// получаем последние транзакции по кошелькам $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\t\tSELECT *\n\t\t\t\tFROM `" . DB_PREFIX . MY_PREFIX . "my_dc_transactions`\n\t\t\t\tWHERE `status` = 'approved'\n\t\t\t\tORDER BY `id` DESC\n\t\t\t\tLIMIT 0, 10\n\t\t\t\t"); while ($row = $db->fetchArray($res)) { $tpl['my_dc_transactions'][] = $row; } } $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\tSELECT *\n\t\tFROM `" . DB_PREFIX . "credits`\n\t\tWHERE (`from_user_id` = {$user_id} OR `to_user_id` = {$user_id}) AND\n\t\t\t\t\t `del_block_id` = 0 AND\n\t\t\t\t\t `amount` > 0\n\t\t"); while ($row = $db->fetchArray($res)) { if ($user_id == $row['from_user_id']) { $tpl['I_debtor'][] = $row; } else { $tpl['I_creditor'][] = $row; } } // балансы $wallets = get_balances($user_id); foreach ($wallets as $id => $data) { $tpl['wallets'][$data['currency_id']] = $data; } $tpl['block_id'] = get_block_id($db); $tpl['confirmed_block_id'] = get_confirmed_block_id($db); $tpl['currency_list'] = get_currency_list($db, 'full'); // входящие запросы $tpl['cash_requests'] = 0; if (empty($_SESSION['restricted'])) { $my_user_id = get_my_user_id($db); $tpl['cash_requests'] = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\t\tSELECT count(`id`)\n\t\t\t\tFROM `" . DB_PREFIX . "cash_requests`\n\t\t\t\tWHERE `to_user_id` = {$my_user_id} AND\n\t\t\t\t\t\t\t `status` = 'pending' AND\n\t\t\t\t\t\t\t `for_repaid_del_block_id` = 0 AND\n\t\t\t\t\t\t\t `del_block_id` = 0\n\t\t\t\t", 'fetch_one'); $tpl['cash_requests'] = $tpl['cash_requests'] ? 1 : 0; } /* * Задания
<?php if (!defined('DC')) { die("!defined('DC')"); } // уведомления $tpl['alert'] = @$_REQUEST['parameters']['alert']; // валюты $tpl['currency_list'] = get_currency_list($db, 'full'); $tpl['user_id'] = $_SESSION['user_id']; if ($tpl['user_id'] != 'wait') { $tpl['wallets'] = get_balances($user_id); if (empty($_SESSION['restricted'])) { // получаем последние транзакции по кошелькам $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\t\tSELECT *\n\t\t\t\tFROM `" . DB_PREFIX . MY_PREFIX . "my_dc_transactions`\n\t\t\t\tORDER BY `id` DESC\n\t\t\t\tLIMIT 0, 100\n\t\t\t\t"); while ($row = $db->fetchArray($res)) { $tpl['my_dc_transactions'][] = $row; } } } //$tpl['variables'] = ParseData::get_variables ($db, array('node_commission') ); $tpl['data']['user_type'] = 'send_dc'; $tpl['data']['project_type'] = 'cf_send_dc'; $tpl['data']['user_type_id'] = ParseData::findType($tpl['data']['user_type']); $tpl['data']['project_type_id'] = ParseData::findType($tpl['data']['project_type']); $tpl['data']['time'] = time(); $tpl['data']['user_id'] = $user_id; $tpl['data']['current_block_id'] = get_block_id($db); $tpl['data']['confirmed_block_id'] = get_confirmed_block_id($db); $names = array('cash_request' => $lng['cash'], 'from_mining_id' => $lng['from_mining'], 'from_repaid' => $lng['from_repaid_mining'], 'from_user' => $lng['from_user'], 'node_commission' => $lng['node_commission'], 'system_commission' => 'system_commission', 'referral' => 'referral', 'cf_project' => 'Crowd funding', 'cf_project_refund' => 'Crowd funding refund'); $tpl['miner_id'] = (int) $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\tSELECT `miner_id`\n\t\tFROM `" . DB_PREFIX . "miners_data`\n\t\tWHERE `user_id` = {$user_id}\n\t\tLIMIT 1\n\t\t", 'fetch_one');