<?php # profile.php
// This script will be the base page to set up the user's profile
require ('includes/config.inc.php');
$page_title = 'Your Profile';
include ('includes/header.html');
require (MYSQL);
// If no first_name session variable exists, redirect the user:
if (!isset($_SESSION['person_id'])) {
$url = BASE_URL . 'index.php'; // Define the URL.
ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.
}
// header
echo "<h1>$page_title</h1><br />";
refresh_session(0); // Refresh session settinings incase of previous changes
/*
// change password
$url = BASE_URL . 'change_password.php';
echo "<h3><a href=$url>Change your Password</a></h3><br />";
// edit prsonal info
$url = BASE_URL . 'edit_personal_info.php';
echo "<h3><a href=$url>Edit your personal information</a></h3>
<p>update this information in order to post your stats</p><br />";
// edit work info
$url = BASE_URL . 'edit_work_info.php';
echo "<h3><a href=$url>Edit your work information</a></h3>
<p>update this information in order to post your stats</p><br />";
*/
switch ($_SESSION['user_level']) {
case 1: // user_level = 1
// change password
$url = BASE_URL . 'change_password.php';
echo "<h3><a href=$url>Change your Password</a></h3><br />";
// edit prsonal info
$url = BASE_URL . 'edit_personal_info.php';
echo "<h3><a href=$url>Edit your personal information</a></h3>
<p>(1 of 3) update this information in order to start posting your stats</p><br />";
// edit work info
$url = BASE_URL . 'edit_work_info.php';
echo "<h3>Edit your work information</h3>
<p>(2 of 3) update this information in order to start posting your stats<br>
<small>First update your personal information.</small></p><br />";
// edit inventory info
$url = BASE_URL . 'edit_inventory_info.php';
echo "<h3>Edit your inventory information</h3>
<p>(3 of 3) update this information in order to start posting stats<br>
<small>First update your personal information.</small></p><br />";
break;
case 2: // user_level = 2
// change password
$url = BASE_URL . 'change_password.php';
echo "<h3><a href=$url>Change your Password</a></h3><br />";
// edit prsonal info
$url = BASE_URL . 'edit_personal_info.php';
echo "<h3><a href=$url>Edit your personal information</a></h3><br />";
// edit work info
$url = BASE_URL . 'edit_work_info.php';
echo "<h3><a href=$url>Edit your work information</a></h3>
<p>(2 of 3) update this information in order to start posting stats</p><br />";
// edit inventory info
$url = BASE_URL . 'edit_inventory_info.php';
echo "<h3>Edit your inventory information</h3>
<p>(3 of 3) update this information in order to start posting stats<br>
<small>First update your work information.</small></p><br />";
break;
case 3: // user_level = 3
// change password
$url = BASE_URL . 'change_password.php';
echo "<h3><a href=$url>Change your Password</a></h3><br />";
// edit prsonal info
$url = BASE_URL . 'edit_personal_info.php';
echo "<h3><a href=$url>Edit your personal information</a></h3><br />";
// edit work info
$url = BASE_URL . 'edit_work_info.php';
echo "<h3><a href=$url>Edit your work information</a></h3><br />";
// edit inventory info
$url = BASE_URL . 'edit_inventory_info.php';
echo "<h3><a href=$url>Edit your inventory information</a></h3>
<p>(3 of 3) update this information in order to start posting stats</p><br />";
break;
case 4: // user_level = 4
// change password
$url = BASE_URL . 'change_password.php';
echo "<h3><a href=$url>Change your Password</a></h3><br />";
// edit prsonal info
$url = BASE_URL . 'edit_personal_info.php';
echo "<h3><a href=$url>Edit your personal information</a></h3><br />";
// edit work info
$url = BASE_URL . 'edit_work_info.php';
echo "<h3><a href=$url>Edit your work information</a></h3><br />";
// edit inventory info
$url = BASE_URL . 'edit_inventory_info.php';
echo "<h3><a href=$url>Edit your inventory information</a></h3><br />";
// edit inventory info
$url = BASE_URL . 'add_deal.php';
echo "<h3><a href=$url>Add a Deal</a></h3><br />";
break;
}
/*
mysqli_free_result ($r);
mysqli_close($dbc);
*/
include ('includes/footer.html');
?>