Hey guys,
[php]<?php
session_start();
include(“db_connect.php”);
if(($_SESSION[‘user_id’]) && ($_SESSION[‘access_level’] == 1 ))
{
?>
-
View and/or Edit Person
<?php
$ops = '';
$sql_select = "select person_id, first_name, middle_name, last_name from `person` order by `last_name` asc ";
$retval_selectperson = mysql_query( $sql_select, $conn );
if(! $retval_selectperson ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectperson))
{
$ops .= "{$row['first_name']} {$row['middle_name']} {$row['last_name']}";
}
?>
Select a Person --- Select a Person --- <?php echo $ops;?>
-
View and/or Edit Company
<?php
$ops = '';
$sql_select = "select * from `company` order by `company_name` asc ";
$retval_selectcompany = mysql_query( $sql_select, $conn );
if(! $retval_selectcompany ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectcompany))
{
$ops .= "{$row['company_name']}";
}
?>
Select a Company --- Select a Company --- <?php echo $ops;?>
-
View and/or Edit Category
<?php
$ops = '';
$sql_select = "select * from `category` order by `category` asc ";
$retval_selectcategory = mysql_query( $sql_select, $conn );
if(! $retval_selectcategory ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectcategory))
{
$ops .= "{$row['category']}";
}
?>
Select a Category --- Select a Category --- <?php echo $ops;?><?php $_SESSION['edit_category'] = $_POST['category_id'] ?>
-
View and/or Edit Campus
<?php
$ops = '';
$sql_select = "select * from `campus` order by `campus_name` asc ";
$retval_selectcampus = mysql_query( $sql_select, $conn );
if(! $retval_selectcampus ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectcampus))
{
$ops .= "{$row['campus_name']}";
}
?>
Select a Campus --- Select a Campus --- <?php echo $ops;?><?php $_SESSION['edit_campus'] = $_POST['campus_id'] ?>
-
View and/or Edit Documents for a Person
<?php
$ops = '';
$sql_select = "select person_id, first_name, middle_name, last_name from `person` order by `last_name` asc ";
$retval_selectperson = mysql_query( $sql_select, $conn );
if(! $retval_selectperson ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectperson))
{
$ops .= "{$row['first_name']} {$row['middle_name']} {$row['last_name']}";
}
?>
Select a Person --- Select a Person --- <?php echo $ops;?><?php $_SESSION['edit_documents'] = $_POST['person_id'] ?>
-
View and/or Edit Education for a Person
<?php
$ops = '';
$sql_select = "select person_id, first_name, middle_name, last_name from `person` order by `last_name` asc ";
$retval_selectperson = mysql_query( $sql_select, $conn );
if(! $retval_selectperson ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectperson))
{
$ops .= "{$row['first_name']} {$row['middle_name']} {$row['last_name']}";
}
?>
Select a Person --- Select a Person --- <?php echo $ops;?><?php $_SESSION['edit_education'] = $_POST['person_id'] ?>
-
View and/or Edit Employment for a Person
<?php
$ops = '';
$sql_select = "select person_id, first_name, middle_name, last_name from `person` order by `last_name` asc ";
$retval_selectperson = mysql_query( $sql_select, $conn );
if(! $retval_selectperson ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectperson))
{
$ops .= "{$row['first_name']} {$row['middle_name']} {$row['last_name']}";
}
?>
Select a Person --- Select a Person --- <?php echo $ops;?><?php $_SESSION['edit_employment'] = $_POST['person_id'] ?>
-
View and/or Edit Intake for a Person
<?php
$ops = '';
$sql_select = "select person_id, first_name, middle_name, last_name from `person` order by `last_name` asc ";
$retval_selectperson = mysql_query( $sql_select, $conn );
if(! $retval_selectperson ) { die('Could not select data: ' . mysql_error()); }
while($row = mysql_fetch_assoc($retval_selectperson))
{
$ops .= "{$row['first_name']} {$row['middle_name']} {$row['last_name']}";
}
?>
Select a Person --- Select a Person --- <?php echo $ops;?><?php $_SESSION['edit_intake'] = $_POST['person_id'] ?>
That is the code for the form page. Now, when I select an option and click the button, I need the relevant page to open. I would need to code a select query using the session variable in the sql statement to get the relevant record. Any ideas on how this is done?