Skip to content

Commit

Permalink
added access control and Joins to reference tables
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinPradhan authored Mar 11, 2018
1 parent 1d2e8a0 commit b63424a
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions admin_report_member_expiry.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
<br>
<?php
session_start();

if(isset($_SESSION["sess_username"]))
{
echo '<h6>Your session is currently ACTIVE '.$_SESSION["sess_username"].'</h6>';
}
else
{
header("location:index.php");
}

if( $_SESSION['sess_user_type'] == "A") {

}
else {
header('Location: index.php');
}
?>

<!-- INSTRUCTIONS: this is the header and footer template for the primary ADMIN pages. Code your forms, tables, etc., below the navigation tags. Placeholders have been included where variables will be displayed based on session login information for the user. Leave these "AS IS" for now. To maintain consistency, please do not change the header information other than where indicated with additional comments. -->

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css">
<link rel="stylesheet" type="text/css" href="css/new_master_stylesheet.css">
<title>Membership and Accounting System (MAS)</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down Expand Up @@ -71,7 +92,9 @@
$pdo = Database::connect();
$sql = 'SELECT *
FROM member a
LEFT JOIN Membership b ON a.mem_no=b.membership_no';
LEFT JOIN Membership b ON a.mem_no=b.membership_no
LEFT JOIN ref_member_catg c ON a.mem_category_cd=c.ref_mem_category_cd
LEFT JOIN ref_member_type d ON a.mem_type=d.ref_mem_typ';


foreach ($pdo->query($sql) as $row) {
Expand All @@ -80,8 +103,8 @@
echo '<td>'. $row['mem_fname'] . '</td>';
echo '<td>'. $row['mem_mi'] . '</td>';
echo '<td>'. $row['mem_lname'] . '</td>';
echo '<td>'. $row['mem_category_cd'] . '</td>';
echo '<td>'. $row['mem_type'] . '</td>';
echo '<td>'. $row['ref_mem_category_desc'] . '</td>';
echo '<td>'. $row['ref_mem_typ_desc'] . '</td>';
echo '<td>'. $row['membership_eff_date'] . '</td>';
echo '<td>'. $row['membership_term_date'] . '</td>';
echo ' ';
Expand Down

0 comments on commit b63424a

Please sign in to comment.