示例#1
0
            <th><?php 
    echo _("Trades");
    ?>
</th>
        </tr><?php 
    do {
        $orderid = $row['orderid'];
        $amount = $row['amount'];
        $initial_amount = $row['initial_amount'];
        $type = $row['type'];
        $initial_want_amount = $row['initial_want_amount'];
        $want_type = $row['want_type'];
        $timest = $row['timest'];
        // $timest = str_replace(" ", "<br/>", $timest);
        $status_code = $row['status'];
        $status = translate_order_code($status_code);
        $price = $type == 'BTC' ? fiat_and_btc_to_price($initial_want_amount, $initial_amount) : fiat_and_btc_to_price($initial_amount, $initial_want_amount);
        $percent_complete = sprintf("%.0f", bcdiv(gmp_strval(gmp_mul(gmp_sub($initial_amount, $amount), 100)), $initial_amount, 1));
        $trade_count = count_transactions($orderid);
        $give_precision = $type == 'BTC' ? BTC_PRECISION : FIAT_PRECISION;
        $want_precision = $type == 'BTC' ? FIAT_PRECISION : BTC_PRECISION;
        echo "    ", active_table_row("active", "?page=view_order&orderid={$orderid}"), "\n";
        echo "        <td class='right'>" . internal_to_numstr($initial_amount, $give_precision) . "&nbsp;{$type}</td>\n";
        echo "        <td class='right'>" . internal_to_numstr($initial_want_amount, $want_precision) . "&nbsp;{$want_type}</td>\n";
        echo "        <td class='right'>{$price}</td>\n";
        echo "        <td>{$timest}</td>\n";
        echo "        <td>{$status} ({$percent_complete}%)</td>\n";
        echo "        <td>{$trade_count}</td>\n";
        echo "    </tr>\n";
    } while ($row = mysql_fetch_assoc($result));
    echo "</table></div>";
示例#2
0
        <?php 
    if ($status == 'OPEN') {
        echo "<p>{$amount} {$type} for {$want_amount} {$want_type} remaining.</p>";
    }
    ?>
        <p>
        <?php 
    printf(_("Made %s"), $timest);
    if ($is_logged_in != $uid) {
        echo " " . sprintf(_("by user %s"), $uid);
    }
    ?>
        </p>
        <p>
        <?php 
    echo translate_order_code($status);
    ?>
        </p>
        <?php 
    if ($status == 'OPEN') {
        ?>
        <p>
            <form action='' class='indent_form' method='post'>
                <input type='hidden' name='csrf_token' value="<?php 
        echo $_SESSION['csrf_token'];
        ?>
" />
                <input type='hidden' name='cancel_order' value='true' />
                <input type='submit' value='Cancel order' />
            </form>
        </p>