Merge pull request #4 from TheSerapher/next

next
This commit is contained in:
obigal 2013-10-27 06:30:14 -07:00
commit 21a378aac1
81 changed files with 1619 additions and 449 deletions

View File

@ -45,7 +45,7 @@ if (empty($aWorkers)) {
$aData['subject'] = 'IDLE Worker : ' . $aWorker['username'];
$aData['worker'] = $aWorker['username'];
$aData['email'] = $user->getUserEmail($aData['username']);
$log->logInfo(" " . $aWorker['username'] . "...");
$log->logDebug(" " . $aWorker['username'] . "...");
if (!$notification->sendNotification($aWorker['account_id'], 'idle_worker', $aData))
$log->logError(" Failed sending notifications: " . $notification->getError() . "\n");
}
@ -60,15 +60,15 @@ if (!empty($aNotifications)) {
foreach ($aNotifications as $aNotification) {
$aData = json_decode($aNotification['data'], true);
$aWorker = $worker->getWorker($aData['id']);
$log->logInfo(" " . $aWorker['username'] . " ...");
$log->logDebug(" " . $aWorker['username'] . " ...");
if ($aWorker['hashrate'] > 0) {
if ($notification->setInactive($aNotification['id'])) {
$log->logInfo(" updated #" . $aNotification['id'] . " for " . $aWorker['username'] . " as inactive\n");
$log->logDebug(" updated #" . $aNotification['id'] . " for " . $aWorker['username'] . " as inactive\n");
} else {
$log->logInfo(" failed to update #" . $aNotification['id'] . " for " . $aWorker['username'] . "\n");
}
} else {
$log->logInfo(" still inactive\n");
$log->logDebug(" still inactive\n");
}
}
} else {

View File

@ -46,7 +46,9 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
// We support some dynamic share targets but fall back to our fixed value
// Re-calculate after each run due to re-targets in this loop
if ($config['pplns']['shares']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']));
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']));
} else if ($config['pplns']['shares']['type'] == 'dynamic' && $block->getBlockCount() > 0) {
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']) * (100 - $config['pplns']['dynamic']['percent'])/100 + $aBlock['shares'] * $config['pplns']['dynamic']['percent']/100);
} else {
$pplns_target = $config['pplns']['shares']['default'];
}
@ -66,6 +68,8 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$config['reward_type'] == 'block' ? $dReward = $aBlock['amount'] : $dReward = $config['reward'];
$aRoundAccountShares = $share->getSharesForAccounts($iPreviousShareId, $aBlock['share_id']);
$log->logInfo('Shares: ' . $iRoundShares . "\t" . 'Height: ' . $aBlock['height'] . ' Amount: ' . $aBlock['amount'] . "\t" . 'Found by ID: ' . $aBlock['account_id']);
if ($iRoundShares >= $pplns_target) {
$log->logDebug("Matching or exceeding PPLNS target of $pplns_target with $iRoundShares");
$iMinimumShareId = $share->getMinimumShareId($pplns_target, $aBlock['share_id']);
@ -81,7 +85,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
foreach($aAccountShares as $key => $aData) {
$iNewRoundShares += $aData['valid'];
}
$log->logInfo('Adjusting round target to PPLNS target ' . $iNewRoundShares);
$log->logInfo('Adjusting round to PPLNS target of ' . $pplns_target . ' shares used ' . $iNewRoundShares);
$iRoundShares = $iNewRoundShares;
} else {
$log->logDebug("Not able to match PPLNS target of $pplns_target with $iRoundShares");
@ -114,6 +118,24 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$aAccountShares[$key]['invalid'] += $aArchiveShares[$aData['username']]['invalid'];
}
}
// reverse payout
if ($config['pplns']['reverse_payout']) {
$aSharesData = NULL;
foreach($aAccountShares as $key => $aData) {
$aSharesData[$aData['username']] = $aData;
}
// Add users from archive not in current round
foreach($aArchiveShares as $key => $aArchData) {
if (!array_key_exists($aArchData['account'], $aSharesData)) {
$log->logDebug('Adding user ' . $aArchData['account'] . ' to round shares');
$log->logDebug(' valid : ' . $aArchData['valid']);
$log->logDebug(' invalid : ' . $aArchData['invalid']);
$aArchData['username'] = $aArchData['account'];
$aSharesData[$aArchData['account']] = $aArchData;
}
}
$aAccountShares = $aSharesData;
}
}
// We tried to fill up to PPLNS target, now we need to check the actual shares to properly payout users
foreach($aAccountShares as $key => $aData) {
@ -162,6 +184,19 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$log->logError('Failed to update share statistics for ' . $aData['username']);
}
// Add PPLNS share statistics
foreach ($aAccountShares as $key => $aRoundData) {
if ($aRoundData['username'] == $aData['username']){
if (@$statistics->getIdShareStatistics($aRoundData, $aBlock['id'])){
if (!$statistics->updatePPLNSShareStatistics($aRoundData, $aBlock['id']))
$log->logError('Failed to update pplns statistics for ' . $aData['username']);
} else {
if (!$statistics->insertPPLNSShareStatistics($aRoundData, $aBlock['id']))
$log->logError('Failed to insert pplns statistics for ' . $aData['username']);
}
}
}
// Add new credit transaction
if (!$transaction->addTransaction($aData['id'], $aData['payout'], 'Credit', $aBlock['id']))
$log->logFatal('Failed to insert new Credit transaction to database for ' . $aData['username']);

View File

@ -1,3 +1,4 @@
ErrorDocument 404 /index.php?page=error&action=404
RedirectMatch 404 /templates(/|$)
RedirectMatch 404 /include(/|$)
RedirectMatch 404 /.git(/|$)

View File

@ -56,20 +56,51 @@ class RoundStats {
return false;
}
/**
* search for block height
**/
public function searchForBlockHeight($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT height
FROM $this->tableBlocks
WHERE height >= ?
ORDER BY height ASC
LIMIT 1");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->height;
return false;
}
/**
* get next block for stats paging
**/
public function getNextBlockForStats($iHeight=0, $limit=10) {
$stmt = $this->mysqli->prepare("
SELECT MAX(x.height) AS height
FROM (SELECT height FROM $this->tableBlocks
WHERE height >= ?
ORDER BY height ASC LIMIT ?) AS x");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $iHeight, $limit) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->height;
return false;
}
/**
* Get details for block height
* @param height int Block Height
* @return data array Block information from DB
**/
public function getDetailsForBlockHeight($iHeight=0, $isAdmin=0) {
public function getDetailsForBlockHeight($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
b.id, height, blockhash, amount, confirmations, difficulty, FROM_UNIXTIME(time) as time, shares,
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS finder
IF(a.is_anonymous, 'anonymous', a.username) AS finder,
ROUND((difficulty * 65535) / POW(2, (" . $this->config['difficulty'] . " -16)), 0) AS estshares,
(time - (SELECT time FROM $this->tableBlocks WHERE height < ? ORDER BY height DESC LIMIT 1)) AS round_time
FROM $this->tableBlocks as b
LEFT JOIN $this->tableUsers AS a ON b.account_id = a.id
WHERE b.height = ? LIMIT 1");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $isAdmin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $iHeight, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_assoc();
return false;
}
@ -79,10 +110,12 @@ class RoundStats {
* @param height int Block Height
* @return data array Block information from DB
**/
public function getRoundStatsForAccounts($iHeight=0, $isAdmin=0) {
public function getRoundStatsForAccounts($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username,
a.id,
a.username,
a.is_anonymous,
s.valid,
s.invalid
FROM $this->tableStats AS s
@ -92,30 +125,76 @@ class RoundStats {
GROUP BY username ASC
ORDER BY valid DESC
");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $isAdmin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) {
while ($row = $result->fetch_assoc()) {
$aData[$row['id']] = $row;
}
return $aData;
}
return false;
}
/**
* Get pplns statistics for round block height
* @param height int Block Height
* @return data array Block information from DB
**/
public function getPPLNSRoundStatsForAccounts($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
a.username,
a.is_anonymous,
s.pplns_valid,
s.pplns_invalid
FROM $this->tableStats AS s
LEFT JOIN $this->tableBlocks AS b ON s.block_id = b.id
LEFT JOIN $this->tableUsers AS a ON a.id = s.account_id
WHERE b.height = ?
GROUP BY username ASC
ORDER BY pplns_valid DESC
");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
return false;
}
/**
* Get total valid pplns shares for block height
**/
public function getPPLNSRoundShares($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
SUM(s.pplns_valid) AS pplns_valid
FROM $this->tableStats AS s
LEFT JOIN $this->tableBlocks AS b ON s.block_id = b.id
WHERE b.height = ?
");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->pplns_valid;
return false;
}
/**
* Get all transactions for round block height for admin
* @param height int Block Height
* @return data array Block round transactions
**/
public function getAllRoundTransactions($iHeight=0, $admin) {
public function getAllRoundTransactions($iHeight=0) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT
t.id AS id,
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username,
a.id AS uid,
a.username AS username,
a.is_anonymous,
t.type AS type,
t.amount AS amount
FROM $this->tableTrans AS t
LEFT JOIN $this->tableBlocks AS b ON t.block_id = b.id
LEFT JOIN $this->tableUsers AS a ON t.account_id = a.id
WHERE b.height = ?
ORDER BY id ASC");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $admin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
WHERE b.height = ? AND t.type = 'Credit'
ORDER BY amount DESC");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
$this->debug->append('Unable to fetch transactions');
return false;

View File

@ -77,6 +77,32 @@ class Statistics {
return false;
}
/**
* Get our last $limit blocks found by height
* @param limit int Last limit blocks
* @return array
**/
public function getBlocksFoundHeight($iHeight=0, $limit=10) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $iHeight . $limit)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
b.*,
a.username AS finder,
a.is_anonymous AS is_anonymous,
ROUND((difficulty * 65535) / POW(2, (" . $this->config['difficulty'] . " -16)), 0) AS estshares
FROM " . $this->block->getTableName() . " AS b
LEFT JOIN " . $this->user->getTableName() . " AS a
ON b.account_id = a.id
WHERE b.height <= ?
ORDER BY height DESC LIMIT ?");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $iHeight, $limit) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__ . $iHeight . $limit, $result->fetch_all(MYSQLI_ASSOC), 5);
// Catchall
$this->debug->append("Failed to find blocks:" . $this->mysqli->error);
return false;
}
/**
* Currently the only function writing to the database
* Stored per block user statistics of valid and invalid shares
@ -93,6 +119,44 @@ class Statistics {
return false;
}
/**
* update user statistics of valid and invalid pplns shares
**/
public function updatePPLNSShareStatistics($aStats, $iBlockId) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
UPDATE $this->table SET pplns_valid = ?, pplns_invalid = ? WHERE account_id = ? AND block_id = ?");
if ($this->checkStmt($stmt) && $stmt->bind_param('iiii', $aStats['valid'], $aStats['invalid'], $aStats['id'], $iBlockId) && $stmt->execute()) return true;
// Catchall
$this->debug->append("Failed to update pplns share stats: " . $this->mysqli->error);
return false;
}
/**
* insert user statistics of valid and invalid pplns shares "rbpplns"
**/
public function insertPPLNSShareStatistics($aStats, $iBlockId) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("INSERT INTO $this->table (account_id, valid, invalid, pplns_valid, pplns_invalid, block_id) VALUES (?, 0, 0, ?, ?, ?)");
if ($this->checkStmt($stmt) && $stmt->bind_param('iiii', $aStats['id'], $aStats['valid'], $aStats['invalid'], $iBlockId) && $stmt->execute()) return true;
// Catchall
$this->debug->append("Failed to insert pplns share stats: " . $this->mysqli->error);
return false;
}
/**
* Fetch the share ID from stats for rbpplns
**/
function getIdShareStatistics($aStats, $iBlockId) {
$stmt = $this->mysqli->prepare("
SELECT id AS id FROM $this->table
WHERE account_id = ? AND block_id = ?
");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $aStats['id'], $iBlockId) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->id;
return false;
}
/**
* Get our current pool hashrate for the past 10 minutes across both
* shares and shares_archive table
@ -196,7 +260,6 @@ class Statistics {
$data['share_id'] = 0;
$data['data'] = array();
}
$data['last_update'] = time();
$stmt = $this->mysqli->prepare("
SELECT
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS valid,
@ -246,12 +309,14 @@ class Statistics {
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) {
if (array_key_exists($account_id, $data['data']))
return $data['data'][$account_id];
// We have no cached value, we return defaults
return array('valid' => 0, 'invalid' => 0, 'donate_percent' => 0, 'is_anonymous' => 0);
}
// if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS invalid
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS invalid
FROM " . $this->share->getTableName() . " AS s,
" . $this->user->getTableName() . " AS u
WHERE
@ -327,6 +392,24 @@ class Statistics {
return false;
}
public function getUserShareDifficulty($account_id, $interval=600) {
$this->debug->append("STA " . __METHOD__, 4);
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff,
COUNT(s.id) AS total
FROM " . $this->share->getTableName() . " AS s JOIN " . $this->user->getTableName() . " AS a
ON a.username = SUBSTRING_INDEX( s.username, '.', 1 )
WHERE s.time > DATE_SUB(now(), INTERVAL ? SECOND)
AND a.id = ?");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $interval, $account_id) && $stmt->execute() && $result = $stmt->get_result() )
return $this->memcache->setCache(__FUNCTION__ . $account_id, $result->fetch_object()->avgsharediff);
$this->debug->append("Failed fetching average share dificulty: " . $this->mysqli->error, 3);
return 0;
}
/**
* Same as getUserHashrate for Sharerate
* @param account_id integer User ID
@ -396,28 +479,32 @@ class Statistics {
switch ($type) {
case 'shares':
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) {
// Use global cache to build data
$max = 0;
foreach($data['data'] as $key => $aUser) {
$shares[$key] = $aUser['valid'];
$username[$key] = $aUser['username'];
// Use global cache to build data, if we have any data there
if (!empty($data['data']) && is_array($data['data'])) {
foreach($data['data'] as $key => $aUser) {
$shares[$key] = $aUser['valid'];
$username[$key] = $aUser['username'];
}
array_multisort($shares, SORT_DESC, $username, SORT_ASC, $data['data']);
$count = 0;
foreach ($data['data'] as $key => $aUser) {
if ($count == $limit) break;
$count++;
$data_new[$key]['shares'] = $aUser['valid'];
$data_new[$key]['account'] = $aUser['username'];
$data_new[$key]['donate_percent'] = $aUser['donate_percent'];
$data_new[$key]['is_anonymous'] = $aUser['is_anonymous'];
}
return $data_new;
}
array_multisort($shares, SORT_DESC, $username, SORT_ASC, $data['data']);
foreach ($data['data'] as $key => $aUser) {
$data_new[$key]['shares'] = $aUser['valid'];
$data_new[$key]['account'] = $aUser['username'];
$data_new[$key]['donate_percent'] = $aUser['donate_percent'];
$data_new[$key]['is_anonymous'] = $aUser['is_anonymous'];
}
return $data_new;
}
// No cached data, fallback to SQL and cache in local cache
$stmt = $this->mysqli->prepare("
SELECT
a.username AS account,
a.donate_percent AS donate_percent,
a.is_anonymous AS is_anonymous,
ROUND(IFNULL(SUM(IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS shares,
SUBSTRING_INDEX( s.username, '.', 1 ) AS account
ROUND(IFNULL(SUM(IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS shares
FROM " . $this->share->getTableName() . " AS s
LEFT JOIN " . $this->user->getTableName() . " AS a
ON SUBSTRING_INDEX( s.username, '.', 1 ) = a.username
@ -434,10 +521,10 @@ class Statistics {
case 'hashes':
$stmt = $this->mysqli->prepare("
SELECT
a.username AS account,
a.donate_percent AS donate_percent,
a.is_anonymous AS is_anonymous,
IFNULL(ROUND(SUM(t1.difficulty) * 65536/600/1000, 2), 0) AS hashrate,
SUBSTRING_INDEX( t1.username, '.', 1 ) AS account
IFNULL(ROUND(SUM(t1.difficulty) * 65536 / 600 / 1000, 2), 0) AS hashrate
FROM
(
SELECT IFNULL(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty), 0) AS difficulty, username FROM " . $this->share->getTableName() . " WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE) AND our_result = 'Y'
@ -536,28 +623,51 @@ class Statistics {
/**
* get user estimated payouts based on share counts
* @param aRoundShares array Round shares
* @param aUserShares array User shares
* @param value1 mixed Round shares OR share rate
* @param value2 mixed User shares OR share difficulty
* @param dDonate double User donation setting
* @param bNoFees bool User no-fees option setting
* @return aEstimates array User estimations
**/
public function getUserEstimates($aRoundShares, $aUserShares, $dDonate, $bNoFees) {
public function getUserEstimates($value1, $value2, $dDonate, $bNoFees, $ppsvalue=0) {
$this->debug->append("STA " . __METHOD__, 4);
// Fetch some user information that we need
if (@$aRoundShares['valid'] > 0 && @$aUserShares['valid'] > 0) {
$aEstimates['block'] = round(( (int)$aUserShares['valid'] / (int)$aRoundShares['valid'] ) * (float)$this->config['reward'], 8);
$bNoFees == 0 ? $aEstimates['fee'] = round(((float)$this->config['fees'] / 100) * (float)$aEstimates['block'], 8) : $aEstimates['fee'] = 0;
$aEstimates['donation'] = round((( (float)$dDonate / 100) * ((float)$aEstimates['block'] - (float)$aEstimates['fee'])), 8);
$aEstimates['payout'] = round((float)$aEstimates['block'] - (float)$aEstimates['donation'] - (float)$aEstimates['fee'], 8);
if ($this->config['payout_system'] != 'pps') {
if (@$value1['valid'] > 0 && @$value2['valid'] > 0) {
$aEstimates['block'] = round(( (int)$value2['valid'] / (int)$value1['valid'] ) * (float)$this->config['reward'], 8);
$bNoFees == 0 ? $aEstimates['fee'] = round(((float)$this->config['fees'] / 100) * (float)$aEstimates['block'], 8) : $aEstimates['fee'] = 0;
$aEstimates['donation'] = round((( (float)$dDonate / 100) * ((float)$aEstimates['block'] - (float)$aEstimates['fee'])), 8);
$aEstimates['payout'] = round((float)$aEstimates['block'] - (float)$aEstimates['donation'] - (float)$aEstimates['fee'], 8);
} else {
$aEstimates['block'] = 0;
$aEstimates['fee'] = 0;
$aEstimates['donation'] = 0;
$aEstimates['payout'] = 0;
}
} else {
$aEstimates['block'] = 0;
$aEstimates['fee'] = 0;
$aEstimates['donation'] = 0;
$aEstimates['payout'] = 0;
// Hack so we can use this method for PPS estimates too
if (@$value1 > 0 && @$value2 > 0) {
// Default: No fees applied so multiply by 1
$fee = 1;
if ($this->config['fees'] > 0)
$bNoFees == 0 ? $fee = round(((float)$this->config['fees'] / 100), 8) : $fee = 1;
$pps = $value1 * $value2 * $ppsvalue;
$hour = 3600;
$aEstimates['hours1'] = $pps * $hour * $fee;
$aEstimates['hours24'] = $pps * 24 * $hour;
$aEstimates['days7'] = $pps * 24 * 7 * $hour;
$aEstimates['days14'] = $pps * 14 * 24 * 7 * $hour;
$aEstimates['days30'] = $pps * 30 * 24 * 7 * $hour;
} else {
$aEstimates['hours1'] = 0;
$aEstimates['hours24'] = 0;
$aEstimates['days7'] = 0;
$aEstimates['days14'] = 0;
$aEstimates['days30'] = 0;
}
}
return $aEstimates;
}
}
$statistics = new Statistics($debug, $mysqli, $config, $share, $user, $block, $memcache);

View File

@ -53,9 +53,16 @@ class Transaction extends Base {
* @return data array type and total
**/
public function getTransactionSummary($account_id=NULL) {
$sql = "SELECT SUM(t.amount) AS total, t.type AS type FROM $this->table AS t";
$sql = "
SELECT
SUM(t.amount) AS total, t.type AS type
FROM transactions AS t
LEFT OUTER JOIN blocks AS b
ON b.id = t.block_id
WHERE ( b.confirmations > 0 OR b.id IS NULL )
";
if (!empty($account_id)) {
$sql .= " WHERE t.account_id = ? ";
$sql .= " AND t.account_id = ? ";
$this->addParam('i', $account_id);
}
$sql .= " GROUP BY t.type";

View File

@ -136,39 +136,39 @@ class Worker {
* @param account_id int User ID
* @return mixed array Workers and their settings or false
**/
public function getWorkers($account_id) {
public function getWorkers($account_id, $interval=600) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT id, username, password, monitor,
( SELECT COUNT(id) FROM " . $this->share->getTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)) AS count_all,
( SELECT COUNT(id) FROM " . $this->share->getArchiveTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)) AS count_all_archive,
( SELECT COUNT(id) FROM " . $this->share->getTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)) AS count_all,
( SELECT COUNT(id) FROM " . $this->share->getArchiveTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)) AS count_all_archive,
(
SELECT
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536/600/1000), 0), 0) AS hashrate
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0), 0) AS hashrate
FROM " . $this->share->getTableName() . "
WHERE
username = w.username
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
AND time > DATE_SUB(now(), INTERVAL ? SECOND)
) + (
SELECT
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536/600/1000), 0), 0) AS hashrate
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0), 0) AS hashrate
FROM " . $this->share->getArchiveTableName() . "
WHERE
username = w.username
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
AND time > DATE_SUB(now(), INTERVAL ? SECOND)
) AS hashrate,
(
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / count_all, 2), 0)
FROM " . $this->share->getTableName() . "
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)
) + (
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / count_all_archive, 2), 0)
FROM " . $this->share->getArchiveTableName() . "
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)
) AS difficulty
FROM $this->table AS w
WHERE account_id = ?");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('iiiiiiiii', $interval, $interval, $interval, $interval, $interval, $interval, $interval, $interval, $account_id) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
// Catchall
$this->setErrorMessage('Failed to fetch workers for your account');
@ -183,7 +183,12 @@ class Worker {
**/
public function getCountAllActiveWorkers() {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("SELECT IFNULL(IF(our_result='Y', COUNT(DISTINCT username), 0), 0) AS total FROM " . $this->share->getTableName() . " WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE)");
$stmt = $this->mysqli->prepare("
SELECT COUNT(DISTINCT(username)) AS total
FROM " . $this->share->getTableName() . "
WHERE our_result = 'Y'
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
");
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->total;
return false;

View File

@ -123,6 +123,13 @@ $aSettings['statistics'][] = array(
'name' => 'statistics_block_count', 'value' => $setting->getValue('statistics_block_count'),
'tooltip' => 'Blocks to fetch for the block statistics page.'
);
$aSettings['statistics'][] = array(
'display' => 'Show block average', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'statistics_show_block_average', 'value' => $setting->getValue('show_block_average'),
'tooltip' => 'Show block average in block statistics page.'
);
$aSettings['statistics'][] = array(
'display' => 'Pool Hashrate Modifier', 'type' => 'select',
'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ),
@ -165,13 +172,6 @@ $aSettings['acl'][] = array(
'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'),
'tooltip' => 'Make the round statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Round Transactions', 'type' => 'select',
'options' => array( 0 => 'Admins', 1 => 'Public'),
'default' => 0,
'name' => 'acl_round_transactions', 'value' => $setting->getValue('acl_round_transactions'),
'tooltip' => 'Display all transactions regardless of admin status.'
);
$aSettings['system'][] = array(
'display' => 'Disable e-mail confirmations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -231,9 +231,20 @@ $config['fees'] = 0;
* type = `blockavg`
* blockcount = 10
**/
/**
* $config['pplns']['shares']['type'] = 'dynamic';
* Dynamic target adjustment allows the blockavg target to adjust faster to share counts
* while still tracking round share averages by using a percentage of the current round shares
* to alter the pplns blockavg target this is useful with the nature of many alt coins low and fast
* adjusting difficulties and quick round times
* reverse_payout is useful to even out payouts for fast round times when even steady miners
* are missing share submissions for the current round
**/
$config['pplns']['shares']['default'] = 4000000;
$config['pplns']['shares']['type'] = 'blockavg';
$config['pplns']['blockavg']['blockcount'] = 10;
$config['pplns']['reverse_payout'] = false; // add user shares from archive even if user not in current round
$config['pplns']['dynamic']['percent'] = 30; // percentage of round shares factored into block average when using dynamic type
// Pool target difficulty as set in pushpoold configuration file
// Please also read this for stratum: https://github.com/TheSerapher/php-mpos/wiki/FAQ

View File

@ -32,23 +32,72 @@ $dPoolHashrate = $statistics->getCurrentHashrate($interval);
if ($dPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $dPoolHashrate;
$dPersonalHashrate = $statistics->getUserHashrate($user_id, $interval);
$dPersonalSharerate = $statistics->getUserSharerate($user_id, $interval);
$dPersonalShareDifficulty = $statistics->getUserShareDifficulty($user_id, $interval);
$statistics->setGetCache(true);
// Use caches for this one
$aUserRoundShares = $statistics->getUserShares($user_id);
$aRoundShares = $statistics->getRoundShares();
$aEstimates = $statistics->getUserEstimates($aRoundShares, $aUserRoundShares, $user->getUserDonatePercent($user_id), $user->getUserNoFee($user_id));
if ($config['payout_system'] != 'pps') {
$aEstimates = $statistics->getUserEstimates($aRoundShares, $aUserRoundShares, $user->getUserDonatePercent($user_id), $user->getUserNoFee($user_id));
} else {
if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pps_reward = round($block->getAvgBlockReward($config['pps']['blockavg']['blockcount']));
} else {
if ($config['pps']['reward']['type'] == 'block') {
if ($aLastBlock = $block->getLast()) {
$pps_reward = $aLastBlock['amount'];
} else {
$pps_reward = $config['pps']['reward']['default'];
}
} else {
$pps_reward = $config['pps']['reward']['default'];
}
}
$ppsvalue = round($pps_reward / (pow(2,32) * $dDifficulty) * pow(2, $config['pps_target']), 12);
$aEstimates = $statistics->getUserEstimates($dPersonalSharerate, $dPersonalShareDifficulty, $user->getUserDonatePercent($user_id), $user->getUserNoFee($user_id), $ppsvalue);
}
$iTotalRoundShares = $aRoundShares['valid'] + $aRoundShares['invalid'];
if ($iTotalRoundShares > 0) {
$dUserInvalidPercent = round($aUserRoundShares['invalid'] / $iTotalRoundShares * 100, 2);
$dPoolInvalidPercent = round($aRoundShares['invalid'] / $iTotalRoundShares * 100, 2);
} else {
$dUserInvalidPercent = 0;
$dPoolInvalidPercent = 0;
}
// Apply pool modifiers
$dPersonalHashrateAdjusted = $dPersonalHashrate * $dPersonalHashrateModifier;
$dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier;
$dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier;
// Worker information
$aWorkers = $worker->getWorkers($user_id, $interval);
// Coin price
$aPrice = $setting->getValue('price');
// Round progress
$iEstShares = round((65536 * $dDifficulty) / pow(2, ($config['difficulty'] - 16)));
$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2);
// Output JSON format
$data = array(
'raw' => array( 'personal' => array( 'hashrate' => $dPersonalHashrate ), 'pool' => array( 'hashrate' => $dPoolHashrate ), 'network' => array( 'hashrate' => $dNetworkHashrate / 1000 ) ),
'personal' => array ( 'hashrate' => $dPersonalHashrateAdjusted, 'sharerate' => $dPersonalSharerate, 'shares' => array('valid' => $aUserRoundShares['valid'], 'invalid' => $aUserRoundShares['invalid']), 'balance' => $transaction->getBalance($user_id), 'estimates' => $aEstimates),
'pool' => array( 'hashrate' => $dPoolHashrateAdjusted, 'shares' => $aRoundShares ),
'personal' => array (
'hashrate' => $dPersonalHashrateAdjusted, 'sharerate' => $dPersonalSharerate, 'sharedifficulty' => $dPersonalShareDifficulty,
'shares' => array('valid' => $aUserRoundShares['valid'], 'invalid' => $aUserRoundShares['invalid'], 'invalid_percent' => $dUserInvalidPercent),
'balance' => $transaction->getBalance($user_id), 'estimates' => $aEstimates, 'workers' => $aWorkers ),
'pool' => array(
'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted,
'shares' => array( 'valid' => $aRoundShares['valid'], 'invalid' => $aRoundShares['invalid'], 'invalid_percent' => $dPoolInvalidPercent, 'estimated' => $iEstShares, 'progress' => $dEstPercent ),
'price' => $aPrice,
'difficulty' => pow(2, $config['difficulty'] - 16),
'target_bits' => $config['difficulty']
),
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
);
echo $api->get_json($data);

View File

@ -0,0 +1,60 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Fetch RPC information
if ($bitcoin->can_connect() === true) {
$dNetworkHashrate = $bitcoin->getnetworkhashps();
$dDifficulty = $bitcoin->getdifficulty();
$iBlock = $bitcoin->getblockcount();
} else {
$dNetworkHashrate = 0;
$dDifficulty = 1;
$iBlock = 0;
}
// Some settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_modifier') ) $dPoolHashrateModifier = 1;
if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1;
// Fetch raw data
$statistics->setGetCache(false);
$dPoolHashrate = $statistics->getCurrentHashrate($interval);
if ($dPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $dPoolHashrate;
$statistics->setGetCache(true);
// Apply pool modifiers
$dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier;
$dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier;
// Use caches for this one
$aRoundShares = $statistics->getRoundShares();
$iTotalRoundShares = $aRoundShares['valid'] + $aRoundShares['invalid'];
if ($iTotalRoundShares > 0) {
$dPoolInvalidPercent = round($aRoundShares['invalid'] / $iTotalRoundShares * 100, 2);
} else {
$dUserInvalidPercent = 0;
$dPoolInvalidPercent = 0;
}
// Round progress
$iEstShares = round((65536 * $dDifficulty) / pow(2, ($config['difficulty'] - 16)));
$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2);
// Output JSON format
$data = array(
'raw' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'pool' => array( 'hashrate' => $dPoolHashrate ) ),
'pool' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted, 'estimated' => $iEstShares, 'progress' => $dEstPercent ),
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
);
echo $api->get_json($data);
// Supress master template
$supress_master = 1;
?>

View File

@ -0,0 +1,9 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -0,0 +1,9 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -8,11 +8,71 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
// Grab the last blocks found
$setting->getValue('statistics_block_count') ? $iLimit = $setting->getValue('statistics_block_count') : $iLimit = 20;
$aBlocksFoundData = $statistics->getBlocksFound($iLimit);
if (@$_REQUEST['limit'] && !empty($_REQUEST['limit']) && is_numeric($_REQUEST['limit'])) {
$iLimit = $_REQUEST['limit'];
if ( $iLimit > 40 )
$iLimit = 40;
}
$iHeight = 0;
if (@$_REQUEST['next'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
$iHeight = @$roundstats->getNextBlockForStats($_REQUEST['height'], $iLimit);
if (!$iHeight) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
}
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
$iHeight = $_REQUEST['height'];
} else if (empty($_REQUEST['height'])) {
$aBlock = $block->getLast();
$iHeight = $aBlock['height'];
}
$test = false;
if (@$_REQUEST['test'] && $user->isAdmin($_SESSION['USERDATA']['id'])) {
$test = true;
$count = 10;
$percent = 30;
if (@$_REQUEST['count'] && is_numeric($_REQUEST['count']))
$count = $_REQUEST['count'];
if (@$_REQUEST['percent'] && is_numeric($_REQUEST['percent']))
$percent = $_REQUEST['percent'];
}
$aBlocksFoundData = $statistics->getBlocksFoundHeight($iHeight, $iLimit);
$use_average = false;
if ($config['payout_system'] == 'pplns') {
foreach($aBlocksFoundData as $key => $aData) {
$aBlocksFoundData[$key]['pplns_shares'] = $roundstats->getPPLNSRoundShares($aData['height']);
if ($setting->getValue('statistics_show_block_average') && !$test) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
$use_average = true;
}
}
} else if ($config['payout_system'] == 'prop' || $config['payout_system'] == 'pps') {
if ($setting->getValue('statistics_show_block_average') && !$test) {
foreach($aBlocksFoundData as $key => $aData) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
$use_average = true;
}
}
}
// show test data in graph
if ($test) {
$use_average = true;
foreach($aBlocksFoundData as $key => $aData) {
if ($_REQUEST['test'] == 1) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $count));
} else if ($_REQUEST['test'] == 2) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $count) * (100 - $percent) / 100 + $aData['shares'] * $percent / 100);
}
}
}
//var_dump($aBlocksFoundData);
// Propagate content our template
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
$smarty->assign("BLOCKLIMIT", $iLimit);
$smarty->assign("USEBLOCKAVERAGE", $use_average);
} else {
$debug->append('Using cached page', 3);
}

View File

@ -6,26 +6,40 @@ if (!defined('SECURITY')) die('Hacking attempt');
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
$iKey = $roundstats->getNextBlock($_REQUEST['height']);
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
$iKey = $roundstats->getPreviousBlock($_REQUEST['height']);
} else {
if (empty($_REQUEST['height'])) {
$iBlock = $block->getLast();
$iKey = $iBlock['height'];
} else {
$iKey = $_REQUEST['height'];
}
if (@$_REQUEST['search']) {
$_REQUEST['height'] = $roundstats->searchForBlockHeight($_REQUEST['search']);
}
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
if ($user->isAdmin(@$_SESSION['USERDATA']['id']) || $setting->getValue('acl_round_transactions')) {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
$iHeight = @$roundstats->getNextBlock($_REQUEST['height']);
if (!$iHeight) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
}
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
$iHeight = $roundstats->getPreviousBlock($_REQUEST['height']);
} else if (empty($_REQUEST['height'])) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
} else {
$aUserRoundTransactions = $roundstats->getUserRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
$iHeight = $_REQUEST['height'];
}
$_REQUEST['height'] = $iHeight;
$iPPLNSShares = 0;
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iHeight);
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iHeight);
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iHeight);
if ($config['payout_system'] == 'pplns') {
$aPPLNSRoundShares = $roundstats->getPPLNSRoundStatsForAccounts($iHeight);
foreach($aPPLNSRoundShares as $aData) {
$iPPLNSShares += $aData['pplns_valid'];
}
$block_avg = $block->getAvgBlockShares($iHeight, $config['pplns']['blockavg']['blockcount']);
$smarty->assign('PPLNSROUNDSHARES', $aPPLNSRoundShares);
$smarty->assign("PPLNSSHARES", $iPPLNSShares);
$smarty->assign("BLOCKAVGCOUNT", $config['pplns']['blockavg']['blockcount']);
$smarty->assign("BLOCKAVERAGE", $block_avg );
}
// Propagate content our template

View File

@ -97,24 +97,6 @@ $aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics'
$aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics');
$aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics');
// We support some dynamic reward targets but fall back to our fixed value
// Special calculations for PPS Values based on reward_type setting and/or available blocks
if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pps_reward = round($block->getAvgBlockReward($config['pps']['blockavg']['blockcount']));
} else {
if ($config['pps']['reward']['type'] == 'block') {
if ($aLastBlock = $block->getLast()) {
$pps_reward = $aLastBlock['amount'];
} else {
$pps_reward = $config['pps']['reward']['default'];
}
} else {
$pps_reward = $config['pps']['reward']['default'];
}
}
$aGlobal['ppsvalue'] = number_format(round($pps_reward / (pow(2,32) * $dDifficulty) * pow(2, $config['pps_target']), 12) ,12);
// We don't want these session infos cached
if (@$_SESSION['USERDATA']['id']) {
$aGlobal['userdata'] = $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array();
@ -126,13 +108,11 @@ if (@$_SESSION['USERDATA']['id']) {
$aGlobal['userdata']['sharerate'] = $statistics->getUserSharerate($_SESSION['USERDATA']['id']);
switch ($config['payout_system']) {
case 'prop' || 'pplns':
case 'prop':
// Some estimations
$aEstimates = $statistics->getUserEstimates($aRoundShares, $aGlobal['userdata']['shares'], $aGlobal['userdata']['donate_percent'], $aGlobal['userdata']['no_fees']);
$aGlobal['userdata']['est_block'] = $aEstimates['block'];
$aGlobal['userdata']['est_fee'] = $aEstimates['fee'];
$aGlobal['userdata']['est_donation'] = $aEstimates['donation'];
$aGlobal['userdata']['est_payout'] = $aEstimates['payout'];
$aGlobal['userdata']['estimates'] = $aEstimates;
break;
case 'pplns':
$aGlobal['pplns']['target'] = $config['pplns']['shares']['default'];
if ($aLastBlock = $block->getLast()) {
@ -140,8 +120,29 @@ if (@$_SESSION['USERDATA']['id']) {
$aGlobal['pplns']['target'] = $iAvgBlockShares;
}
}
$aEstimates = $statistics->getUserEstimates($aRoundShares, $aGlobal['userdata']['shares'], $aGlobal['userdata']['donate_percent'], $aGlobal['userdata']['no_fees']);
$aGlobal['userdata']['estimates'] = $aEstimates;
break;
case 'pps':
// We support some dynamic reward targets but fall back to our fixed value
// Special calculations for PPS Values based on reward_type setting and/or available blocks
if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pps_reward = round($block->getAvgBlockReward($config['pps']['blockavg']['blockcount']));
} else {
if ($config['pps']['reward']['type'] == 'block') {
if ($aLastBlock = $block->getLast()) {
$pps_reward = $aLastBlock['amount'];
} else {
$pps_reward = $config['pps']['reward']['default'];
}
} else {
$pps_reward = $config['pps']['reward']['default'];
}
}
$aGlobal['ppsvalue'] = number_format(round($pps_reward / (pow(2,32) * $dDifficulty) * pow(2, $config['pps_target']), 12) ,12);
$aGlobal['userdata']['sharedifficulty'] = $statistics->getUserShareDifficulty($_SESSION['USERDATA']['id']);
$aGlobal['userdata']['estimates'] = $statistics->getUserEstimates($aGlobal['userdata']['sharerate'], $aGlobal['userdata']['sharedifficulty'], $aGlobal['userdata']['donate_percent'], $aGlobal['userdata']['no_fees'], $aGlobal['ppsvalue']);
break;
}

View File

@ -51,7 +51,13 @@ if (is_dir(INCLUDE_DIR . '/pages/')) {
}
// Set a default action here if no page has been requested
$page = isset($_REQUEST['page']) && isset($arrPages[$_REQUEST['page']]) ? $_REQUEST['page'] : 'home';
if (isset($_REQUEST['page']) && isset($arrPages[$_REQUEST['page']])) {
$page = $_REQUEST['page'];
} else if (isset($_REQUEST['page']) && ! isset($arrPages[$_REQUEST['page']])) {
$page = 'error';
} else {
$page = 'home';
}
// Create our pages array from existing files
if (is_dir(INCLUDE_DIR . '/pages/' . $page)) {

View File

@ -787,7 +787,7 @@ line-height: 150%;
#main h4.info {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin: 20px 30px 0 30px;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
@ -803,7 +803,7 @@ font-size: 14px;}
#main h4.warning {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin: 20px 30px 0 30px;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
@ -819,7 +819,7 @@ font-size: 14px;}
#main h4.errormsg {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin: 20px 30px 0 30px;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
@ -835,7 +835,7 @@ font-size: 14px;}
#main h4.success {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin: 20px 30px 0 30px;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;

View File

@ -0,0 +1,3 @@
{include file="global/block_header.tpl" BLOCK_HEADER="{$GLOBAL.website.name}" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"}
<p>The page you requested was not found.</p>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,3 @@
{include file="global/block_header.tpl" BLOCK_HEADER="{$GLOBAL.website.name}" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"}
<p>The page you requested was not found.</p>
{include file="global/block_footer.tpl"}

View File

@ -1,4 +1,4 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Login" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"}
{include file="global/block_header.tpl" BLOCK_HEADER="Login" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"}
<form action="{$smarty.server.PHP_SELF}?page=login" method="post" id="loginForm">
<p><input type="text" name="username" value="" id="userForm" maxlength="20" required></p>
<p><input type="password" name="password" value="" id="passForm" maxlength="20" required></p>

View File

@ -53,19 +53,19 @@
</tr>
<tr>
<td><b>Block</b></td>
<td class="right">{$GLOBAL.userdata.est_block|number_format:"3"}</td>
<td class="right">{$GLOBAL.userdata.estimates.block|number_format:"3"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td class="right">{$GLOBAL.userdata.est_fee|number_format:"3"}</td>
<td class="right">{$GLOBAL.userdata.estimates.fee|number_format:"3"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td class="right">{$GLOBAL.userdata.est_donation|number_format:"3"}</td>
<td class="right">{$GLOBAL.userdata.estimates.donation|number_format:"3"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td class="right">{$GLOBAL.userdata.est_payout|number_format:"3"}</td>
<td class="right">{$GLOBAL.userdata.estimates.payout|number_format:"3"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -42,17 +42,25 @@
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Estimates</u></b></td></tr>
<tr>
<td><b>in 1 hour</b></td>
<td class="right">{$GLOBAL.userdata.estimates.hours1|round:"8"}</td>
</tr>
<tr>
<td><b>in 24 hours</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.hours24|round:"8"}</td>
</tr>
<tr>
<td><b>in 7 days</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 7 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.days7|round:"8"}</td>
</tr>
<tr>
<td><b>in 14 days</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 14 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.days14|round:"8"}</td>
</tr>
<tr>
<td><b>in 30 days</b></td>
<td class="right">{$GLOBAL.userdata.estimates.days30|round:"8"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -48,19 +48,19 @@
</tr>
<tr>
<td><b>Block</b></td>
<td class="right">{$GLOBAL.userdata.est_block|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.block|number_format:"8"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td class="right">{$GLOBAL.userdata.est_fee|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.fee|number_format:"8"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td class="right">{$GLOBAL.userdata.est_donation|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.donation|number_format:"8"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td class="right">{$GLOBAL.userdata.est_payout|number_format:"8"}</td>
<td class="right">{$GLOBAL.userdata.estimates.payout|number_format:"8"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -21,13 +21,38 @@
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<center><br>
<p style="padding-left:30px; padding-redight:30px; font-size:10px;">
The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on
target and network difficulty and assuming a zero variance scenario.
</p></center>
</p>
<table align="left" width="100%" border="0" style="font-size:13px;">
<tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><img src="{$PATH}/images/next.png" /></i></a>
</td>
</tr>
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
@ -42,6 +67,7 @@ target and network difficulty and assuming a zero variance scenario.
<th class="right">Difficulty</th>
<th class="right">Amount</th>
<th class="right">Expected Shares</th>
{if $GLOBAL.config.payout_system == 'pplns'}<th class="right">PPLNS Shares</th>{/if}
<th class="right">Actual Shares</th>
<th class="right">Percentage</th>
</tr>
@ -51,9 +77,11 @@ target and network difficulty and assuming a zero variance scenario.
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{assign var=pplnsshares value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
{if $GLOBAL.config.payout_system == 'pplns'}{assign var="pplnsshares" value=$pplnsshares+$BLOCKSFOUND[block].pplns_shares}{/if}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
@ -70,6 +98,7 @@ target and network difficulty and assuming a zero variance scenario.
{$BLOCKSFOUND[block].estshares|number_format}
{assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares}
</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$BLOCKSFOUND[block].pplns_shares|number_format}</td>{/if}
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td class="right">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$BLOCKSFOUND[block].estshares}
@ -82,6 +111,7 @@ target and network difficulty and assuming a zero variance scenario.
<tr>
<td colspan="6" class="right"><b>Totals</b></td>
<td class="right">{$totalexpectedshares|number_format}</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$pplnsshares|number_format}</td>{/if}
<td class="right">{$totalshares|number_format}</td>
<td class="right"><font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>
</tr>

View File

@ -15,7 +15,7 @@
{assign var=listed value=0}
{section contrib $CONTRIBHASHES}
{math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate}
<tr{if $GLOBAL.userdata.username == $CONTRIBHASHES[contrib].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBHASHES[contrib].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{$rank++}</td>
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
<td class="right">{($CONTRIBHASHES[contrib].hashrate * $GLOBAL.hashmods.personal)|number_format:"2"}</td>
@ -23,7 +23,7 @@
{if $GLOBAL.config.price.currency}<td class="right">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>{/if}
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:""}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.hashrate|default:"0" > 0}
{if $GLOBAL.userdata.hashrate > 0}{math assign="myestday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$GLOBAL.userdata.hashrate}{/if}
<tr style="background-color:#99EB99;">
<td>n/a</td>

View File

@ -12,13 +12,13 @@
{assign var=rank value=1}
{assign var=listed value=0}
{section shares $CONTRIBSHARES}
<tr{if $GLOBAL.userdata.username == $CONTRIBSHARES[shares].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBSHARES[shares].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{$rank++}</td>
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
<td class="right">{$CONTRIBSHARES[shares].shares|number_format}</td>
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:""}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.shares.valid|default:"0" > 0}
<tr style="background-color:#99EB99;">
<td>n/a</td>
<td>{$GLOBAL.userdata.username|escape}</td>

View File

@ -1,16 +1,24 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Block Stats" STYLE="padding-left:5px;padding-right:5px;"}
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody><tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
<tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="left">Name</th>
<th scope="col">Value</th>
<th scope="col" colspan="2">Block Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|default:"0"}</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
@ -26,7 +34,12 @@
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{$BLOCKDETAILS.confirmations|default:"0"}</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
@ -38,7 +51,7 @@
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|default:"0"}</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
@ -47,19 +60,12 @@
</tbody>
</table></td>
<td class="right">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='height'>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="height" value="{$smarty.request.height|default:"%"}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" class="submit small" value="Search">
</form></td></tr>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
</tbody></table>
{include file="global/block_footer.tpl"}

View File

@ -1,9 +1,14 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Round Statistics" BLOCK_STYLE="clear:none;"}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{if $GLOBAL.config.payout_system == 'pplns'}
{include file="statistics/round/pplns_block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/pplns_round_shares.tpl"}
{include file="statistics/round/pplns_transactions.tpl"}
{else}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{/if}
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,118 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Block Stats" STYLE="padding-left:5px;padding-right:5px;"}
<br>
<center>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" class="submit small" value="Search">
</form>
</center>
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
<tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col" colspan="2">Block Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height}</a></td>
{else}
<td>{$BLOCKDETAILS.height}</td>
{/if}
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
</tr>
</tbody>
</table></td>
{assign var=percentage value=0}
{assign var=percentage1 value=0}
{assign var=percentage2 value=0}
<td class="left"><table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col" colspan="2">PPLNS Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Target Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Average Efficiency</td>
<td>{if $BLOCKAVERAGE > 0 && $BLOCKDETAILS.estshares > 0}{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}{/if}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Round Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table></td></tr>
</tbody></table>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,29 @@
{include file="global/block_header.tpl" ALIGN="right" BLOCK_HEADER="PPLNS Round Shares" }
<center>
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Rank</th>
<th class="left" scope="col">User Name</th>
<th class="right" scope="col">Valid</th>
<th class="right" scope="col">Invalid</th>
<th class="right" scope="col">Invalid %</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{assign var=listed value=0}
{section contrib $PPLNSROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td class="center">{$rank++}</td>
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
<td class="right">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,34 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Round Transactions"}
<center>
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col">User Name</th>
<th class="right" scope="col">Round Shares</th>
<th class="right" scope="col">Round %</th>
<th class="right" scope="col">PPLNS Shares</th>
<th class="right" scope="col">PPLNS Round %</th>
<th class="right" scope="col">Variance</th>
<th class="right" scope="col">Amount</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td class="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
<td class="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
<td class="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
<td class="right">{if $PPLNSROUNDSHARES[txs].pplns_valid > 0 }{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"|default:"0"}{else}0{/if}</td>
<td class="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 && $PPLNSROUNDSHARES[txs].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td class="right">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -12,17 +12,17 @@
</thead>
<tbody>
{assign var=rank value=1}
{assign var=listed value=0}
{section contrib $ROUNDSHARES}
<tr{if $GLOBAL.userdata.username == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td class="center">{$rank++}</td>
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td class="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
<td class="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
<td class="right">{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
<td class="right">{if $ROUNDSHARES[contrib].invalid > 0 }{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -3,18 +3,18 @@
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="left">Tx Id</th>
<th scope="col">User Name</th>
<th scope="col">Type</th>
<th class="right" scope="col">Round %</th>
<th class="right" scope="col">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr class="{cycle values="odd,even"}">
<td>{$ROUNDTRANSACTIONS[txs].id|default:"0"}</td>
<td>{$ROUNDTRANSACTIONS[txs].username|escape}</td>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td class="right">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
<td class="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[txs].valid)|number_format:"2"}</td>
<td class="right">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
</tr>
{/section}
@ -22,3 +22,4 @@
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1 @@
<p>The page you requested was not found.</p>

View File

@ -0,0 +1 @@
<p>The page you requested was not found.</p>

View File

@ -46,19 +46,19 @@
</tr>
<tr>
<td><b>Block</b></td>
<td align="right">{$GLOBAL.userdata.est_block|number_format:"3"}</td>
<td align="right">{$GLOBAL.userdata.estimates.block|number_format:"3"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td align="right">{$GLOBAL.userdata.est_fee|number_format:"3"}</td>
<td align="right">{$GLOBAL.userdata.estimates.fee|number_format:"3"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td align="right">{$GLOBAL.userdata.est_donation|number_format:"3"}</td>
<td align="right">{$GLOBAL.userdata.estimates.donation|number_format:"3"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td align="right">{$GLOBAL.userdata.est_payout|number_format:"3"}</td>
<td align="right">{$GLOBAL.userdata.estimates.payout|number_format:"3"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -35,15 +35,15 @@
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Estimates</u></b></td></tr>
<tr>
<td><b>in 24 hours</b></td>
<td align="right">{($GLOBAL.userdata.sharerate * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.hours24}</td>
</tr>
<tr>
<td><b>in 7 days</b></td>
<td align="right">{($GLOBAL.userdata.sharerate * 7 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.days7}</td>
</tr>
<tr>
<td><b>in 14 days</b></td>
<td align="right">{($GLOBAL.userdata.sharerate * 14 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.days14}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -38,19 +38,19 @@
</tr>
<tr>
<td><b>Block</b></td>
<td align="right">{$GLOBAL.userdata.est_block|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.block|number_format:"8"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td align="right">{$GLOBAL.userdata.est_fee|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.fee|number_format:"8"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td align="right">{$GLOBAL.userdata.est_donation|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.donation|number_format:"8"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td align="right">{$GLOBAL.userdata.est_payout|number_format:"8"}</td>
<td align="right">{$GLOBAL.userdata.estimates.payout|number_format:"8"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>

View File

@ -22,7 +22,7 @@
<td align="right">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>
</tr>
{/section}
{if $listed != 1}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.hashrate|default:"0" > 0}
<tr>
<th>n/a</th>
<td>{$GLOBAL.userdata.username}</td>

View File

@ -17,7 +17,7 @@
<td align="right">{$CONTRIBSHARES[shares].shares|number_format}</td>
</tr>
{/section}
{if $listed != 1}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.shares|default:"0" > 0}
<tr>
<th>n/a</th>
<td>{$GLOBAL.userdata.username}</td>

View File

@ -1,6 +1,6 @@
<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
<input type="hidden" name="do" value="save">
<article class="module width_quarter">
<header>

View File

@ -55,7 +55,7 @@
</fieldset>
<fieldset>
<label>Account</label>
<input size="20" type="text" name="filter[address]" value="{$smarty.request.filter.address|default:""}" />
<input size="20" type="text" name="filter[account]" value="{$smarty.request.filter.account|default:""}" />
</fieldset>
<fieldset>
<label>Address</label>

View File

@ -98,8 +98,8 @@
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='query'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
<input type="text" class="pin" name="query" value="{$smarty.request.query|default:"%"}">
<input type="submit" value="Query" class="alt_btn">
</form>

View File

@ -1,26 +1,47 @@
<article class="module width_quarter">
<header><h3>Account Information</h3></header>
<div class="module_content">
<table class="tablesorter" cellspacing="0">
<tr>
<td colspan="2">
{if $GLOBAL.userdata.no_fees}
<p>You are mining without any pool fees applied.</p>
You are mining without any pool fees applied and
{else if $GLOBAL.fees > 0}
<p>You are mining at <font color="orange">{$GLOBAL.fees|escape}%</font> pool fee.</p>
You are mining at <font color="orange">{$GLOBAL.fees|escape}%</font> pool fee and
{else}
This pool does not apply fees and
{/if}
{if $GLOBAL.userdata.donate_percent > 0}
<p>You are donating <font color="green">{$GLOBAL.userdata.donate_percent|escape}%</font> of your mined coins to the pool.</p>
you donate <font color="green">{$GLOBAL.userdata.donate_percent|escape}%</font>.
{else}
<p>Please consider <a href="{$smarty.server.PHP_SELF}?page=account&action=edit">donating</a> some of your mined coins to the pool operator.</p>
you are not <a href="{$smarty.server.PHP_SELF}?page=account&action=edit">donating</a>.
{/if}
<table width="100%">
<caption style="text-align: left;">{$GLOBAL.config.currency} Account Balance</caption>
<tr>
<th align="left">Confirmed</th>
<td id="b-confirmed" align="right"></td>
</tr>
<tr>
<th align="left">Unconfirmed</th>
<td id="b-unconfirmed" align="right"></td>
</td>
</tr>
</table>
<table class="tablesorter" cellspacing="0">
<thead>
<tr><th colspan="2"><b>{$GLOBAL.config.currency} Account Balance</b></th></tr>
</thead>
<tr>
<td align="left" style="font-weight: bold;">Confirmed</td>
<td align="right"><span id="b-confirmed" class="confirmed" style="width: calc(80px); font-size: 12px;"></span></td>
</tr>
<tr>
<td align="left" style="font-weight: bold;">Unconfirmed</td>
<td align="right"><span id="b-unconfirmed" class="unconfirmed" style="width: calc(80px); font-size: 12px;"></span></td>
</tr>
</table>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="left">Worker</th>
<th align="right">Hashrate</th>
<th align="right" style="padding-right: 10px;">Difficulty</th>
</tr>
</thead>
<tbody id="b-workers">
<td colspan="3" align="center">Loading worker information</td>
</tbody>
</tr>
</table>
</div>
</article>

View File

@ -1,8 +1,7 @@
{if $smarty.session.AUTHENTICATED|default}
{assign var=payout_system value=$GLOBAL.config.payout_system}
{include file="dashboard/overview.tpl"}
{include file="dashboard/system_stats.tpl"}
{include file="dashboard/round_data.tpl"}
{include file="dashboard/account_data.tpl"}
{include file="dashboard/default_$payout_system.tpl"}
{include file="dashboard/js.tpl"}
{/if}

View File

@ -1,66 +0,0 @@
<article class="module width_half">
<header><h3>Dashboard</h3></header>
<div class="module_content">
<table width="100%">
<tbody>
<tr>
<td><b>PPLNS Target</b></td>
<td class="right">{$GLOBAL.pplns.target|number_format}</td>
</tr>
<tr>
<td colspan="2"><b><u>Your Stats</u></b></td>
</tr>
<tr>
<td><b>Hashrate</b></td>
<td class="right">{$GLOBAL.userdata.hashrate|number_format} KH/s</td>
</tr>
<tr>
<td><b>Share Rate</b></td>
<td class="right">{$GLOBAL.userdata.sharerate|number_format:"2"} S/s</td>
</tr>
<tr>
<td colspan="2"><b><u>Round Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span></td>
</tr>
<tr>
<td><b>Pool Valid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Your Valid<b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.valid|number_format}</i><font size='1px'></font></b></td>
</tr>
<tr>
<td><b>Pool Invalid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
<tr>
<td><b>Your Invalid</b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.userdata.shares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
<tr>
<td colspan="2"><b><u>{$GLOBAL.config.currency} Round Estimate</u></b></td>
</tr>
<tr>
<td><b>Block</b></td>
<td class="right">{$GLOBAL.userdata.est_block|number_format:"3"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td class="right">{$GLOBAL.userdata.est_fee|number_format:"3"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td class="right">{$GLOBAL.userdata.est_donation|number_format:"3"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td class="right">{$GLOBAL.userdata.est_payout|number_format:"3"}</td>
</tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>
<tr><td>Confirmed</td><td class="right"><b>{$GLOBAL.userdata.balance.confirmed|default:"0"}</td></tr>
<tr><td>Unconfirmed</td><td class="right"><b>{$GLOBAL.userdata.balance.unconfirmed|default:"0"}</td></tr>
</tbody>
</table>
</div>
</article>

View File

@ -1,62 +0,0 @@
<article class="module width_half">
<header><h3>Dashboard</h3></header>
<div class="module_content">
<table width="100%">
<tbody>
<tr>
<td colspan="2"><b><u>Your Stats</u></b></td>
</tr>
<tr>
<td><b>Hashrate</b></td>
<td class="right">{$GLOBAL.userdata.hashrate|number_format} KH/s</td>
</tr>
<tr>
<td><b>Share Rate</b></td>
<td class="right">{$GLOBAL.userdata.sharerate|number_format:"2"} S/s</td>
</tr>
<tr>
<td><b>PPS Value</b></td>
<td class="right">{$GLOBAL.ppsvalue}</td>
</tr>
<tr>
<td colspan="2"><b><u>Round Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span></td>
</tr>
<tr>
<td><b>Pool Valid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Your Valid</b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Pool Invalid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
<tr>
<td><b>Your Invalid</b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.userdata.shares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Estimates</u></b></td></tr>
<tr>
<td><b>in 24 hours</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
</tr>
<tr>
<td><b>in 7 days</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 7 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
</tr>
<tr>
<td><b>in 14 days</b></td>
<td class="right">{($GLOBAL.userdata.sharerate * 14 * 24 * 60 * 60 * $GLOBAL.ppsvalue)|number_format:"8"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><u>{$GLOBAL.config.currency} Account Balance</u></b></td></tr>
<tr><td>Confirmed</td><td class="right"><b>{$GLOBAL.userdata.balance.confirmed|default:"0"}</td></tr>
<tr><td>Unconfirmed</td><td class="right"><b>{$GLOBAL.userdata.balance.unconfirmed|default:"0"}</td></tr>
</tbody>
</table>
</div>
</article>

View File

@ -1,53 +0,0 @@
<article class="module width_quarter">
<header><h3>Dashboard</h3></header>
<div class="module_content">
<table align="left" width="50%">
<tbody>
<tr>
<td colspan="2"><b><u>Round Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span></td>
</tr>
<tr>
<td><b>Pool Valid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Your Valid<b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.valid|number_format}</i><font size='1px'></font></b></td>
</tr>
<tr>
<td><b>Pool Invalid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
<tr>
<td><b>Your Invalid</b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.userdata.shares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>
</tr>
</tbody>
</table>
<table align="right" width="50%">
<tbody>
<tr>
<td colspan="2"><b><u>{$GLOBAL.config.currency} Round Estimate</u></b></td>
</tr>
<tr>
<td><b>Block</b></td>
<td class="right">{$GLOBAL.userdata.est_block|number_format:"8"}</td>
</tr>
<tr>
<td><b>Fees</b></td>
<td class="right">{$GLOBAL.userdata.est_fee|number_format:"8"}</td>
</tr>
<tr>
<td><b>Donation</b></td>
<td class="right">{$GLOBAL.userdata.est_donation|number_format:"8"}</td>
</tr>
<tr>
<td><b>Payout</b></td>
<td class="right">{$GLOBAL.userdata.est_payout|number_format:"8"}</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
</tbody>
</table>
</div>
</article>

View File

@ -88,11 +88,16 @@ $(document).ready(function(){
// Helper to initilize gauges
function initGauges(data) {
g1 = new JustGage({id: "nethashrate", value: parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.network.hashrate * 2), title: "Net Hashrate", label: "{/literal}{$GLOBAL.hashunits.network}{literal}"});
g2 = new JustGage({id: "poolhashrate", value: parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.pool.hashrate * 2), title: "Pool Hashrate", label: "{/literal}{$GLOBAL.hashunits.pool}{literal}"});
g3 = new JustGage({id: "hashrate", value: parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.personal.hashrate * 2), title: "Hashrate", label: "{/literal}{$GLOBAL.hashunits.personal}{literal}"});
g4 = new JustGage({id: "sharerate", value: parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.personal.sharerate * 2), title: "Sharerate", label: "shares/s"});
g5 = new JustGage({id: "querytime", value: parseFloat(data.getdashboarddata.runtime).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.runtime * 3), title: "Querytime", label: "ms"});
g1 = new JustGage({id: "nethashrate", value: parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.network.hashrate * 2), title: "Net Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.network}{literal}"});
g2 = new JustGage({id: "poolhashrate", value: parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.pool.hashrate * 4), title: "Pool Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.pool}{literal}"});
g3 = new JustGage({id: "hashrate", value: parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.personal.hashrate * 4), title: "Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.personal}{literal}"});
if (data.getdashboarddata.data.personal.sharerate > 1) {
initSharerate = data.getdashboarddata.data.personal.sharerate * 2
} else {
initSharerate = 1
}
g4 = new JustGage({id: "sharerate", value: parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2), min: 0, max: Math.round(initSharerate), gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, title: "Sharerate", label: "shares/s"});
g5 = new JustGage({id: "querytime", value: parseFloat(data.getdashboarddata.runtime).toFixed(0), min: 0, max: Math.round(data.getdashboarddata.runtime * 100), gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, title: "Querytime", label: "ms"});
}
// Helper to refresh graphs
@ -101,7 +106,7 @@ $(document).ready(function(){
g2.refresh(parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2));
g3.refresh(parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2));
g4.refresh(parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2));
g5.refresh(parseFloat(data.getdashboarddata.runtime).toFixed(2));
g5.refresh(parseFloat(data.getdashboarddata.runtime).toFixed(0));
if (storedPersonalHashrate.length > 20) { storedPersonalHashrate.shift(); }
if (storedPoolHashrate.length > 20) { storedPoolHashrate.shift(); }
if (storedPersonalSharerate.length > 20) { storedPersonalSharerate.shift(); }
@ -135,6 +140,48 @@ $(document).ready(function(){
function refreshStaticData(data) {
$('#b-confirmed').html(data.getdashboarddata.data.personal.balance.confirmed);
$('#b-unconfirmed').html(data.getdashboarddata.data.personal.balance.unconfirmed);
$('#b-price').html((parseFloat(data.getdashboarddata.data.pool.price).toFixed(4)));
$('#b-dworkers').html(data.getdashboarddata.data.pool.workers);
$('#b-hashrate').html((parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2)));
$('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2)));
$('#b-yvalid').html(data.getdashboarddata.data.personal.shares.valid);
$('#b-yivalid').html(data.getdashboarddata.data.personal.shares.invalid + " (" + data.getdashboarddata.data.personal.shares.invalid_percent + "%)" );
$('#b-pvalid').html(data.getdashboarddata.data.pool.shares.valid);
$('#b-pivalid').html(data.getdashboarddata.data.pool.shares.invalid + " (" + data.getdashboarddata.data.pool.shares.invalid_percent + "%)" );
$('#b-diff').html(data.getdashboarddata.data.network.difficulty);
$('#b-nblock').html(data.getdashboarddata.data.network.block);
$('#b-target').html(data.getdashboarddata.data.pool.shares.estimated + " (done: " + data.getdashboarddata.data.pool.shares.progress + "%)" );
{/literal}{if $GLOBAL.config.payout_system != 'pps'}{literal }
$('#b-payout').html((parseFloat(data.getdashboarddata.data.personal.estimates.payout).toFixed(4)));
$('#b-block').html((parseFloat(data.getdashboarddata.data.personal.estimates.block).toFixed(4)));
$('#b-fee').html((parseFloat(data.getdashboarddata.data.personal.estimates.fee).toFixed(4)));
$('#b-donation').html((parseFloat(data.getdashboarddata.data.personal.estimates.donation).toFixed(4)));
{/literal}{else}{literal}
$('#b-ppsdiff').html((parseFloat(data.getdashboarddata.data.personal.sharedifficulty).toFixed(2)));
$('#b-est1').html((parseFloat(data.getdashboarddata.data.personal.estimates.hours1).toFixed(8)));
$('#b-est24hours').html((parseFloat(data.getdashboarddata.data.personal.estimates.hours24).toFixed(8)));
$('#b-est7days').html((parseFloat(data.getdashboarddata.data.personal.estimates.days7).toFixed(8)));
$('#b-est14days').html((parseFloat(data.getdashboarddata.data.personal.estimates.days14).toFixed(8)));
$('#b-est30days').html((parseFloat(data.getdashboarddata.data.personal.estimates.days30).toFixed(8)));
{/literal}{/if}{literal}
{/literal}{if $GLOBAL.config.payout_system == 'pplns'}{literal}
$('#b-pplns').html({/literal}{$GLOBAL.pplns.target}{literal});
{/literal}{/if}{literal}
}
// Refresh worker information
function refreshWorkerData(data) {
data = data.getdashboarddata.data;
workers = data.personal.workers;
length = workers.length;
$('#b-workers').html('');
for (var i = j = 0; i < length; i++) {
if (workers[i].hashrate > 0) {
j++;
$('#b-workers').append('<tr><td>' + workers[i].username + '</td><td align="right">' + workers[i].hashrate + '</td><td align="right">' + workers[i].difficulty + '</td></tr>');
}
}
if (j == 0) { $('#b-workers').html('<tr><td colspan="3" align="center">No active workers</td></tr>'); }
}
// Our worker process to keep gauges and graph updated
@ -145,6 +192,7 @@ $(document).ready(function(){
success: function(data) {
refreshInformation(data);
refreshStaticData(data);
refreshWorkerData(data);
},
complete: function() {
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"10000"}{literal})

View File

@ -0,0 +1,11 @@
<tr>
<td colspan="2"><b><u>Network Info</u></b></td>
</tr>
<tr>
<td><b>Difficulty</b></td>
<td id="b-diff" class="right"></td>
</tr>
<tr>
<td><b>Current Block</b></td>
<td id="b-nblock" class="right"></td>
</tr>

View File

@ -1,18 +1,20 @@
<article class="module width_full">
<header><h3>Overview</h3></header>
<article class="module module width_3_quarter">
<header><h3>Overview {if $GLOBAL.config.price.currency}{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: <span id="b-price"></span>{/if} / Pool Workers: <span id="b-dworkers"></span></h3></header>
<div class="module_content">
<center>
<div style="display: inline-block;">
<div id="poolhashrate" style="width:100px; height:80px;"></div>
<div id="sharerate" style="width:100px; height:80px;"></div>
<div id="poolhashrate" style="width:120px; height:90px;"></div>
<div id="sharerate" style="width:120px; height:90px;"></div>
</div>
<div style="display: inline-block;">
<div id="hashrate" style="width:200px; height:160px;"></div>
<div id="hashrate" style="width:220px; height:180px;"></div>
</div>
<div style="display: inline-block;">
<div id="nethashrate" style="width:100px; height:80px;"></div>
<div id="querytime" style="width:100px; height:80px;"></div>
<div id="nethashrate" style="width:120px; height:90px;"></div>
<div id="querytime" style="width:120px; height:90px;"></div>
</div>
<div style="margin-left: 50px; display: inline-block; width: 70%;">
</center>
<div style="margin-left: 16px; display: inline-block; width: 100%;">
<div id="hashrategraph" style="height: 160px; width: 100%;"></div>
</div>
</div>

View File

@ -0,0 +1,43 @@
<tr>
<td colspan="2"><b><u>{$GLOBAL.config.currency} Estimates</u></b></td>
</tr>
{if $GLOBAL.config.payout_system != 'pps'}
<tr>
<td><b>Block</b></td>
<td id="b-block" class="right"></td>
</tr>
<tr>
<td><b>Fees</b></td>
<td id="b-fee" class="right"></td>
</tr>
<tr>
<td><b>Donation</b></td>
<td id="b-donation" class="right"></td>
</tr>
<tr>
<td><b>Payout</b></td>
<td id="b-payout" class="right"></td>
</tr>
{else}
<tr>
<td><b>in 1 hour</b></td>
<td id="b-est1hour" align="left">{$GLOBAL.userdata.estimates.hours1|round:"8"}</td>
</tr>
<tr>
<td><b>in 24 hours</b></td>
<td id="b-est24hours" align="left">{($GLOBAL.userdata.estimates.hours24)|round:"8"}</td>
</tr>
<tr>
<td><b>in 7 days</b></td>
<td id="b-est7days" align="left">{($GLOBAL.userdata.estimates.days7)|round:"8"}</td>
</tr>
<tr>
<td><b>in 14 days</b></td>
<td id="b-est14days" align="left">{($GLOBAL.userdata.estimates.days14)|round:"8"}</td>
</tr>
<tr>
<td><b>in 30 days</b></td>
<td id="b-est30days" align="left">{($GLOBAL.userdata.estimates.days30)|round:"8"}</td>
</tr>
{/if}

View File

@ -1,4 +1,4 @@
<article class="module width_quarter">
<article class="module width_3_quarter">
<header><h3>Round Information</h3></header>
<div class="module_content">
<div id="shareinfograph" style="width: 100%; height: 150px;"></div>

View File

@ -0,0 +1,23 @@
<tr>
<td colspan="2"><b><u>Round Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span></td>
</tr>
<tr>
<td><b>Est. Shares</b></td>
<td id="b-target" class="right"></td>
</tr>
<tr>
<td><b>Pool Valid</b></td>
<td id="b-pvalid" class="right"></td>
</tr>
<tr>
<td><b>Your Valid<b></td>
<td id="b-yvalid" class="right"></td>
</tr>
<tr>
<td><b>Pool Invalid</b></td>
<td id="b-pivalid" class="right"></td>
</tr>
<tr>
<td><b>Your Invalid</b></td>
<td id="b-yivalid" class="right"></td>
</tr>

View File

@ -0,0 +1,32 @@
<article class="module width_quarter">
<header><h3>{$GLOBAL.config.payout_system|capitalize} Stats</h3></header>
<div class="module_content">
<table width="100%">
<tbody>
{if $GLOBAL.config.payout_system == 'pplns'}
<tr>
<td><b>PPLNS Target</b></td>
<td id="b-pplns" class="right"></td>
</tr>
{elseif $GLOBAL.config.payout_system == 'pps'}
<tr>
<td><b>PPS Value</b></td>
<td>{$GLOBAL.ppsvalue}</td>
</tr>
<tr>
<td><b>PPS Difficulty</b></td>
<td id="b-ppsdiff">{$GLOBAL.userdata.sharedifficulty|number_format:"2"}</td>
</tr>
{/if}
<tr><td colspan="2">&nbsp;</td></tr>
{include file="dashboard/round_shares.tpl"}
<tr><td colspan="2">&nbsp;</td></tr>
{include file="dashboard/payout_estimates.tpl"}
<tr><td colspan="2">&nbsp;</td></tr>
{include file="dashboard/network_info.tpl"}
<tr><td colspan="2">&nbsp;</td></tr>
</tbody>
</table>
</div>
</article>

View File

@ -0,0 +1,16 @@
<article class="module width_quarter">
<header><h3>Active Worker Information</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="left">Worker</th>
<th align="right">Hashrate</th>
<th align="right">Difficulty</th>
</tr>
</thead>
<tbody id="b-workers">
<td colspan="3" align="center">Loading worker information</td>
</tbody>
</tr>
</table>
</article>

View File

@ -0,0 +1,6 @@
<article class="module width_full">
<header><h3>{$GLOBAL.website.name}</h3></header>
<div class="module_content">
<p>The page you requested was not found.</p>
</div>
</article>

View File

@ -0,0 +1,6 @@
<article class="module width_full">
<header><h3>{$GLOBAL.website.name}</h3></header>
<div class="module_content">
<p>The page you requested was not found.</p>
</div>
</article>

View File

@ -1,3 +1,3 @@
<div class="breadcrumbs_container">
<article class="breadcrumbs"><a href="{$smarty.server.PHP_SELF}">{$GLOBAL.website.name}</a> <div class="breadcrumb_divider"></div> <a class="{if ! $smarty.request.action|default:""}current{/if}" {if $smarty.request.action|default:""}href="{$smarty.server.PHP_SELF}?page={$smarty.request.page|default:"home"}"{/if}>{$smarty.request.page|default:"Home"|capitalize}</a>{if $smarty.request.action|default:""} <div class="breadcrumb_divider"></div> <a class="current">{$smarty.request.action|capitalize}</a>{/if}</article>
<article class="breadcrumbs"><a href="{$smarty.server.PHP_SELF}">{$GLOBAL.website.name}</a> <div class="breadcrumb_divider"></div> <a class="{if ! $smarty.request.action|default:""}current{/if}" {if $smarty.request.action|default:""}href="{$smarty.server.PHP_SELF}?page={$smarty.request.page|default:"home"}"{/if}>{$smarty.request.page|escape|default:"Home"|capitalize}</a>{if $smarty.request.action|default:""} <div class="breadcrumb_divider"></div> <a class="current">{$smarty.request.action|escape|capitalize}</a>{/if}</article>
</div>

View File

@ -1,5 +1,5 @@
<hgroup>
<h1 class="site_title">{$GLOBAL.website.name}</h1>
<h2 class="section_title">{if $smarty.request.action|default:""}{$smarty.request.action|capitalize}{else}{$smarty.request.page|default:"home"|capitalize}{/if}</h2>
<h2 class="section_title">{if $smarty.request.action|escape|default:""}{$smarty.request.action|escape|capitalize}{else}{$smarty.request.page|escape|default:"home"|capitalize}{/if}</h2>
</hgroup>
{include file="login/small.tpl"}

View File

@ -67,4 +67,21 @@
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=support">Support</a></li>
{/if}
</ul>
<ul>
<hr/>
</ul>
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
<br />
{else}
<ul>
<center>
<div style="display: inline-block;">
<i><u><b><font size="2">LIVE STATS</font></b></u></i>
<div id="mr" style="width:180px; height:120px;"></div>
<div id="hr" style="width:180px; height:120px;"></div>
</div>
</center>
</ul>
<hr/>
{include file="global/navjs.tpl"}
{/if}

View File

@ -0,0 +1,87 @@
<script>
{literal}
$(document).ready(function(){
var g1, g2;
// Ajax API URL
var url = "{/literal}{$smarty.server.PHP_SELF}?page=api&action=getnavbardata{literal}";
// Store our data globally
var storedHashrate=[];
var storedWorkers=[];
// Helper to initilize gauges
function initGauges(data) {
g1 = new JustGage({
id: "mr",
value: parseFloat(data.getnavbardata.data.pool.workers).toFixed(0),
min: 0,
max: Math.round(data.getnavbardata.data.pool.workers * 4),
title: "Miners",
gaugeColor: '#6f7a8a',
labelFontColor: '#555',
titleFontColor: '#555',
valueFontColor: '#555',
label: "Active Miners",
relativeGaugeSize: true,
showMinMax: true,
shadowOpacity : 0.8,
shadowSize : 0,
shadowVerticalOffset : 10
});
g2 = new JustGage({
id: "hr",
value: parseFloat(data.getnavbardata.data.pool.hashrate).toFixed(2),
min: 0,
max: Math.round(data.getnavbardata.data.pool.hashrate * 4),
title: "Pool Hasrate",
gaugeColor: '#6f7a8a',
labelFontColor: '#555',
titleFontColor: '#555',
valueFontColor: '#555',
label: "{/literal}{$GLOBAL.hashunits.pool}{literal}",
relativeGaugeSize: true,
showMinMax: true,
shadowOpacity : 0.8,
shadowSize : 0,
shadowVerticalOffset : 10
});
}
// Helper to refresh graphs
function refreshInformation(data) {
g1.refresh(parseFloat(data.getnavbardata.data.pool.workers).toFixed(0));
g2.refresh(parseFloat(data.getnavbardata.data.pool.hashrate).toFixed(2));
if (storedWorkers.length > 20) { storedWorkers.shift(); }
if (storedHashrate.length > 20) { storedHashrate.shift(); }
timeNow = new Date().getTime();
storedWorkers[storedWorkers.length] = [timeNow, data.getnavbardata.data.raw.pool.workers];
storedHashrate[storedHashrate.length] = [timeNow, data.getnavbardata.data.raw.pool.hashrate];
}
// Fetch initial data via Ajax, starts proper gauges to display
$.ajax({
url: url,
async: false, // Run all others requests after this only if it's done
dataType: 'json',
success: function (data) { initGauges(data); }
});
// Our worker process to keep gauges and graph updated
(function worker() {
$.ajax({
url: url,
dataType: 'json',
success: function(data) {
refreshInformation(data);
},
complete: function() {
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"1000"}{literal})
}
});
})();
});
{/literal}
</script>

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>{$GLOBAL.website.title} I {$smarty.request.page|default:"home"|capitalize}</title>
<title>{$GLOBAL.website.title} I {$smarty.request.page|escape|default:"home"|capitalize}</title>
<link rel="stylesheet" href="{$PATH}/css/layout.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{$PATH}/css/fontello.css">
@ -20,7 +20,6 @@
<script type="text/javascript" src="{$PATH}/js/hideshow.js" type="text/javascript"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.visualize.js"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.tooltip.visualize.js"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.tablesorter.pager.js" type="text/javascript"></script>
<script type="text/javascript" src="{$PATH}/js/jquery.equalHeight.js"></script>

View File

@ -22,6 +22,30 @@
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<footer>
@ -44,6 +68,7 @@
<th align="right">Difficulty</th>
<th align="right">Amount</th>
<th align="right">Expected Shares</th>
{if $GLOBAL.config.payout_system == 'pplns'}<th align="right">PPLNS Shares</th>{/if}
<th align="right">Actual Shares</th>
<th align="right" style="padding-right: 25px;">Percentage</th>
</tr>
@ -53,9 +78,11 @@
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{assign var=pplnsshares value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
{if $GLOBAL.config.payout_system == 'pplns'}{assign var="pplnsshares" value=$pplnsshares+$BLOCKSFOUND[block].pplns_shares}{/if}
<tr class="{cycle values="odd,even"}">
{if ! $GLOBAL.website.blockexplorer.disabled}
<td align="center"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
@ -80,6 +107,7 @@
{assign var="totalexpectedshares" value=$totalexpectedshares+$estshares}
{$estshares|number_format}
</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td align="right">{$BLOCKSFOUND[block].pplns_shares|number_format}</td>{/if}
<td align="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td align="right" style="padding-right: 25px;">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$estshares}
@ -91,8 +119,9 @@
<tr>
<td colspan="6" align="right"><b>Totals</b></td>
<td align="right">{$totalexpectedshares|number_format}</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td align="right">{$pplnsshares|number_format}</td>{/if}
<td align="right">{$totalshares|number_format}</td>
<td align="right" style="padding-right: 25px;">{if $count > 0}<font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>{else}0{/if}</td>
<td align="right" style="padding-right: 25px;">{if $count > 0}<font color="{if (($totalshares / $totalexpectedshares * 100) <= 100)}green{else}red{/if}">{($totalshares / $totalexpectedshares * 100)|number_format:"2"}</font>{else}0{/if}</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,30 @@
<script>
{literal}
$(document).ready(function(){
// Ajax API URL
var url = "{/literal}{$smarty.server.PHP_SELF}?page=api&action=getnavbardata{literal}";
function refreshStaticData(data) {
$('#b-workers').html((parseFloat(data.getnavbardata.data.pool.workers).toFixed(0)));
$('#b-hashrate').html((parseFloat(data.getnavbardata.data.pool.hashrate).toFixed(3)));
$('#b-target').html(data.getnavbardata.data.pool.estimated + " (done: " + data.getnavbardata.data.pool.progress + "%)");
$('#b-diff').html(data.getnavbardata.data.network.difficulty);
}
// Our worker process to keep gauges and graph updated
(function worker() {
$.ajax({
url: url,
dataType: 'json',
success: function(data) {
refreshStaticData(data);
},
complete: function() {
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"10000"}{literal})
}
});
})();
});
{/literal}
</script>

View File

@ -17,7 +17,7 @@
{assign var=listed value=0}
{section contrib $CONTRIBHASHES}
{math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate}
<tr{if $GLOBAL.userdata.username|default:"" == $CONTRIBHASHES[contrib].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBHASHES[contrib].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td align="right">{if $CONTRIBHASHES[contrib].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
@ -26,7 +26,7 @@
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 25px;">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>{/if}
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:""}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.hashrate|default:"0" > 0}
{if $GLOBAL.userdata.hashrate > 0}{math assign="myestday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$GLOBAL.userdata.hashrate}{/if}
<tr>
<td align="center">n/a</td>

View File

@ -13,14 +13,14 @@
{assign var=rank value=1}
{assign var=listed value=0}
{section shares $CONTRIBSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $CONTRIBSHARES[shares].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBSHARES[shares].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td align="right">{if $CONTRIBSHARES[shares].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
<td align="right" style="padding-right: 25px;">{$CONTRIBSHARES[shares].shares|number_format}</td>
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:""}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.shares.valid|default:"0" > 0}
<tr>
<td align="center">n/a</td>
<td align="right">{if $GLOBAL.userdata.donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>

View File

@ -5,3 +5,5 @@
{include file="statistics/pool/general_stats.tpl"}
{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true}
{include file="statistics/js.tpl"}

View File

@ -5,7 +5,7 @@
<tbody>
<tr>
<th align="left" width="30%">Pool Hash Rate</th>
<td width="70%">{($GLOBAL.hashrate)|number_format:"3"} {$GLOBAL.hashunits.pool}</td>
<td width="70%"><span id="b-hashrate"></span> {$GLOBAL.hashunits.pool}</td>
</tr>
<tr>
<th align="left">Pool Efficiency</td>
@ -13,7 +13,7 @@
</tr>
<tr>
<th align="left">Current Active Workers</td>
<td>{$GLOBAL.workers}</td>
<td id="b-workers"></td>
</tr>
{if ! $GLOBAL.website.blockexplorer.disabled}
<tr>
@ -33,9 +33,9 @@
<tr>
<th align="left">Current Difficulty</td>
{if ! $GLOBAL.website.chaininfo.disabled}
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2"><span id="b-diff"></span></font></a></td>
{else}
<td><font size="2">{$DIFFICULTY}</font></td>
<td><font size="2"><span id="b-diff"></span></font></td>
{/if}
</tr>
<tr>
@ -44,7 +44,7 @@
</tr>
<tr>
<th align="left">Est. Shares this Round</td>
<td>{(pow(2, 32 - $GLOBAL.config.targetdiff) * $DIFFICULTY)|number_format:"0"} <font size="1">(done: {(100 / (pow(2, 32 - $GLOBAL.config.targetdiff) * $DIFFICULTY) * $GLOBAL.roundshares.valid)|number_format:"2"} %)</td>
<td id="b-target"></td>
</tr>
<tr>
<th align="left">Time Since Last Block</td>

View File

@ -3,46 +3,39 @@
<table class="tablesorter">
<tbody>
<tr>
<td class="left">
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td class="right">
<td colspan="7" align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|default:"0"}</td>
</tr>
<tr class="even">
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height}</a></td>
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height}</td>
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>{$BLOCKDETAILS.amount|number_format|default:"0"}</td>
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{$BLOCKDETAILS.confirmations|default:"0"}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|default:"0"}</td>
</tr>
<tr class="even">
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
</tr>
@ -50,10 +43,10 @@
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='height'>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="height" value="{$smarty.request.height|default:"%"}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>

View File

@ -1,3 +1,13 @@
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{if $GLOBAL.config.payout_system == 'pplns'}
{include file="statistics/round/pplns_block_stats.tpl"}
{include file="statistics/round/pplns_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/pplns_round_shares.tpl"}
{else if $GLOBAL.config.payout_system == 'prop'}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{else}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{/if}

View File

@ -0,0 +1,95 @@
<article class="module width_full">
<header><h3>Round Statistics</h3></header>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right" colspan="4">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<table class="tablesorter">
<tbody>
<thead>
<tr>
<th align="center" colspan="2">Block Statistics</th>
<th align="center" colspan="2">PPLNS Round Statistics</th>
</tr>
</thead>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>Target Variance</td>
{assign var=percentage value=0}
{assign var=percentage1 value=0}
{assign var=percentage2 value=0}
<td>{if $PPLNSSHARES > 0}{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
<td>Average Efficiency</td>
<td>{if $BLOCKAVERAGE > 0 && $BLOCKDETAILS.estshares > 0}{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}{/if}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
<td>Round Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>
</footer>
</article>

View File

@ -0,0 +1,84 @@
<article class="module width_full">
<header><h3>Block Statistics</h3></header>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right" colspan="4">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<table class="tablesorter">
<tbody>
<thead>
<tr>
<th align="center" colspan="4">Block Statistics</th>
<th align="center" colspan="4">PPLNS Round Statistics</th>
</tr>
</thead>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
<td>Average Efficiency</td>
<td>{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
<td>Target Variance</td>
<td>{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
<td>Round Variance</td>
<td>{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>
</footer>
</article>

View File

@ -0,0 +1,26 @@
<article class="module width_half">
<header><h3>PPLNS Round Shares</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">Rank</th>
<th align="left" >User Name</th>
<th align="right" >Valid</th>
<th align="right" >Invalid</th>
<th align="right" style="padding-right: 25px;">Invalid %</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{section contrib $PPLNSROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
<td align="right" style="padding-right: 25px;">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -0,0 +1,32 @@
<article class="module width_full">
<header><h3>Round Transactions</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th >User Name</th>
<th align="right">Round Shares</th>
<th align="right">Round %</th>
<th align="right">PPLNS Shares</th>
<th align="right">PPLNS Round %</th>
<th align="right">Variance</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="right">{$ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid|number_format}</td>
<td align="right">{if $ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid)|number_format:"2"}{else}0.00{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
<td align="right">{if $PPLNSROUNDSHARES[txs].pplns_valid > 0 }{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"|default:"0"}{else}0{/if}</td>
<td align="right">{if $ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid > 0 && $PPLNSROUNDSHARES[txs].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -0,0 +1,39 @@
<article class="module width_full">
<header><h3>Round Statistics</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th >User Name</th>
<th align="right">Round Valid</th>
<th align="right">Invalid</th>
<th align="right">Invalid %</th>
<th align="right">Round %</th>
<th align="right">PPLNS Valid</th>
<th align="right">Invalid</th>
<th align="right">Invalid %</th>
<th align="right">PPLNS Round %</th>
<th align="right">Variance</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid|number_format}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid > 0 }{($SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid / $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_invalid|number_format}</td>
<td align="right">{if $PPLNSROUNDSHARES[txs].pplns_invalid > 0 }{($PPLNSROUNDSHARES[txs].pplns_invalid / $PPLNSROUNDSHARES[txs].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
<td align="right">{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -13,15 +13,15 @@
<tbody>
{assign var=rank value=1}
{assign var=listed value=0}
{section contrib $ROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
{foreach key=id item=data from=$ROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $data.username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td align="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
<td align="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
<td align="right" style="padding-right: 25px;">{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
<td>{if $data.is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$data.username|escape}{/if}</td>
<td align="right">{$data.valid|number_format}</td>
<td align="right">{$data.invalid|number_format}</td>
<td align="right" style="padding-right: 25px;">{if $data.invalid > 0 }{($data.invalid / $data.valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
{/foreach}
</tbody>
</table>
</article>

View File

@ -3,18 +3,20 @@
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">TX #</th>
<th>User Name</th>
<th align="center">Type</th>
<th align="right">Round Shares</th>
<th align="right" scope="col">Round %</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr class="{cycle values="odd,even"}">
<td align="center">{$ROUNDTRANSACTIONS[txs].id|default:"0"}</td>
<td>{$ROUNDTRANSACTIONS[txs].username|escape}</td>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="center">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
<td align="right">{$ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid|number_format}</td>
<td align="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[$ROUNDTRANSACTIONS[txs].uid].valid)|default:"0"|number_format:"2"}</td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
</tr>
{/section}

View File

@ -164,6 +164,8 @@ CREATE TABLE IF NOT EXISTS `statistics_shares` (
`block_id` int(10) unsigned NOT NULL,
`valid` int(11) NOT NULL,
`invalid` int(11) NOT NULL DEFAULT '0',
`pplns_valid` int(11) NOT NULL,
`pplns_invalid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `account_id` (`account_id`),
KEY `block_id` (`block_id`)

View File

@ -0,0 +1,2 @@
ALTER TABLE `statistics_shares` ADD `pplns_valid` int(11) NOT NULL AFTER `invalid` ;
ALTER TABLE `statistics_shares` ADD `pplns_invalid` int(11) NOT NULL DEFAULT 0 AFTER `pplns_valid` ;