function newGame()
{
    start();
    echo "<div class='title'> " . getNumber() . " </div>";
    echo "<div class='sub-title'>Quedan por salir - " . getRest() . "</div>";
    drawBoard();
    fillTable(18);
    showTable();
}
Beispiel #2
0
//MAIN
$caption = "Fasttemplate: Flexible table example";
/*
 *  Get  number of rows and cols and fills headers and cells
 */
if (isset($HTTP_POST_VARS['rows']) && isset($HTTP_POST_VARS['cols'])) {
    $rows = $HTTP_POST_VARS['rows'];
    $cols = $HTTP_POST_VARS['cols'];
} else {
    $rows = 3;
    $cols = 4;
}
if ($rows * $cols > 2000) {
    echo "Too many cells. Should be less then 2000";
    $rows = 10;
    $cols = 5;
}
$headers = array();
$cells = array();
for ($i = 1; $i <= $rows; $i++) {
    $row = array();
    for ($j = 1; $j <= $cols; $j++) {
        array_push($row, "cell[{$i},{$j}]");
    }
    array_push($cells, $row);
}
for ($j = 1; $j <= $cols; $j++) {
    array_push($headers, "header{$j}");
}
fillTable($headers, $cells, $caption, $rows, $cols);
Beispiel #3
0
        echo '<td><button onclick="notify($array[first_name],$array[last_name],$array[email])">
                    Alert</button></td>';
        echo '</tr>';
    }
}
?>
        <script>
            $("button").hover(
                function() {
                    $( this).fadeTo( "slow", 0.5 );
                }, function() {
                    $( this ).fadeTo( "slow", 1.0 );
                }
            );
            function notify(firstname, lastname, email){
                alert("A notification has been sent to " + firstname + " " + lastname + "at e-mail" + email + "."  );
            }
        </script>
        <table>
            <thead>
                <tr>
                    <th>ID</th><th>First Name</th><th>Last Name</th><th>E-Mail</th><th>Notify</th>
                </tr>
            </thead>
            <?php 
fillTable($people);
?>
        </table>
    </body>
</html>