Example #1
0
<?php

include_once 'fns/echo_html.php';
echo_html('<html>', '<link rel="stylesheet" type="text/css" href="js/Main.css" />' . '<link rel="stylesheet" type="text/css" href="js/MainPanel.css" />' . '<link rel="stylesheet" type="text/css" href="js/MainCanvas.css" />', '<script type="text/javascript" src="js/Background.js"></script>' . '<script type="text/javascript" src="js/BlurCanvas.js"></script>' . '<script type="text/javascript" src="js/BombNeighbors.js"></script>' . '<script type="text/javascript" src="js/BombParticleCanvases.js"></script>' . '<script type="text/javascript" src="js/BreakingBubble.js"></script>' . '<script type="text/javascript" src="js/BreakingCanvas.js"></script>' . '<script type="text/javascript" src="js/Collide.js"></script>' . '<script type="text/javascript" src="js/ColumnsAndRows.js"></script>' . '<script type="text/javascript" src="js/FallingCanvas.js"></script>' . '<script type="text/javascript" src="js/FallingBubble.js"></script>' . '<script type="text/javascript" src="js/InjectionNeighbors.js"></script>' . '<script type="text/javascript" src="js/Laser.js"></script>' . '<script type="text/javascript" src="js/LaserGradient.js"></script>' . '<script type="text/javascript" src="js/MainCanvas.js"></script>' . '<script type="text/javascript" src="js/MainPanel.js"></script>' . '<script type="text/javascript" src="js/MovingBubble.js"></script>' . '<script type="text/javascript" src="js/MovingCanvas.js"></script>' . '<script type="text/javascript" src="js/Neighbors.js"></script>' . '<script type="text/javascript" src="js/NextBubble.js"></script>' . '<script type="text/javascript" src="js/Orphans.js"></script>' . '<script type="text/javascript" src="js/ParticleCanvas.js"></script>' . '<script type="text/javascript" src="js/ParticleCanvases.js"></script>' . '<script type="text/javascript" src="js/RandomShape.js"></script>' . '<script type="text/javascript" src="js/RandomXY.js"></script>' . '<script type="text/javascript" src="js/ResultCanvas.js"></script>' . '<script type="text/javascript" src="js/Score.js"></script>' . '<script type="text/javascript" src="js/Shuffle.js"></script>' . '<script type="text/javascript" src="js/StillBubble.js"></script>' . '<script type="text/javascript" src="js/StillCanvas.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/AnyColor.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Black.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Blue.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Canvas.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Green.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Red.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Violet.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/White.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Yellow.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Blue.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Canvas.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Green.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Red.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Violet.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/White.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Bomb/Yellow.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Blue.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Canvas.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Green.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Red.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Violet.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/White.js"></script>' . '<script type="text/javascript" src="js/BubbleShape/Injection/Yellow.js"></script>' . '<script type="text/javascript" src="js/Main.js"></script>');
    protected function renderBody()
    {
        ?>

<div id="<?php 
        echo $this->getDivId();
        ?>
">

<form action="<?php 
        echo_html(make_url('/admin/workers.php'));
        ?>
" method="post">

<fieldset>
<input type="hidden" name="action" value="<?php 
        echo $this->getAction();
        ?>
" />
<?php 
        if ($this->viewdata['worker']->id) {
            ?>
<input type="hidden" name="id" value="<?php 
            echo_html($this->viewdata['worker']->id);
            ?>
" />
<?php 
        }
        ?>
</fieldset>

<table class="entry centered">
    <tr>
        <th><label for="name">Name:</label></th>
        <td><input name="name" id="name" size="25" value="<?php 
        echo_html($this->viewdata['worker']->name);
        ?>
" /></td>
    </tr>
    <tr>
        <th><label for="password">Password:</label></th>
        <td><input name="password" id="password" size="25" value="<?php 
        echo_html($this->viewdata['worker']->password);
        ?>
" /></td>
    </tr>
    <tr class="submit">
        <td>&nbsp;</td>
        <td><input type="submit" value="<?php 
        echo $this->getSubmitValue();
        ?>
" /></td>
    </tr>
</table>

</form>

</div>

<?php 
    }
    protected function renderBody()
    {
        $model = $this->viewdata['worker-pool'];
        ?>

<div id="edit-worker-pool">

<form action="<?php 
        echo_html(make_url('/admin/worker-pool.php'));
        ?>
" method="post">
<fieldset>
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="worker_id" value="<?php 
        echo_html($model->worker_id);
        ?>
" />
<input type="hidden" name="pool_id" value="<?php 
        echo_html($model->pool_id);
        ?>
" />
</fieldset>

<table class="entry centered">
    <tr>
        <th>Worker:</th>
        <td><?php 
        echo_html($model->worker_name);
        ?>
</td>
    </tr>
    <tr>
        <th>Pool:</th>
        <td><?php 
        echo_html($model->pool_name);
        ?>
</td>
    </tr>
    <tr>
        <th>Priority:</th>
        <td><input type="text" maxlength="3" size="3" name="priority"
            value="<?php 
        echo_html($model->priority);
        ?>
" /></td>
    </tr>
    <tr>
        <th>Enabled:</th>
        <td><input type="checkbox" name="enabled" value="1" <?php 
        if ($model->enabled) {
            ?>
checked="checked" <?php 
        }
        ?>
 /></td>
    </tr>
    <tr>
        <th>Pool username:</th>
        <td><input type="text" name="pool_username" size="50" value="<?php 
        echo_html($model->pool_username);
        ?>
" /></td>
    </tr>
    <tr>
        <th>Pool password:</th>
        <td><input type="text" name="pool_password" size="50" value="<?php 
        echo_html($model->pool_password);
        ?>
" /></td>
    </tr>
    <tr class="submit">
        <td>&nbsp;</td>
        <td><input type="submit" value="Save" /></td>
    </tr>
</table>

</form>

</div>

<?php 
    }
                        if ($CSSstylesheet) {
                            $buffer = $css_directive . $buffer;
                        }
                    }
                    // write the content include file
                    echo 'Trying to write content file to: <b>' . './' . $contentFile . '</b><br>' . PHP_EOL;
                    $filehandle = @fopen('./' . $contentFile, 'w+');
                    if ($filehandle) {
                        fwrite($filehandle, $buffer);
                        flush($filehandle);
                        fclose($filehandle);
                        echo 'phpMyEdit content file written successfully<br>';
                    } else {
                        echo 'phpMyEdit content file was NOT written due to inssufficient privileges.<br>';
                        echo 'Please copy and paste content listed below to <i>' . './' . $contentFile . '</i> file.';
                    }
                    echo '<br><hr>';
                    echo '<pre>';
                    echo_html($buffer);
                    echo '</pre><hr>' . PHP_EOL;
                }
            }
        }
    }
}
?>

</body>
</html>

Example #5
0
<?php

include_once 'fns/echo_html.php';
echo_html('<html>', '<link rel="stylesheet" type="text/css" href="css/Main.css" />' . '<link rel="stylesheet" type="text/css" href="css/MainPanel.css" />', '<script type="text/javascript" src="js/AffectedBalls.js"></script>' . '<script type="text/javascript" src="js/AvailableColor.js"></script>' . '<script type="text/javascript" src="js/AvailableFeature.js"></script>' . '<script type="text/javascript" src="js/Board.js"></script>' . '<script type="text/javascript" src="js/DrawBall.js"></script>' . '<script type="text/javascript" src="js/EmptySlot.js"></script>' . '<script type="text/javascript" src="js/ExplodedBalls.js"></script>' . '<script type="text/javascript" src="js/ExplodingAllBalls.js"></script>' . '<script type="text/javascript" src="js/ExplodingBalls.js"></script>' . '<script type="text/javascript" src="js/Explosive.js"></script>' . '<script type="text/javascript" src="js/GetPath.js"></script>' . '<script type="text/javascript" src="js/Locked.js"></script>' . '<script type="text/javascript" src="js/MainPanel.js"></script>' . '<script type="text/javascript" src="js/MarkedEdge.js"></script>' . '<script type="text/javascript" src="js/MarkedEdges.js"></script>' . '<script type="text/javascript" src="js/MarkedSlot.js"></script>' . '<script type="text/javascript" src="js/MarkedSlots.js"></script>' . '<script type="text/javascript" src="js/MatchBalls.js"></script>' . '<script type="text/javascript" src="js/MovingBall.js"></script>' . '<script type="text/javascript" src="js/NextBall.js"></script>' . '<script type="text/javascript" src="js/Particle.js"></script>' . '<script type="text/javascript" src="js/PauseButton.js"></script>' . '<script type="text/javascript" src="js/Score.js"></script>' . '<script type="text/javascript" src="js/SelectedBall.js"></script>' . '<script type="text/javascript" src="js/SteadyBall.js"></script>' . '<script type="text/javascript" src="js/Main.js"></script>');
Example #6
0
<?php

include_once 'fns/get_run_revisions.php';
$revisions = get_run_revisions();
include_once 'fns/echo_html.php';
echo_html('<html manifest="cache-manifest/">', '<link rel="stylesheet" type="text/css" href="compressed.css?' . $revisions['compressed.css'] . '" />', '<script type="text/javascript" src="compressed.js?' . $revisions['compressed.js'] . '"></script>');
    public function renderHtml()
    {
        echo '<?xml version="1.0" encoding="UTF-8" ?>';
        if (!isset($this->viewdata['title'])) {
            $title = $this->getTitle();
        } else {
            $title = $this->viewdata['title'];
        }
        $menuid = $this->getMenuId();
        ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title><?php 
        echo_html($title);
        ?>
</title>
        <link rel="stylesheet" type="text/css" href="<?php 
        echo_html(make_url('/assets/style.css'));
        ?>
" />
    </head>
    <body>
        <h1><?php 
        echo_html($title);
        ?>
</h1>

        <ul id="navmenu">
            <?php 
        foreach (self::$menuitems as $item) {
            ?>
            <li id="nav-<?php 
            echo_html($item[0]);
            ?>
"<?php 
            if ($menuid == $item[0]) {
                ?>
 class="active"<?php 
            }
            ?>
><a href="<?php 
            echo_html(make_url($item[2]));
            ?>
"><span><?php 
            echo_html($item[1]);
            ?>
</span></a></li>
            <?php 
        }
        ?>
        </ul>

        <div id="content">

<?php 
        $this->displayNoticeList('errors');
        $this->displayNoticeList('info');
        $this->renderBody();
        ?>

        </div>

        <div id="footer">
            <sup>*</sup> Data is based off your value of the 'average_interval' setting in the config file.<br /><br />
            bitcoin-mining-proxy &copy; 2011 <a href="http://www.chrishowie.com">Chris Howie</a>.

            This software may be distributed or hosted under the terms of the
            <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a>, version 3 or later.
        </div>
    </body>
</html>

<?php 
    }
    protected function renderBody()
    {
        global $BTC_PROXY;
        ?>

<div id="dashboard">

<?php 
        if ($this->viewdata['url-fopen-disabled']) {
            ?>
<div id="url-fopen-disabled" class="dashboard-error"><span>The <tt>allow_url_fopen</tt> PHP configuration option is disabled.  <b>The proxy will be unable to contact pools until this option is enabled.</b></span></div>
<?php 
        }
        ?>

<?php 
        if ($this->viewdata['old-schema']) {
            ?>
<div id="old-schema" class="dashboard-warning"><span>Your database schema is out of date.  Please run the schema migration script (check the readme for instructions).  Until you migrate your database schema, you may notice errors or poor performance.</span></div>
<?php 
        }
        ?>

<div id="recent-submissions">

<h2>Recent work submissions</h2>

<table class="data"><?php 
        $this->renderWorkTable($this->viewdata['recent-submissions']);
        ?>
</table>

</div>

<div id="recent-failed-submissions">

<h2>Recent failed work submissions</h2>

<table class="data"><?php 
        $this->renderWorkTable($this->viewdata['recent-failed-submissions'], TRUE);
        ?>
</table>

</div>

<br />

<div id="worker-status">

<h2>Worker status</h2>

<table class="data">
    <tr>
        <th>Worker</th>
        <th>Last work request</th>
        <th>Last accepted submission</th>
        <th>Shares<sup>*</sup></th>
        <th>Rejected<sup>*</sup></th>
        <th>Hashing speed<sup>*</sup></th>
    </tr>
    <?php 
        foreach ($this->viewdata['worker-status'] as $row) {
            ?>
    <?php 
            if ($row['accepted_last_interval'] > 0 and round($row['rejected_last_interval'] / $row['shares_last_interval'] * 100, 2) >= $BTC_PROXY['rejected_alert']) {
                ?>
    <tr class="alert">
    <?php 
            } elseif (!isset($row['active_pool']) or !isset($row['last_accepted_pool']) or !isset($row['shares_last_interval'])) {
                ?>
    <tr class="alert">
    <?php 
            } else {
                ?>
    <tr>
    <?php 
            }
            ?>
        <td>
            <form action="<?php 
            echo_html(make_url('/admin/worker-pool.php'));
            ?>
">
                <fieldset>
                    <input type="hidden" name="id" value="<?php 
            echo_html($row['worker_id']);
            ?>
" />
                    <?php 
            $this->renderImageButton('index', 'manage-pools', 'Manage worker-pool');
            ?>
                </fieldset>
            </form>
            <?php 
            echo htmlspecialchars($row['worker']);
            ?>
        </td>
        <td><?php 
            if (isset($row['active_time'])) {
                if (isset($row['active_pool'])) {
                    echo_html(format_date_with_prefix($row['active_time'], true) . " from {$row['active_pool']}");
                } else {
                    echo format_date_with_prefix($row['active_time'], true) . " from <i>(Unknown)</i>";
                }
            } else {
                echo "Never";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['last_accepted_time'])) {
                if (isset($row['last_accepted_pool'])) {
                    echo_html(format_date_with_prefix($row['last_accepted_time'], true) . " to {$row['last_accepted_pool']}");
                } else {
                    echo format_date_with_prefix($row['last_accepted_time'], true) . " to <i>(Unknown)</i>";
                }
            } else {
                echo "Never";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['shares_last_interval'])) {
                echo_html($row['shares_last_interval']);
            } else {
                echo "0";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['shares_last_interval']) and isset($row['rejected_last_interval'])) {
                if ($row['shares_last_interval'] > 0) {
                    echo_html(number_format($row['rejected_last_interval'] / $row['shares_last_interval'] * 100, 2) . '%');
                } else {
                    echo "0.00%";
                }
            } else {
                echo "0.00%";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['mhash'])) {
                print round($row['mhash'], 3);
            } else {
                echo "0";
            }
            ?>
 MHash/s</td>
    </tr>
    <?php 
        }
        ?>
</table>

</div>

<br />

<div id="pool-status">

<h2>Pool status</h2>

<table class="data">
    <tr>
        <th>Pool</th>
        <th>Latest work requested</th>
        <th>Getworks<sup>*</sup></th>
        <th>Shares<sup>*</sup></th>
        <th>Rejected<sup>*</sup></th>
    </tr>
    <?php 
        foreach ($this->viewdata['pool-status'] as $row) {
            ?>
    <?php 
            if ($row['total'] > 0 and round($row['rejected'] / $row['total'] * 100, 2) >= $BTC_PROXY['rejected_alert']) {
                ?>
    <tr class="alert">
    <?php 
            } else {
                ?>
    <tr>
    <?php 
            }
            ?>
        <td>
            <form action="<?php 
            echo_html(make_url('/admin/pool.php'));
            ?>
">
                <fieldset>
                    <input type="hidden" name="id" value="<?php 
            echo_html($row['pool_id']);
            ?>
" />
                    <?php 
            $this->renderImageButton('edit', 'edit-pool', 'Edit pool');
            ?>
                </fieldset>
            </form>
            <?php 
            echo htmlspecialchars($row['pool']);
            ?>
        </td>
        <td><?php 
            if (isset($row['last_request'])) {
                if (isset($row['worker'])) {
                    echo_html("By {$row['worker']} " . format_date_with_prefix($row['last_request'], false));
                } else {
                    echo "By <i>(Unknown)</i> " . format_date_with_prefix($row['last_request'], false);
                }
            } else {
                echo "Never";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['getworks'])) {
                echo_html($row['getworks']);
            } else {
                echo "0";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['total'])) {
                echo_html($row['total']);
            } else {
                echo "0";
            }
            ?>
</td>
        <td><?php 
            if (isset($row['total']) and isset($row['rejected'])) {
                if ($row['total'] > 0) {
                    echo_html(number_format($row['rejected'] / $row['total'] * 100, 2) . '%');
                } else {
                    echo "0.00%";
                }
            } else {
                echo "0.00%";
            }
            ?>
</td>
    </tr>
    <?php 
        }
        ?>
</table>

</div>

</div>

<?php 
    }
Example #9
0
<?php

$head = '<link rel="stylesheet" type="text/css" href="js/Main.css" />' . '<link rel="stylesheet" type="text/css" href="js/Blink.css" />' . '<link rel="stylesheet" type="text/css" href="js/Field.css" />' . '<link rel="stylesheet" type="text/css" href="js/MainPanel.css" />' . '<link rel="stylesheet" type="text/css" href="js/MuteButton.css" />' . '<link rel="stylesheet" type="text/css" href="js/TapButton.css" />';
$body = '<script type="text/javascript" src="js/Blink.js"></script>' . '<script type="text/javascript" src="js/Field.js"></script>' . '<script type="text/javascript" src="js/Div.js"></script>' . '<script type="text/javascript" src="js/MainPanel.js"></script>' . '<script type="text/javascript" src="js/MuteButton.js"></script>' . '<script type="text/javascript" src="js/TapButton.js"></script>' . '<script type="text/javascript" src="js/TextNode.js"></script>' . '<script type="text/javascript" src="js/Main.js"></script>';
include_once 'fns/echo_html.php';
echo_html('<html>', $head, $body);
    public function renderHtml()
    {
	global $BTC_PROXY;
        echo '<?xml version="1.0" encoding="UTF-8" ?>';

        if (!isset($this->viewdata['title'])) {
            $title = $this->getTitle();
        } else {
            $title = $this->viewdata['title'];
        }

        $menuid = $this->getMenuId();
        if ($title == "Dashboard" && $BTC_PROXY['refresh_interval'] > 0) {
            header("Refresh: " . $BTC_PROXY['refresh_interval']);
        }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title><?php echo_html($title) ?></title>
        <link rel="stylesheet" type="text/css" href="<?php echo_html(make_url('/assets/style.css')) ?>" />
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
            google.load('visualization', '1', {packages: ['corechart']});
        </script>
<?php if ($title == "Dashboard" && $BTC_PROXY['refresh_interval'] > 0) { ?>
        <meta http-equiv="refresh" content="<?php echo $BTC_PROXY['refresh_interval']?>" />
<?php } ?>
    </head>
    <body>
        <h1><?php echo_html($title) ?></h1>

        <ul id="navmenu">
            <?php foreach (self::$menuitems as $item) { ?>
            <li id="nav-<?php echo_html($item[0]) ?>"<?php if ($menuid == $item[0]) { ?> class="active"<?php } ?>><a href="<?php echo_html(make_url($item[2])) ?>"><span><?php echo_html($item[1]) ?></span></a></li>
            <?php } ?>
        </ul>

        <div id="content">

<?php
    $this->displayNoticeList('errors');
    $this->displayNoticeList('info');

    $this->renderBody();
?>

        </div>

        <div id="footer">
            <sup>*</sup> Data is based off your value of the 'average_interval' (<?php if ($this->viewdata['interval_override']) { echo "override: " . $this->viewdata['interval_override']; } else { echo $BTC_PROXY['average_interval']; } ?>) setting in the config file.<br /><br />
            bitcoin-mining-proxy &copy; 2011 <a href="http://www.chrishowie.com">Chris Howie</a>.

            This software may be distributed or hosted under the terms of the
            <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a>, version 3 or later.
        </div>
    </body>
</html>

<?php
    }
Example #11
0
    protected function renderBody()
    {
        $pool = $this->viewdata['pool'];

?>

<div id="edit-pool">

<form action="<?php echo_html(make_url('/admin/pool.php')) ?>" method="post">
<fieldset>
    <input type="hidden" name="action" value="edit" />
    <?php if ($pool->id) { ?>
    <input type="hidden" name="id" value="<?php echo_html($pool->id) ?>" />
    <?php } ?>
</fieldset>

<table class="entry centered">
    <tr>
        <th>Name:</th>
        <td><input type="text" name="name" size="50" value="<?php echo_html($pool->name) ?>" /></td>
    </tr>
    <tr>
        <th>Enabled:</th>
        <td><input type="checkbox" name="enabled" value="1" <?php if ($pool->enabled) { ?>checked="checked"<?php } ?> /></td>
    </tr>
    <tr>
        <th>URL:</th>
        <td><input type="text" name="url" size="50" value="<?php echo_html($pool->url) ?>" /></td>
    </tr>
    <tr class="submit">
        <td>&nbsp;</td>
        <td><input type="submit" value="<?php echo_html($pool->id ? 'Save changes' : 'Create pool') ?>" /></td>
    </tr>
</table>

</form>

</div>

<?php
    }