[insert_php] session_start(); $copy_year = date(“Y”); $error_extra = ‘error_page.php’; $mysqli = new mysqli(‘127.0.0.1′,’tdgclien_leaders’,’Leadership_0′,’tdgclien_leadership_w’); if (mysqli_connect_errno()) { die(“Error connecting to DB”); } $user = $mysqli->real_escape_string($user); $bio_id = 0; $bio_id = $_GET[‘bio_id’]; $query = “SELECT * FROM CurrentClass WHERE alumniID != ‘0’ ORDER BY lastName ASC”; $result = $mysqli->query($query); if (!$result) { mysqli_close($mysqli); $_SESSION[‘DB_ERROR’] = $user; $host = $_SERVER[‘HTTP_HOST’]; $uri = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\\’); //header(“Location: http://$host$uri/../$error_extra”); $message = “User Name Query Failed 1.”; die($message); } $n = $result->num_rows; if ($n >0){ $y = $n-1; $x = rand(0,$y); $host = $_SERVER[‘HTTP_HOST’]; $uri = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\\’); $location =”http://$host$uri/meet-the-class?bio_id=”; $current_class_roster = ‘‘; for ($i=0; $i<$n; $i++) { $row = $result->fetch_assoc(); $alumniID = $row[‘alumniID’]; $this_one = FALSE; if (($bio_id==$alumniID) || (($bio_id <= 0) && ($i == $x))){ $this_one = TRUE; $bio = $row['bio']; $bio_place = $i; $tot_bio =$n-1; $classYear = get_max_alumni_year($mysqli)+1; $current_class_headline = '‘.$classYear.’ Current Class
‘; $user_name = ‘‘.$row[‘firstName’].’ ‘.$row[‘lastName’].’
‘; $bio_text = ‘‘.$bio.’
‘; $_SESSION[‘BIO_ID’] = $row[‘alumniID’]; $email_string= ‘Email: ‘.$row[’email’].’

‘; if (isset($_SESSION[‘CC_USER’]) || (isset($_SESSION[‘ALUMNI_USER’]))) { $bio_details = ‘‘.$row[‘title’].’
‘.$row[‘company’].’
‘.$row[‘address1′].’
‘.$row[‘city’].’,’.$row[‘state’].’ ‘.$row[‘zip’].’
Phone:(‘.$row[‘area’].’) ‘.$row[‘phoneNumber’].’
Fax:(‘.$row[‘faxarea’].’) ‘ .$row[‘faxNumber’].’
‘.$email_string.’Class ‘.$row[‘classYear’].’
‘; } else { $bio_details = ‘‘.$row[‘title’].’
‘.$row[‘company’].’
‘.$row[‘address1′].’
‘.$row[‘city’].’,’.$row[‘state’].’ ‘.$row[‘zip’].’
‘.’Class ‘.$row[‘classYear’].’
‘; } } /* Build current_class_roster */ $this_bio = $location.$row[‘alumniID’]; if (!$this_one) $current_class_roster .= ‘‘.$row[‘lastName’].’, ‘.$row[‘firstName’].’
‘; else //$current_class_roster .= ‘‘.$row[‘lastName’].’, ‘.$row[‘firstName’].’
‘; } $current_class_roster .=’‘; //mysqli_close($mysqli); } else{ mysqli_close($mysqli); $current_class_empty = “current-class-empty.php”; $host = $_SERVER[‘HTTP_HOST’]; $uri = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\\’); //header(“Location: http://$host$uri/../$current_class_empty”); $message = “User Name Query Failed. 2”; die($message); } function get_max_alumni_year($mysqli) { $query = “SELECT * FROM Alumni WHERE alumniID != ‘0’ ORDER BY classYear DESC LIMIT 1”; $classYear = ‘0000’; $result = $mysqli->query($query); if ($result) { $row = $result->fetch_assoc(); $classYear = $row[‘classYear’]; } return($classYear); } $bio_id = $_SESSION[‘BIO_ID’]; $query = “SELECT * FROM CurrentClass WHERE alumniID ='”.$bio_id.”‘ LIMIT 1;”; $result = $mysqli->query($query); if (!$result) { mysqli_close($mysqli); $_SESSION[‘DB_ERROR’] = $user; $host = $_SERVER[‘HTTP_HOST’]; $uri = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\\’); // header(“Location: http://$host$uri/../$error_extra”); $message = “User Name Query Failed. 3″; die($message); } $n = $result->num_rows; if ($n >0){ $_SESSION[‘USER’] = $user; $row = $result->fetch_assoc(); if ($row[‘photo’] > ”) $cc_image_src = ‘https://www.leadershipwv.org/photos/alumni/’.$row[‘photo’]; else $cc_image_src = ”; //’http://www.leadershipwv.org/photos/alumni/MissingPhotoGraphic.jpg’; mysqli_close($mysqli); } else{ mysqli_close($mysqli); $current_class_roster = ‘

Currently No Class Members


‘; $cc_image_src = ”; //’http://www.leadershipwv.org/photos/alumni/MissingPhotoGraphic.jpg’; } $x = strlen($cc_image_src); if ($x > 1) { $height = 275; $width = 198; $iwidth = 1/3; $fa = ’45px’; } else { $height = 0; $width = 0; $iwidth = 0; } [/insert_php]
echo “$fa”; [/insert_php]” width=”2/3″]
echo “$fa”; [/insert_php]” width=”0″]
echo “$fa”; [/insert_php]” width=”0″;]

[insert_php] echo “$user_name”; [/insert_php]

[insert_php] echo “$bio_details”; [/insert_php]


[insert_php] echo “$bio_text”; [/insert_php]

Browse Current Class Roster

[insert_php] echo “$current_class_roster”; [/insert_php]
[insert_php]echo ““;[/insert_php]