<?php
include_once('include/functions.php');
include_once('include/constants.php');
include_once('smarty_survey.php');
include_once('pear/DB.php');
// Admin Page
$SMARTY = new Smarty_Survey;
session_start();
is_Logged($_SESSION['login']);
if ($_SESSION['rights'] != 'S'){
header("Location: login.php");
}
// Connecting, selecting database
$dbconnect =& DB::connect("pgsql://". user .":" . password."@" . server ."/" . database, $options);
is_dbError($dbconnect);
$result = $dbconnect->query("SELECT * FROM " . surveytbl ." ORDER BY author,brgy_name,business_name");
is_dbError($result);
$no = 0;
while ($row = $result->fetchRow()) {
// Assuming DB's default fetchmode is
// DB_FETCHMODE_ORDERED
is_dbError($row);
$no++;
$record_results .= getDisplayRecords($row,$no,'viewrecord');
}
$SMARTY->assign("view_results",$record_results);
// Closing connections
$result->free;
$dbconnect->disconnect;
$SMARTY->assign("user_rights",$_SESSION['rights']);
$SMARTY->display("viewrecord.html");
?>