Example #1
0
    // destroy session data in storage
    header('Location:index.php');
} else {
    session_regenerate_id(true);
    $_SESSION["last_acted_on"] = time();
}
//SHOW A DATABASE ON A PDF FILE
//CREATED BY: Carlos Vasquez S.
//E-MAIL: cvasquez@cvs.cl
//CVS TECNOLOGIA E INNOVACION
//SANTIAGO, CHILE
require 'pdf/fpdf.php';
//Connect to your database
include "lib.php";
//Select the Products you want to show in your PDF file
$result = getRes();
$num = count($result);
//Initialize the 3 columns and the total
$column_transaction = "";
$column_cash = "";
$column_float = "";
$column_total = "";
//For each row, add the field to the corresponding column
foreach ($result as $i => $row) {
    $order = $row["order_id"];
    $room = $row["room_no"];
    $arrive = $row["arrival_date"];
    //$total=$float+$cash;
    $column_transaction = $column_transaction . $order . "\n";
    $column_cash = $column_cash . $room . "\n";
    $column_float = $column_float . $arrive . "\n";
<table id="tablesorter-demo" class="tablesorter" cellspacing="0" >
<thead>
<tr class="table-header" ><th>Add Rooms  </th>
<th>Rooms</th>
<th>Customer Details</th>
<th>Contacts</th>
<th>Arrival_date</th>
<th>Departure_date</th>
<th>Adults</th>
<th>Children</th>
<th>Voucher</th>
<th>Username</th>
<th>Actions</th></tr></thead>
<tbody>
<?php 
    $numrows = count(getRes());
    // number of rows to show per page
    $rowsperpage = 10;
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
        // cast var as int
        $currentpage = (int) $_GET['currentpage'];
    } else {
        // default page num
        $currentpage = 1;
    }
    // end if
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {