Staff Directory

"); $con = mysqli_connect( getenv("DB_HOST"), getenv("DB_USERNAME"), getenv("DB_PASSWORD"), getenv("DB_DATABASE"), getenv("DB_PORT") ); if (mysqli_connect_errno()) { error_log(mysqli_connect_error()); die; } //used to find if there are any profiles at the path listed. $param = $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM cms_personnel_ou_pub WHERE link LIKE ?"); $query->bind_param("s", $param); $query->execute(); $result = $query->get_result(); $row_cnt = mysqli_num_rows($result); $addsq = ''; if ($additional != '') { $additions = explode(",", $additional); foreach ($additions as $uid) { if (isset($qs) && $qs != '') { $addsq .= " OR userid = '" . trim($uid) . "'"; } else { if ($addsq != '') { $addsq .= " OR"; } else { $addsq .= "("; } $addsq .= " userid = '" . trim($uid) . "'"; } } $addsq .= ")"; $addsq .= " and link like '" . $site . "%'"; if ($manual != '') { $addsq = ' OR ' . $addsq; } } //Alex added to initalize variables $manualq = ''; $qs = ''; $linkq = ''; if ($manual != '') { $manualq = " order by FIELD (userid"; $qs = ""; $manual_order = explode(",", $manual); foreach (array_reverse($manual_order) as $uid) { if ($uid != '') { $manualq .= ",'" . trim($uid) . "'"; if ($qs != '') { $qs .= " OR "; } $qs .= "(userid = '" . trim($uid) . "' AND link like '" . $site . "%')"; } } $manualq .= ") desc, REPLACE(lastname,\"-\",\"\") asc, firstname asc"; } if ($path != '' && $row_cnt > 0) { if ($qs == '' && $addsq == '' && $linkq == '' && $manualq == '') { $linkq = "link like '" . $path . "%'"; $manualq .= "ORDER BY REPLACE(lastname,\"-\",\"\"), firstname asc"; } else { $linkq = "OR link like '" . $path . "%'"; } } else { if ($qs == '' && $addsq == '' && $linkq == '' && $manualq == '') { $linkq = "link like '" . $link . "%'"; } else { $linkq = ""; } } if ($manual == '') { if ($manualq == '') { $manualq = "order by REPLACE(lastname,\"-\",\"\") asc, firstname asc"; } } $query = "Select * from cms_personnel_ou_pub where $qs $addsq $linkq $manualq"; $result = mysqli_query($con, $query); unset($_GET['ct']); $md5name = http_build_query($_GET); // define the path and name of cached file $cachefile = 'cache/'.urlencode($link).'-'.md5($md5name)."&number=".mysqli_num_rows($result).'.txt'; // define how long we want to keep the file in seconds. //$cachetime = 7200; //1 hours --- need to fine tune // Check if the cached file is still fresh. If it is, serve it up and exit. if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile) && filesize($cachefile) > 0) { echo ""; include($cachefile); mysqli_close($con); exit; } if (mysqli_num_rows($result) > 0) { ob_start(); if ($displaytype == 'focus') { echo "
"; } if ($displaytype == 'publications') { echo "
"; } while($row = mysqli_fetch_assoc($result)) { $this_profile_exists = file_exists("/export/ou_cms_publish/htdocs/" . ltrim($row["link"], "/")); $main_profile_exists = file_exists("/export/ou_cms_publish/htdocs/" . ltrim($row["main_profile"], "/")); if ($this_profile_exists || $type == 'prv') { $link = ''; if ($row['main_profile'] != '') { $main_profile = $row['main_profile']; $query = mysqli_prepare($con, "SELECT * FROM cms_personnel_ou_pub WHERE link = ?"); $query->bind_param("s", $main_profile); $query->execute(); $result2 = $query->get_result(); while ($row2 = mysqli_fetch_assoc($result2)) { $row2['link'] = $row['link']; $row = $row2; } } $row['link'] = str_replace("index.html","",$row['link']); if ($displaytype == 'focus') { //insert faculty focus code here $preview_text = HtmlTruncator::make() ->ellipsis(" . . .") ->mode(TruncateMode::WORD) ->truncate($row["bio"], 100); ?>
" alt="" class="img" />

".$education[0]."

";} ?>

Contact



0) { echo "

    "; } if($titles[0] != '') { echo "
  • ".$titles[0]."
  • ";} ?> 0) { echo "
"; } ?>

ellipsis(" . . .") ->mode(TruncateMode::WORD) ->truncate($row["bio"], 250); ?>

= 0) { echo $titles[0].": "; } ?>

0) { echo "
    "; } foreach ($degrees as $value) { if($value != '') { echo "
  • ".$value."
  • ";} } ?> 0) { echo "
"; } ?>

20) { if($row['bio_title'] != '') { echo $row['bio_title']; } else { echo 'Biography'; } }?>

ellipsis(" . . .") ->mode(TruncateMode::WORD) ->truncate($row["bio"], 250); ?>

0) { echo "
    "; } foreach ($titles as $value) { if($value != '') { echo "
  • ".$value."
  • ";} } ?> 0) { echo "
"; } ?>
0) { echo "
    "; } foreach ($degrees as $value) { if($value != '') { echo "
  • ".$value."
  • ";} } ?> 0) { echo "
"; } ?>

",$row['right_specialty']); $research_areas = ""; $count = count($array); $i = 1; foreach ($array as $area ) { $area = strip_tags($area); $area = trim($area); while(true) { if(substr($area, -1) == " "){ $area = substr($area,0,-1); } else { break; } } if ($area != ""){ if($count == $i){ $research_areas = $research_areas.$area; } else { $research_areas = $research_areas.$area."; "; } } $i++; } ?> "; if ($main_profile_exists) { ?>
<?php echo $row['firstname'] . " src="" class="img" />
'; echo ''; } ?>

0) { echo "
    "; } foreach ($titles as $value) { if($value != '') { echo "
  • ".$value."
  • ";} } ?> 0) { echo "
"; } ?>
'; ?>
"; if($row['left_specialty_title'] != '') { echo "

".$row['left_specialty_title']."

"; } echo $row['left_specialty']."
"; } if(trim($row['left_specialty2'] != '')) { //the left was added to fix this page -- https://www.mtu.edu/atmospheric/alumni/ echo "
"; if($row['left_specialty2_title'] != '') { echo "

".$row['left_specialty2_title']."

"; } echo $row['left_specialty2']."
"; } } ?> '; ?> "; if($row['right_specialty_title'] != '') { echo "

".$row['right_specialty_title']."

"; } echo $row['right_specialty']."
"; } else { if(trim($row['right_specialty']) != '') { echo "
"; if($row['right_specialty_title'] != '') { echo "

".$row['right_specialty_title']."

"; } echo $row['right_specialty']."
"; } elseif(trim($row['left_specialty']) != '') { if($row['phone'] != '' || $row['cellphone'] != '' || $row['email'] != '' || $row['location'] != '' || $row['safeplace'] != '') { echo "
"; if($row['left_specialty_title'] != '') { echo "

".$row['left_specialty_title']."

"; } echo $row['left_specialty']."
"; } else { echo "
"; if($row['left_specialty_title'] != '') { echo "

".$row['left_specialty_title']."

"; } echo $row['left_specialty']."
"; } if(trim($row['left_specialty2'] != '')) { echo "
"; if($row['left_specialty2_title'] != '') { echo "

".$row['left_specialty2_title']."

"; } echo $row['left_specialty2']."
"; } if($row['phone'] != '' || $row['cellphone'] != '' || $row['email'] != '' || $row['location'] != '' || $row['safeplace'] != '') { echo "
"; } } elseif(trim($row['left_specialty']) == '' && trim($row['right_specialty']) == '' && trim($row['left_specialty2'] != '')) { if($row['phone'] == '' || $row['cellphone'] == '' || $row['email'] == '' || $row['location'] == '') { echo "
"; } else { echo "
"; } if($row['left_specialty2_title'] != '') { echo "

".$row['left_specialty2_title']."

"; } echo $row['left_specialty2']."
"; } } ?>
bind_param("s", $link); $query->execute(); } } if ($displaytype == 'focus') { echo "
"; } if ($displaytype == 'publications') { echo "
"; } if(strlen($_SERVER['QUERY_STRING']) > 10) { $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); } // finally send browser output ob_end_flush(); } mysqli_close($con); ?>