css: add css classes to user and pool block status

and rename exchange state to pending if auto exchange is not enabled
This commit is contained in:
Tanguy Pruvot 2016-08-20 20:47:21 +02:00
parent 4ef1a8103c
commit e3a1ed8d33
2 changed files with 53 additions and 31 deletions

View file

@ -27,18 +27,29 @@ $criteria->limit = $count;
$criteria->order = 't.time DESC'; $criteria->order = 't.time DESC';
$db_blocks = getdbolistWith('db_blocks', 'coin', $criteria); $db_blocks = getdbolistWith('db_blocks', 'coin', $criteria);
echo "<table class='dataGrid2'>"; echo <<<EOT
echo "<thead>";
echo "<tr>"; <style type="text/css">
echo "<td></td>"; span.block { padding: 2px; display: inline-block; text-align: center; min-width: 75px; }
echo "<th>Name</th>"; span.block.new { color: white; background-color: #ad4ef0; }
echo "<th align=right>Amount</th>"; span.block.orphan { color: white; background-color: #d9534f; }
echo "<th align=right>Difficulty</th>"; span.block.immature { color: white; background-color: #f0ad4e; }
echo "<th align=right>Block</th>"; span.block.confirmed { color: white; background-color: #5cb85c; }
echo "<th align=right>Time</th>"; </style>
echo "<th align=right>Status</th>";
echo "</tr>"; <table class="dataGrid2">
echo "</thead>"; <thead>
<tr>
<td></td>
<th>Name</th>
<th align="right">Amount</th>
<th align="right">Difficulty</th>
<th align="right">Block</th>
<th align="right">Time</th>
<th align="right">Status</th>
</tr>
</thead>
EOT;
foreach($db_blocks as $db_block) foreach($db_blocks as $db_block)
{ {
@ -82,16 +93,16 @@ foreach($db_blocks as $db_block)
echo "<td align=right style='font-size: .8em'>"; echo "<td align=right style='font-size: .8em'>";
if($db_block->category == 'orphan') if($db_block->category == 'orphan')
echo "<span style='padding: 2px; color: white; background-color: #d9534f'>Orphan</span>"; echo '<span class="block orphan">Orphan</span>';
else if($db_block->category == 'immature') else if($db_block->category == 'immature')
echo "<span style='padding: 2px; color: white; background-color: #f0ad4e'>Immature ($db_block->confirmations)</span>"; echo '<span class="block immature">Immature ('.$db_block->confirmations.')</span>';
else if($db_block->category == 'generate') else if($db_block->category == 'generate')
echo "<span style='padding: 2px; color: white; background-color: #5cb85c'>Confirmed</span>"; echo '<span class="block confirmed">Confirmed</span>';
else if($db_block->category == 'new') else if($db_block->category == 'new')
echo "<span style='padding: 2px; color: white; background-color: #ad4ef0'>New</span>"; echo '<span class="block new">New</span>';
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";

View file

@ -18,18 +18,29 @@ $count = $count? $count: 50;
WriteBoxHeader("Last $count Earnings: $user->username"); WriteBoxHeader("Last $count Earnings: $user->username");
$earnings = getdbolist('db_earnings', "userid=$user->id order by create_time desc limit :count", array(':count'=>$count)); $earnings = getdbolist('db_earnings', "userid=$user->id order by create_time desc limit :count", array(':count'=>$count));
echo "<table class='dataGrid2'>"; echo <<<EOT
echo "<thead>";
echo "<tr>"; <style type="text/css">
echo "<td></td>"; span.block { padding: 2px; display: inline-block; text-align: center; min-width: 75px; }
echo "<th>Name</th>"; span.block.immature { color: white; background-color: #f0ad4e; }
echo "<th align=right>Amount</th>"; span.block.exchange { color: white; background-color: #5cb85c; }
echo "<th align=right>Percent</th>"; span.block.cleared { color: white; background-color: #5cb85c; }
echo "<th align=right>mBTC</th>"; </style>
echo "<th align=right>Time</th>";
echo "<th align=right>Status</th>"; <table class="dataGrid2">
echo "</tr>"; <thead>
echo "</thead>"; <tr>
<td></td>
<th>Name</th>
<th align=right>Amount</th>
<th align=right>Percent</th>
<th align=right>mBTC</th>
<th align=right>Time</th>
<th align=right>Status</th>
</tr>
</thead>
EOT;
$showrental = (bool) YAAMP_RENTAL; $showrental = (bool) YAAMP_RENTAL;
@ -81,13 +92,13 @@ foreach($earnings as $earning)
echo "<td align=right style='font-size: .8em'>"; echo "<td align=right style='font-size: .8em'>";
if($earning->status == 0) if($earning->status == 0)
echo "Immature ($block->confirmations)"; echo '<span class="block immature">Immature ('.$block->confirmations.')</span>';
else if($earning->status == 1) else if($earning->status == 1)
echo 'Exchange'; echo '<span class="block exchange">'.(YAAMP_ALLOW_EXCHANGE ? 'Exchange' : 'Pending').'</span>';
else if($earning->status == 2) else if($earning->status == 2)
echo 'Cleared'; echo '<span class="block cleared">Cleared</span>';
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";