ok, going back to basics here. I need you to test out the class code as I have no data to play with. dont be overwhelmed, name the class tour_request.class.php
and save it in the same directory as your form page for now.
yes, it's about a thousand lines long it came from a generator.
go to line 851 and look at that code. (set your db host as well at top of file)
right now that is the only code (besides the get/set methods) that you need for first request of data. then look at select_by_id($id) (line 731) we will use that for the second specific lookup of an id when they click on your form.
tour_request.class.php
<?php
// begin generated class -->
/*
* -------------------------------------------------------
* CLASSNAME: tour_request
* GENERATION DATE: 19.08.2011
* CLASS FILE: C:\wamp\www\PHP_LIB\sql_class_generator\generated_classes\tour_request.class.php
* FOR MYSQL TABLE: tbl_tour_request
* FOR MYSQL DB: test
* -------------------------------------------------------
* CODE GENERATED BY:
* MY PHP-MYSQL-CLASS GENERATOR
* from: >> www.voegeli.li >>
* CLASS MODIFIED AND EXTENDED BY:
* dmd
* -------------------------------------------------------
*/
// Define your database connection parameters here.
define(DB_HOST,'localhost');
define(DB_USER,'root');
define(DB_PASS,'');
define(DB_BASE,'hatsdb');
// **********************
// CLASS DECLARATION
// **********************
// class : begin
class tour_request {
// **********************
// ATTRIBUTE DECLARATION
// **********************
var $request_id; // KEY ATTR. WITH AUTOINCREMENT
var $subject_name; // (normal Attribute)
var $subject_code; // (normal Attribute)
var $subject_overview; // (normal Attribute)
var $destination; // (normal Attribute)
var $expected_num_participants; // (normal Attribute)
var $prefDate; // (normal Attribute)
var $tour_objectives; // (normal Attribute)
var $seminar_topic; // (normal Attribute)
var $seminar_speaker; // (normal Attribute)
var $service_classification; // (normal Attribute)
var $activities; // (normal Attribute)
var $budget_per_student; // (normal Attribute)
var $additionalConcern; // (normal Attribute)
var $request_by; // (normal Attribute)
var $applicant_id; // (normal Attribute)
var $bookingDate; // (normal Attribute)
var $bookingTime; // (normal Attribute)
// **********************
// CONSTRUCTOR METHOD
// **********************
/**
* @author - rakwel
* @type - public
* @desc - constructor
* @param - tour_request
* @return - Instance of $class
* @vers - 1
* @Mod -
**/
function tour_request() {
}
// **********************
// GETTER METHODS
// **********************
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_request_id()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_request_id() {
return $this->request_id;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_subject_name()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_subject_name() {
return $this->subject_name;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_subject_code()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_subject_code() {
return $this->subject_code;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_subject_overview()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_subject_overview() {
return $this->subject_overview;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_destination()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_destination() {
return $this->destination;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_expected_num_participants()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_expected_num_participants() {
return $this->expected_num_participants;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_prefDate()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_prefDate() {
return $this->prefDate;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_tour_objectives()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_tour_objectives() {
return $this->tour_objectives;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_seminar_topic()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_seminar_topic() {
return $this->seminar_topic;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_seminar_speaker()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_seminar_speaker() {
return $this->seminar_speaker;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_service_classification()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_service_classification() {
return $this->service_classification;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_activities()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_activities() {
return $this->activities;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_budget_per_student()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_budget_per_student() {
return $this->budget_per_student;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_additionalConcern()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_additionalConcern() {
return $this->additionalConcern;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_request_by()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_request_by() {
return $this->request_by;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_applicant_id()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_applicant_id() {
return $this->applicant_id;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_bookingDate()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_bookingDate() {
return $this->bookingDate;
}
/**
* @author - rakwel
* @type - public
* @desc - get variable value
* @param - get_bookingTime()
* @return - variable
* @vers - 1
* @Mod -
**/
function get_bookingTime() {
return $this->bookingTime;
}
// **********************
// SETTER METHODS
// **********************
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_request_id($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_request_id($val) {
$this->request_id = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_subject_name($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_subject_name($val) {
$this->subject_name = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_subject_code($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_subject_code($val) {
$this->subject_code = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_subject_overview($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_subject_overview($val) {
$this->subject_overview = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_destination($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_destination($val) {
$this->destination = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_expected_num_participants($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_expected_num_participants($val) {
$this->expected_num_participants = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_prefDate($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_prefDate($val) {
$this->prefDate = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_tour_objectives($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_tour_objectives($val) {
$this->tour_objectives = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_seminar_topic($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_seminar_topic($val) {
$this->seminar_topic = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_seminar_speaker($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_seminar_speaker($val) {
$this->seminar_speaker = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_service_classification($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_service_classification($val) {
$this->service_classification = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_activities($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_activities($val) {
$this->activities = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_budget_per_student($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_budget_per_student($val) {
$this->budget_per_student = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_additionalConcern($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_additionalConcern($val) {
$this->additionalConcern = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_request_by($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_request_by($val) {
$this->request_by = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_applicant_id($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_applicant_id($val) {
$this->applicant_id = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_bookingDate($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_bookingDate($val) {
$this->bookingDate = $val;
}
/**
* @author - rakwel
* @type - public
* @desc - set variable value
* @param - set_bookingTime($val)
* @return - void
* @vers - 1
* @Mod -
**/
function set_bookingTime($val) {
$this->bookingTime = $val;
}
// **********************
// print_to_screen()
// this is used mainly for debugging purposes
// if i am setting values or have an object on a page I call this to see
// what values the object that I am working with is holding...
// **********************
function print_to_screen() {
echo "request_id = ". $this->request_id ." \n ";
echo "subject_name = ". $this->subject_name ." \n ";
echo "subject_code = ". $this->subject_code ." \n ";
echo "subject_overview = ". $this->subject_overview ." \n ";
echo "destination = ". $this->destination ." \n ";
echo "expected_num_participants = ". $this->expected_num_participants ." \n ";
echo "prefDate = ". $this->prefDate ." \n ";
echo "tour_objectives = ". $this->tour_objectives ." \n ";
echo "seminar_topic = ". $this->seminar_topic ." \n ";
echo "seminar_speaker = ". $this->seminar_speaker ." \n ";
echo "service_classification = ". $this->service_classification ." \n ";
echo "activities = ". $this->activities ." \n ";
echo "budget_per_student = ". $this->budget_per_student ." \n ";
echo "additionalConcern = ". $this->additionalConcern ." \n ";
echo "request_by = ". $this->request_by ." \n ";
echo "applicant_id = ". $this->applicant_id ." \n ";
echo "bookingDate = ". $this->bookingDate ." \n ";
echo "bookingTime = ". $this->bookingTime ." \n ";
echo "end p_t_s function \n ";
}
// **********************
// process a form $_POST()
// this may not work for you as is, but I have found it very helpful
// this takes in a post value from a form and tries to set all of the
// variables in this object, I call $this->insert() at the end and would insert my data into the
// database. you might have no use for this in this class, or for your current purposes
// but I am leaving here to show you that the ideal place to handle data processing / functions
// is in your class code and not on your page.
// one other note, of course your form values would have to match names (or the below code needs to change)
// for instance... the code below is expecting your form to have a 'subject_name' field, and a 'subject_code' field etc...
// the same naming conventions that are used by this class.
// of course you can always make a form with different values and update what fields you are looking for in the call below.
// **********************
function process_form_post($_POST) {
$this;
if (!empty($_POST['request_id'])) {
$this->set_request_id($_POST['request_id']);
}
if (!empty($_POST['subject_name'])) {
$this->set_subject_name($_POST['subject_name']);
}
if (!empty($_POST['subject_code'])) {
$this->set_subject_code($_POST['subject_code']);
}
if (!empty($_POST['subject_overview'])) {
$this->set_subject_overview($_POST['subject_overview']);
}
if (!empty($_POST['destination'])) {
$this->set_destination($_POST['destination']);
}
if (!empty($_POST['expected_num_participants'])) {
$this->set_expected_num_participants($_POST['expected_num_participants']);
}
if (!empty($_POST['prefDate'])) {
$this->set_prefDate($_POST['prefDate']);
}
if (!empty($_POST['tour_objectives'])) {
$this->set_tour_objectives($_POST['tour_objectives']);
}
if (!empty($_POST['seminar_topic'])) {
$this->set_seminar_topic($_POST['seminar_topic']);
}
if (!empty($_POST['seminar_speaker'])) {
$this->set_seminar_speaker($_POST['seminar_speaker']);
}
if (!empty($_POST['service_classification'])) {
$this->set_service_classification($_POST['service_classification']);
}
if (!empty($_POST['activities'])) {
$this->set_activities($_POST['activities']);
}
if (!empty($_POST['budget_per_student'])) {
$this->set_budget_per_student($_POST['budget_per_student']);
}
if (!empty($_POST['additionalConcern'])) {
$this->set_additionalConcern($_POST['additionalConcern']);
}
if (!empty($_POST['request_by'])) {
$this->set_request_by($_POST['request_by']);
}
if (!empty($_POST['applicant_id'])) {
$this->set_applicant_id($_POST['applicant_id']);
}
if (!empty($_POST['bookingDate'])) {
$this->set_bookingDate($_POST['bookingDate']);
}
if (!empty($_POST['bookingTime'])) {
$this->set_bookingTime($_POST['bookingTime']);
}
//echo "end post function \n ";
// you may have other validation, at this point in the process you should expect good data,
// lets insert this record.
$this->insert();
// returns this object with any parameters set that were set in the post.
return $this;
}
// **********************
// INSERT
// **********************
/**
* @author - rakwel
* @type - public
* @desc - insert this object
* @param - insert
* @return - boolean
* @vers - 1
* @Mod -
**/
function insert() {
$this->request_id = ""; // clear key for autoincrement
$sql = "INSERT INTO tbl_tour_request (subject_name,subject_code,subject_overview,destination,expected_num_participants,prefDate,tour_objectives,seminar_topic,seminar_speaker,service_classification,activities,budget_per_student,additionalConcern,request_by,applicant_id,bookingDate,bookingTime ) VALUES ( '".$this->slashes($this->subject_name)."','".$this->slashes($this->subject_code)."','".$this->slashes($this->subject_overview)."','".$this->slashes($this->destination)."','".$this->slashes($this->expected_num_participants)."','".$this->slashes($this->prefDate)."','".$this->slashes($this->tour_objectives)."','".$this->slashes($this->seminar_topic)."','".$this->slashes($this->seminar_speaker)."','".$this->slashes($this->service_classification)."','".$this->slashes($this->activities)."','".$this->slashes($this->budget_per_student)."','".$this->slashes($this->additionalConcern)."','".$this->slashes($this->request_by)."','".$this->slashes($this->applicant_id)."','".$this->slashes($this->bookingDate)."','".$this->slashes($this->bookingTime)."' )";
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
$this->request_id = mysql_insert_id($dblink);
if(is_resource($dblink)) {
mysql_close($dblink);
}
// returns the insert id from the database.
return $retid;
}
// **********************
// UPDATE
// **********************
/**
* @author - rakwel
* @type - public
* @desc - update this object
* @param - update($id)
* @return - boolean
* @vers - 1
* @Mod -
**/
function update($id) {
$sql = "UPDATE tbl_tour_request SET subject_name = '$this->subject_name',subject_code = '$this->subject_code',subject_overview = '$this->subject_overview',destination = '$this->destination',expected_num_participants = '$this->expected_num_participants',prefDate = '$this->prefDate',tour_objectives = '$this->tour_objectives',seminar_topic = '$this->seminar_topic',seminar_speaker = '$this->seminar_speaker',service_classification = '$this->service_classification',activities = '$this->activities',budget_per_student = '$this->budget_per_student',additionalConcern = '$this->additionalConcern',request_by = '$this->request_by',applicant_id = '$this->applicant_id',bookingDate = '$this->bookingDate',bookingTime = '$this->bookingTime' WHERE request_id = $id ";
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
// returns a 1 or 0
return $retid;
}
// **********************
// SELECT METHOD / LOAD
// **********************
/**
* @author - rakwel
* @type - public
* @desc - load this object
* @param - select_by_id($id)
* @return - sets this object from "$id"
* @vers - 1
* @Mod -
**/
function select_by_id($id) {
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$sql = "SELECT * FROM tbl_tour_request WHERE request_id = ".$this->slashes($id);
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
if ($row = mysql_fetch_array($retid)) {
$this->request_id = $row['request_id'];
$this->subject_name = $row['subject_name'];
$this->subject_code = $row['subject_code'];
$this->subject_overview = $row['subject_overview'];
$this->destination = $row['destination'];
$this->expected_num_participants = $row['expected_num_participants'];
$this->prefDate = $row['prefDate'];
$this->tour_objectives = $row['tour_objectives'];
$this->seminar_topic = $row['seminar_topic'];
$this->seminar_speaker = $row['seminar_speaker'];
$this->service_classification = $row['service_classification'];
$this->activities = $row['activities'];
$this->budget_per_student = $row['budget_per_student'];
$this->additionalConcern = $row['additionalConcern'];
$this->request_by = $row['request_by'];
$this->applicant_id = $row['applicant_id'];
$this->bookingDate = $row['bookingDate'];
$this->bookingTime = $row['bookingTime'];
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
return $this;
}
// **********************
// SELECT METHOD / LOAD
// **********************
/**
* @author - rakwel
* @type - public
* @desc - load this object
* @param - select_all_requests()
* @return - sets all requests into an array
* @vers - 1
* @Mod -
**/
function select_all_requests() {
$return_array=array();
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$sql = "SELECT * FROM tbl_tour_request ORDER BY bookingDate DESC";
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
while ($row = mysql_fetch_array($retid)) {
// make a new class object referencing this class.
$tr = new tour_request();
$tr->request_id = $row['request_id'];
$tr->subject_name = $row['subject_name'];
$tr->subject_code = $row['subject_code'];
$tr->subject_overview = $row['subject_overview'];
$tr->destination = $row['destination'];
$tr->expected_num_participants = $row['expected_num_participants'];
$tr->prefDate = $row['prefDate'];
$tr->tour_objectives = $row['tour_objectives'];
$tr->seminar_topic = $row['seminar_topic'];
$tr->seminar_speaker = $row['seminar_speaker'];
$tr->service_classification = $row['service_classification'];
$tr->activities = $row['activities'];
$tr->budget_per_student = $row['budget_per_student'];
$tr->additionalConcern = $row['additionalConcern'];
$tr->request_by = $row['request_by'];
$tr->applicant_id = $row['applicant_id'];
$tr->bookingDate = $row['bookingDate'];
$tr->bookingTime = $row['bookingTime'];
// push this object into the return array.
array_push($return_array,$tr);
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
// returns an array of all request objects.
return $return_array;
}
/*****
this is the query from your web page. it will only load the fields specified by you.
******/
// **********************
// SELECT METHOD / LOAD
// **********************
/**
* @author - rakwel
* @type - public
* @desc - load this object
* @param - select_all_requests()
* @return - sets all requests into an array
* @vers - 1
* @Mod -
**/
function select_specific_info() {
$return_array=array();
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$sql = "SELECT bookingDate, request_id, destination, request_by FROM tbl_tour_request ORDER BY bookingDate DESC";
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
while ($row = mysql_fetch_array($retid)) {
// make a new class object referencing this class.
$tr = new tour_request();
$tr->request_id = $row['request_id'];
$tr->destination = $row['destination'];
$tr->request_by = $row['request_by'];
$tr->bookingDate = $row['bookingDate'];
// push this object into the return array.
array_push($return_array,$tr);
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
// returns an array of all request objects.
return $return_array;
}
// **********************
// DELETE
// **********************
/**
* @author - rakwel
* @type - public
* @desc - delete this object
* @param - delete($id)
* @return - boolean
* @vers - 1
* @Mod - beware, this works.
**/
function delete($id) {
$dblink = null;
try {
$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_BASE,$dblink);
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
echo "Error: " . $ex->message;
exit;
}
$sql = "DELETE FROM tbl_tour_request WHERE request_id = $id;";
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
return $retid;
}
/**
* @author - rakwel
* @type - public
* @desc - $str
* @param - adding slashes if necessary
* @return - escaped string
* @vers - 1
* @Mod -
**/
function slashes($str) {
//if ((get_magic_quotes_gpc()) && (!empty($str))) {
if (!empty($str)) {
return addslashes($str);
} else {
return $str;
}
}
/**************************************************************/
/* ADD YOUR CUSTOM FUNCTIONS BELOW */
/**************************************************************/
// class : end
}
?>
New form page - the cool functionality. need you to plug this in and see if it works.
test_form.php
<html>
<?php
// include your class code
include('tour_request.class.php');
$tr = new tour_request();
$requests = $tr->select_specific_info();
?>
<body>
<table>
<?
foreach ($requests as $request) {
?>
<tr>
<td> <h3><?php echo $request->get_bookingDate(); ?></h3> </td>
<td> <h3><a href=\"javascript:decision('<?php echo $id;?>','action=lookup');\"><?php echo $request->get_request_id(); ?></h3></a> </td>
<td> <h3><?php echo $request->get_destination(); ?></h3> </td>
<td> <h3><?php echo $request->get_request_by(); ?></h3> </td>
</tr>
<?
}
?>
</table>
</body>
</html>
does this work, are you getting errors, I am looking at the ajax function now.