<?php
class QP_Printer {
    
    var $gray = true;
    var $color_arr = array(1 => '#DDDDDD',
                           0 => '#FFFFFF');
    /*
        The number of records to be shown on each page. 
        Set the value to 0 in order to show the whole query on one page.
    */
    var $RecordsPerPage = 10;
    
    
    function OpenTable() {
        echo '<table border="0" cellspacing="1" cellpadding="1">';
    }
    
    function CloseTable() {
        echo '</table><p>';
    }
    
    function PrintHead($arr) {
        echo '<tr bgcolor=\"#999999\>';
        foreach($arr as $title) {
            echo "<td bgcolor=\"#999999\"><b>$title</b></td>";
        }
        echo '</tr>';
    }
    
    function PrintRow($arr) {
        echo "<tr bgcolor=\"{$this->color_arr[$this->gray]}\">";
        foreach($arr as $title => $val) {
            $val .= ' ';
            echo "<td bgcolor=\"{$this->color_arr[$this->gray]}\">$val</td>";
        }
        echo '</tr>';
        $this->gray = !$this->gray;
    }
    
    
    function EmptyQuery() {
        echo '<i>Query is empty!</i>';
    }
    
    
    function PreviousLink($from) {
        global $PHP_SELF;
        echo " <a href=\"$PHP_SELF?QP_From=$from\">Previous</a> ";
    }
    
    function NextLink($from) {
        global $PHP_SELF;
        echo " <a href=\"$PHP_SELF?QP_From=$from\">Next</a> ";
    }
}
?> 
  |