Exemple #1
0
$data = array();
stmt_bind_assoc($stmt, $data);
$stmt->execute();
while ($stmt->fetch()) {
    $stats[$data['pname']] = $data['pvalue'];
}
$stmt->close();
$mysql->close();
echo "Total nets: {$stats['nets']}<br/>\n";
echo "Cracked nets: {$stats['cracked']}<br/>\n";
if ((int) $stats['nets'] > 0) {
    $srate = round((int) $stats['cracked'] / (int) $stats['nets'] * 100, 2);
    echo "Success rate: {$srate} %<br/>\n";
}
echo "Last day getworks: {$stats['24getwork']}<br/>\n";
$perf = convert_num($stats['24psk'] / (60 * 60 * 24));
echo "Last day performance: {$perf}/s<br/>\n";
echo "Last day submissions: {$stats['24sub']}<br/>\n";
echo "Current round ends in: ";
if ((int) $stats['24psk'] > 0) {
    echo convert_sec(round(((int) $stats['words'] - (int) $stats['triedwords']) / ((int) $stats['24psk'] / (60 * 60 * 24))));
} else {
    echo 'infinity';
}
echo "<br/>\n";
?>
<br/>
Current keyspace progress:
<dl class="progress">
    <dd class="done" style="width: <?php 
echo round((int) $stats['triedwords'] / (int) $stats['words'] * 100);
    <div class="form-group">
        <button type="submit" class="btn btn-default" name="submit">Convert</button>
        <button type="reset" class="btn btn-default">Reset</button>
    </div>
</form>
<!--End form-->

<?php 
// Activates code block if submit button is clicked
if (isset($_POST['submit'])) {
    //if Numtype is passed - will not process otherwise
    if (isset($_POST['numtype'])) {
        //Store input type and output type and call convert_num function - it will return the converted value
        $innum = $_POST['numtype'];
        $outnum = $_POST['outtype'];
        $converted = convert_num($innum, $outnum);
    }
    ?>
<!--Form input to display sorted values - only appears if submitted -->
        
        <div class="form-group form-group-lg">
        <label for="outnum">Your Output:</label>
            <input class="form-control" type="text" min="6" max="255" name="outnum" value="<?php 
    echo $converted;
    ?>
">
        <br />
    </div>

<?php 
    echo '<h3>Your number has been converted from ' . $innum . ' to ' . $outnum . '.</h3><br />';