} } $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\tDELETE FROM `" . DB_PREFIX . "community`\n\t\t\tWHERE `user_id` = {$del_id}\n\t\t\t"); } if (isset($_REQUEST['parameters']['pool_tech_works'])) { $pool_tech_works = intval($_REQUEST['parameters']['pool_tech_works']); $pool_max_users = intval($_REQUEST['parameters']['pool_max_users']); $commission = $_REQUEST['parameters']['commission']; if (!check_input_data($commission, 'commission')) { die('bad commission'); } $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\tUPDATE `" . DB_PREFIX . "config`\n\t\t\tSET `pool_tech_works` = {$pool_tech_works},\n\t\t\t\t `pool_max_users` = {$pool_max_users},\n\t\t\t\t `commission` = '{$commission}'\n\t\t\t"); } $tables_array = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\tSHOW TABLES\n\t\t\t", 'array'); $tpl['users'] = array(); $community = get_community_users($db); for ($i = 0; $i < sizeof($community); $i++) { if ($community[$i] != $user_id) { if (in_array("{$community[$i]}_my_table", $tables_array)) { $tpl['users'][$community[$i]] = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\t\t\t\tSELECT `miner_id`,\n\t\t\t\t\t\t\t\t `email`\n\t\t\t\t\tFROM `" . DB_PREFIX . "{$community[$i]}_my_table`\n\t\t\t\t\tLIMIT 1\n\t\t\t\t\t", 'fetch_array'); } } } $tpl['config'] = get_node_config(); // лист ожидания попадания в пул $res = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\tSELECT *\n\t\tFROM `" . DB_PREFIX . "pool_waiting_list`\n\t\t"); while ($row = $db->fetchArray($res)) { $row['time'] = date('d/m/Y H:i:s', $row['time']); $tpl['waiting_list'][] = $row; } require_once ABSPATH . 'templates/pool_admin.tpl';
function send_mail($mail_data) { global $db; //debug_print($mail_data, __FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__); $mail = new PHPMailer(); $mail->IsHTML(true); if ($mail_data['use_smtp'] && $mail_data['smtp_server']) { $mail->IsSMTP(); $mail->SMTPAuth = $mail_data['smtp_auth'] ? true : false; $mail->SMTPSecure = $mail_data['smtp_ssl'] ? 'ssl' : ''; $mail->Host = $mail_data['smtp_server']; $mail->Port = $mail_data['smtp_port']; $mail->Username = $mail_data['smtp_username']; $mail->Password = $mail_data['smtp_password']; } if (get_community_users($db)) { $config = get_node_config(); $mail_from = $config['pool_email']; $node_url = $config['pool_url']; } else { $mail_from = $mail_data['email']; $node_url = ''; } $mail->SetFrom($mail_from, 'DemocraticCoin'); $mail->Subject = $mail_data['subj']; $mail->Body = '<table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td style="font-family: \'helvetica neue\', \'helvetica\', \'arial\', \'sans-serif\'; font-size: 14px;"> <table width="100%" bgcolor="f0f0f0" color="000000" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <table width="560" align="center" cellspacing="0" cellpadding="8" border="0"> <tr> <td><img src="http://dcoin.me/email/logo.png" alt="Dcoin" style="width: 280px; height: 62px; margin: 10px 0 15px;" /> <table width="100%" bgcolor="ffffff" style="border: 1px solid #eeeeee; margin-bottom: 10px; padding: 30px 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.07); line-height: 1.4;" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td valign="middle" align="center" height="200" style="font-size: 20px; text-decoration: none; color: #111111;">' . $mail_data['text'] . '</td></tr></table> </td> </tr> </table> </td> </tr> <tr> <td><p style="margin-bottom: 20px; text-align: center; font-size: 11px; color: #555555;">You can cut off the e-mail notifications here: ' . $node_url . ' -> Settings -> Sms and email notifications</p> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table>'; $mail->AddAddress($mail_data['email']); if (!$mail->Send()) { echo json_encode(array('error' => 'Mailer Error (' . str_replace("@", "@", $mail_data["email"]) . ') ' . $mail->ErrorInfo . '<br />')); } else { echo json_encode(array('error' => 'null')); } }
<?php session_start(); define('DC', TRUE); define('ABSPATH', dirname(dirname(__FILE__)) . '/'); //require_once( ABSPATH . 'includes/errors.php' ); require_once ABSPATH . 'db_config.php'; require_once ABSPATH . 'includes/autoload.php'; $db = new MySQLidb(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, DB_PORT); $lang = get_lang(); require_once ABSPATH . 'lang/' . $lang . '.php'; $dc_currency_id = intval($_REQUEST['dc_currency_id']); $currency_id = intval($_REQUEST['currency_id']); $amount = $db->escape($_REQUEST['amount']); if (!preg_match('/^[0-9]{0,6}(\\.[0-9]{0,8})?$/D', $amount) || $amount == 0) { die(json_encode(array('error' => 'amount_error'))); } $currency_list = get_currency_list($db); $config = get_node_config(); if ($config['cf_available_coins_url']) { $url = "{$config['cf_available_coins_url']}?dc_currency_id={$dc_currency_id}¤cy_id={$currency_id}&amount={$amount}"; $answer = file_get_contents($url); $answer_array = json_decode($answer, true); if (!isset($answer_array['success'])) { echo json_encode(array('error' => str_ireplace(array('[url]', '[amount]', '[currency_name]'), array('<a href="' . $config['cf_exchange_url'] . '">' . $config['cf_exchange_url'] . '</a>', $answer_array['error'], 'D' . $currency_list[$dc_currency_id]), $lng['no_DC']))); } else { echo $answer; } }
<?php if (!defined('DC')) { die("!defined('DC')"); } $tpl['data'] = get_node_config(); $script_name = $db->query(__FILE__, __LINE__, __FUNCTION__, __CLASS__, __METHOD__, "\n\t\tSELECT `script_name`\n\t\tFROM `" . DB_PREFIX . "main_lock`\n\t\t", 'fetch_one'); if ($script_name == 'my_lock') { $tpl['my_status'] = 'OFF'; } else { $tpl['my_status'] = 'ON'; } if (!get_community_users($db)) { $tpl['my_mode'] = 'Single'; } else { $tpl['my_mode'] = 'Pool'; } $tpl['config_ini'] = file_get_contents(ABSPATH . 'config.ini'); require_once ABSPATH . 'templates/node_config.tpl';