=(CURDATE() - INTERVAL " . $months_old . " MONTH)"; } $sql .= " where (users_departments.affiliation in ('active')) and approved=true and users_departments.active=true and users.show_web=true and users.active=true " . $sqlaux; if ($order == 0) { $sql .= " order by publish_date desc, publications_categories.level, pubtype, lname, citation"; } else if ($order == 1) { $sql .= " order by lname, publications_categories.level, pubtype, publish_date desc, citation"; } else if ($order == 2) { $sql .= " order by pubtype,publications_categories.level, lname, publish_date desc, citation"; } else if ($order == 3) { $sql .= " order by publications_categories.level, pubtype, lname, publish_date desc, citation"; } if ($quantity > 0) { $sql .= " limit " . $quantity; } $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if ($format == 0 || $format == 2 || $format == 3) { $header = "h3"; } else if ($format == 1) { $header = "h2"; } $headerinfo = ""; $headerinfo2 = ""; while ($row = mysqli_fetch_assoc($result)) { if ($format == 1 && strcmp($headerinfo,$row['fullname']) != 0) { $headerinfo = $row['fullname']; $outHTML .= "
"; $outHTML .= "
"; $outHTML .= "<" . $header . ">" . $row['fullname']; if ($showed && !empty($row['degree'])) $outHTML .= ", " . $row['degree']; $outHTML .= "\r\n"; } else if ($format == 0 || $format == 3) { //$outHTML .= "
"; //$outHTML .= "
"; $outHTML .= "<" . $header . ">" . $row['fullname']; if ($showed && !empty($row['degree'])) $outHTML .= ", " . $row['degree']; $outHTML .= "\r\n"; } else if ($format == 2) { if (strcmp($headerinfo,$row['pubtype']) != 0) { $headerinfo = $row['pubtype']; $outHTML .= "
"; $outHTML .= "

" . $headerinfo . "

"; } if (strcmp($headerinfo2,$row['fullname']) != 0 ) { $headerinfo2 = $row['fullname']; $outHTML .= "
"; $outHTML .= "<" . $header . ">" . $row['fullname']; if ($showed && !empty($row['degree'])) $outHTML .= ", " . $row['degree']; $outHTML .= "\r\n"; } } $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) $outHTML .= '
Publication Image
'; $outHTML .= (($row['forthcoming']) ? "Forthcoming " : " ") . $row['publish_date'] . " " . html_entity_decode($row['citation'],ENT_COMPAT,"UTF-8") . ""; } mysqli_free_result($result); do_dbcleanup(); if (empty($outHTML)) { $outHTML = "

None.

"; } else if (!empty($quantity) || !empty($pub_category)){ $outHTML .= "

View more publications.

"; } echo $outHTML; } function print_cah_publications($id = 0, $pub_level = 0, $pub_category = 0, $quantity = 3, $months_old = 36, $format = 0, $order = 0, $forthcoming_allowed = true, $showed = true) { $sql = ""; $sqlaux = ""; $outHTML = ""; $header = "h2"; $format = intval($format); $pub_level = intval($pub_level) ; $pub_category = intval($pub_category); $months_old = intval($months_old); $quantity = intval($quantity); $order = intval($order); $forthcoming_allowed = (bool)$forthcoming_allowed; $showed = (bool)$showed; if (is_string($id) && !empty($id)) { $id = explode(",",$id); $id = array_map("intval",$id); if (array_sum($id) == 0) $id = 0; } $id = (!is_array($id) ? intval($id) : array_map("intval",$id)); if ($quantity < 0) { $quantity = 3; } if (empty($months_old) || $months_old < 0) $months_old = 36; if (!empty($id) && is_array($id)) { $values = implode(",",$id); $id = "(" . $values . ")"; } else if (!empty($id)) { $id = "(" . $id . ")"; } $sql = "select distinct users.id,publications.photo_path, forthcoming,DATE_FORMAT(publish_date,'%M %Y') as pubdate, citation, plural_description as pubtype, REPLACE(CONCAT_WS(' ',fname,mname,lname),' ',' ') AS fullname,(select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree, web from publications left join publications_categories on (publication_id=publications_categories.id) left join users on (users.id=publications.user_id) left join users_departments on (users_departments.user_id=users.id) right join departments on (users_departments.department_id = departments.id) "; if (!empty($pub_level)) { $sqlaux .= " and publications_categories.level <= " . $pub_level; } if (!empty($pub_category)) { $sqlaux .= " and publications_categories.id=" . $pub_category; } if (!$forthcoming_allowed) { $sqlaux .= " and publications.forthcoming=false"; } if (!empty($months_old)) { $sqlaux .= " and publish_date >=(CURDATE() - INTERVAL " . $months_old . " MONTH)"; } $sql .= " where (users_departments.affiliation in ('active')) and approved=true and users_departments.active=true and users.show_web=true and users.active=true " . $sqlaux; if ($order == 0) { $sql .= " order by publish_date desc, publications_categories.level, pubtype, lname, citation"; } else if ($order == 1) { $sql .= " order by lname, publications_categories.level, pubtype, publish_date desc, citation"; } else if ($order == 2) { $sql .= " order by pubtype,publications_categories.level, lname, publish_date desc, citation"; } else if ($order == 3) { $sql .= " order by publications_categories.level, pubtype, lname, publish_date desc, citation"; } if ($quantity > 0) { $sql .= " limit " . $quantity; } $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $header = "h3"; $headerinfo = ""; $headerinfo2 = ""; $printedpub = array(); while ($row = mysqli_fetch_assoc($result)) { if(!in_array($row['citation'],$printedpub)){ if($row['web'] == "http://www.cah.ucf.edu/") $row['web'] .= "about/"; if ($format == 0 || $format == 3) { $outHTML .= "<" . $header . ">" . $row['fullname']; if ($showed && !empty($row['degree'])) $outHTML .= ", " . $row['degree']; $outHTML .= "\r\n"; } $outHTML .= "
\r\n"; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) $outHTML .= '
Publication Image
'; $outHTML .= (($row['forthcoming']) ? "Forthcoming " : " ") . $row['publish_date'] . " " . html_entity_decode($row['citation'],ENT_COMPAT,"UTF-8") . "
"; $printedpub[] = $row['citation']; } } mysqli_free_result($result); do_dbcleanup(); if (empty($outHTML)) { $outHTML = "

None.

"; } //echo ""; echo $outHTML; } function sql_showstaffac($dept = 0, $ac = 0, $career_level = 0, $id = 0, $affiliation = "", $sort = 0, $public_web = true,$active_filter = true) { $sql = ""; $sqlaux = ""; $dept = intval($dept); $ac = intval($ac); $career_level = intval($career_level); $sort = intval($sort); $id = intval($id); $public_web = (bool) $public_web; if ($public_web) { $public_web = "and users.show_web=true "; } else { $public_web = ""; } if ($active_filter == true) { $active_filter = "and users_departments.active=true "; } else if ($active_filter == false) { $active_filter = "and users_departments.active=false "; } else { $active_filter = ""; } if (!empty($affiliation) && (is_string($affiliation) || is_array($affiliation))) { if (is_string($affiliation)) { $affiliation = explode(",",$affiliation); } if (is_array($affiliation)) { $affiliation = array_map("enquote",$affiliation); } $affiliation = implode(",",$affiliation); } else { $affiliation = '"active"'; } if ($dept < 0) $dept = 0; if ($ac < 0 ) $ac = 0; if ($career_level < 0) $career_level = 0; if ($id < 0) $id = 0; if (empty($dept)) return $sql; if (empty($sort)) { $sort = "ac, highestlevel,lname, fname"; } else if ($sort == 1) { $sort = "ac, lname, fname, highestlevel"; } else if ($sort == 2) { $sort = "ac, lname, fname"; } else if ($sort == 3) { $sort = "academic_categories.level,ac,lname, fname"; } if (!empty($ac)) $sqlaux = "and academics.academic_id=" . $ac . " "; if (empty($id)) { $sql = 'select distinct users.id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, photo_path, photo_extra, office, affiliation, interests,email,phone,academic_categories.description as ac, (select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree,'; $sql .= '(select institution from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as institution,'; $sql .= '(select IF(((select TRIM(CONCAT_WS(" ",titles.description,users_departments.title_description)) as description from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation . ') and ISNULL(users_departments.subdepartment_id) order by titles.level limit 1) IS NOT NULL),(select TRIM(CONCAT_WS(" ",titles.description,users_departments.title_description)) as description from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation .') and ISNULL(users_departments.subdepartment_id) order by titles.level limit 1),(select CONCAT(TRIM(CONCAT_WS(" ",titles.description,users_departments.title_description)), " of ",(select departments_sub.description from departments_sub where departments_sub.id=users_departments.subdepartment_id and users_departments.active=true order by subdepartment_id limit 1)) from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation . ') order by titles.level limit 1 ) )) as wtitle, '; $sql .= '(select IF(((select titles.level from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation . ') and ISNULL(users_departments.subdepartment_id) order by titles.level limit 1) IS NOT NULL),(select titles.level from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation . ') and ISNULL(users_departments.subdepartment_id) order by titles.level limit 1),(select titles.level from users_departments left join titles on (users_departments.title_id=titles.id) where users_departments.department_id=' . $dept. ' and users_departments.user_id=users.id and users_departments.active=true and users_departments.affiliation in (' . $affiliation . ') and (users_departments.subdepartment_id) IS NOT NULL order by subdepartment_id, titles.level limit 1 ) )) as highestlevel'; $sql .= ' from users left join users_departments on (users.id=users_departments.user_id) right join academics on (users.id=academics.user_id) left join academic_categories on (academics.academic_id=academic_categories.id and academic_categories.department_id=' . $dept . ') where (ISNULL(academics.career_level) or academics.career_level=' . $career_level . ') ' . $sqlaux.' and users.active=true ' . $public_web . $active_filter .' and academic_categories.description is not null and users_departments.affiliation in (' .$affiliation . ') and users_departments.department_id=' . $dept . ' order by ' .$sort; } else if (empty($dept)) { $sql = 'select Distinct users.id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, photo_path, photo_extra, office, affiliation, interests,email,phone,academic_categories.description as ac, (select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree '; $sql .= '(select institution from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as institution,'; $sql .= ' from users left join users_departments on (users.id=users_departments.user_id) right join academics on (users.id=academics.user_id) left join academic_categories on (academics.academic_id=academic_categories.id) where (ISNULL(academics.career_level) or academics.career_level=' . $career_level . ') ' . $sqlaux.' and users.active=true ' . $public_web . $active_filter .' and users_departments.affiliation in (' . $affiliation . ') order by ' .$sort; } return $sql; } function get_errors($error = 0) { $outHTML = ""; $proto = ""; if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on" || $_SERVER['HTTPS'] == "yes")) { $proto = "s"; } if (empty($error)) { return ""; } switch ($error) { case ERROR_EMPTY: case ERROR_FORMAT: case ERROR_NONMATCH: case ERROR_UPLOADFILETYPE: case ERROR_UPLOADNOFILE: case ERROR_TIME: case ERROR_ACCONFLICT: case ERROR_YESNO: $outHTML = "\"required\""; break; case ERROR_DUPLICATEADDRESS: default: $outHTML = "\"caution\""; break; } return $outHTML; } /* Main SQL statement to pull in terms available for courses Updates: - 10/17/2013: Uses new print_selectfield emptyvalue featuring removing the need to use SQL UNION to create default option - 10/17/2013: Changed to not select next year's summer of the current year */ function print_selectfield($field_name = "", $label = "", $directions = "", $source = "", $field = "", $value = "",$error = 0, $extra = "", $sql = "", $format = 0) { if (empty($field_name) || empty($label) || ((empty($source) || empty($field)) && empty($sql))) return ""; $outHTML = ""; $outOPTIONS = ""; $emptyvalue = false; // used to determine if the query provides a "default" if ($format == 1) $outHTML .= "
"; $outHTML .= "\r\n

"; if(!empty($directions)) { $outHTML .= "
$directions" ; } if (empty($sql)) $sql = "select \"-\" as " . $field . ", 0 as id UNION select " . $field . ",id from " . $source . " order by " . $field . " asc"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $outHTML .= "
" . get_errors($error) . "

"; if ($format == 1) $outHTML .= "
"; print $outHTML; do_dbcleanup(); } function sql_termselect($fiter_year = 0) { $sql = "select distinct term,term,CAST(SUBSTRING(term,LOCATE(' ',term)) AS UNSIGNED)+CAST(IF(SUBSTRING_INDEX(term, ' ', 1)='Fall',1,0) AS UNSIGNED) as ordering from courses where term != CONCAT('Summer ',(YEAR(NOW())+1)) order by ordering, term"; return $sql; } /* Format Styles: 0 - (Default) 2 columns under group names w/ Square thumnails 1 - One column alphabetical under group names w/ No thumbnails 2 - Two column centered cards under group names w/ Circle thumbnails 3 - Return an array of all the information, rather than HTML - Only when id != empty *** /global-styles.css must be included in functions.php for #2 to work properly. (See LAS/functions.php Line:1 for example) */ function print_staff_titlegroup($dept=0, $id=0, $format=0){ $returnData = array(); if(!empty($id)){ $sql = 'select photo_path, photo_extra, status_message,office_status, home_department, activities, awards,duties,research, interests, nid, phone, location,office, email, homepage, last_updated, room_id, has_cv, biography, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, (select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree from users where users.id='.$id.' and users.active=true AND users.show_web=true'; $sql .= ' and '. DEPT .' in (select department_id from users_departments where user_id=users.id AND users_departments.show_web=true AND users_departments.active = true)'; $sql .= " limit 1"; } else { $sql = '(select * from (select distinct users.id, fname,lname,affiliation, subdepartment_id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname,users.duties, users.photo_path,users.photo_extra, users.interests, users.email,users.phone, users.office, users.research, title_group,titles.level as highestlevel, titles.id as spectitle from users_departments inner join users on (users.id=users_departments.user_id and department_id=' . DEPT . ' and users.active and users_departments.active=true and affiliation in ("active","affiliated","associated","courtesy") and users.show_web=true ) inner join titles on (title_id=titles.id) left join departments_sub on (users_departments.user_id=users.id and users_departments.subdepartment_id=departments_sub.id and users_departments.subdepartment_id is not null) order by title_group asc ) as peeps where spectitle in(4,5,6,42) group by peeps.id order by affiliation, spectitle, lname asc, fname asc ) UNION (select * from (select distinct users.id, fname,lname,affiliation, subdepartment_id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname,users.duties, users.photo_path,users.photo_extra, users.interests, users.email,users.phone, users.office, users.research, title_group,titles.level as highestlevel,titles.id as spectitle from users_departments inner join users on (users.id=users_departments.user_id and department_id=' . DEPT . ' and users.active and users_departments.active=true and affiliation in ("active","affiliated","associated", "courtesy") and users.show_web=true ) inner join titles on (title_id=titles.id) left join departments_sub on (users_departments.user_id=users.id and users_departments.subdepartment_id=departments_sub.id and users_departments.subdepartment_id is not null) order by title_group asc ) as peeps where title_group in ("Faculty") group by peeps.id order by affiliation, lname asc, fname asc ) UNION (select * from (select distinct users.id, fname,lname,affiliation, subdepartment_id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname,users.duties, users.photo_path,users.photo_extra, users.interests, users.email,users.phone, users.office, users.research, title_group,titles.level as highestlevel,titles.id as spectitle from users_departments inner join users on (users.id=users_departments.user_id and department_id=' . DEPT . ' and users.active and users_departments.active=true and affiliation in ("active","affiliated","associated") and users.show_web=true ) inner join titles on (title_id=titles.id) left join departments_sub on (users_departments.user_id=users.id and users_departments.subdepartment_id=departments_sub.id and users_departments.subdepartment_id is not null) order by title_group asc ) as peeps where title_group in ("Part-time Faculty") group by peeps.id order by affiliation, lname asc, fname asc ) UNION (select * from (select distinct users.id, fname,lname,affiliation, subdepartment_id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, users.duties, users.photo_path,users.photo_extra, users.interests, users.email,users.phone, users.office, users.research,title_group,titles.level as highestlevel,titles.id as spectitle from users_departments inner join users on (users.id=users_departments.user_id and department_id=' . DEPT . ' and users.active and users_departments.active=true and affiliation in ("active","affiliated","associated", "courtesty") and users.show_web=true ) inner join titles on (title_id=titles.id) left join departments_sub on (users_departments.user_id=users.id and users_departments.subdepartment_id=departments_sub.id and users_departments.subdepartment_id is not null) order by title_group asc ) as peeps where spectitle not in(4,5,6,42) group by peeps.id order by affiliation, lname asc, fname asc )'; } if($format==1) { if(empty($id)) $sql = "select * from (" . $sql . ") as CAH_STAFF order by lname"; else $sql = "select * from (" . $sql . ") as CAH_STAFF"; } if (!empty($sql)) { $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if (!empty($id)) { if (mysqli_num_rows($result) == 1) { $row = mysqli_fetch_assoc($result); mysqli_free_result($result); } else { $outHTML = "Click Faculty and Staff for listing."; } } } if (empty($outHTML) && !empty($id)) { $returnData= $row; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); $outHTMLEd = ""; $outHTMLTitle = ""; $outHTMLPub = ""; $outHTMLLoc = ""; if (!empty($row['photo_path']) && file_exists($filename)) $outHTML = '' . $row['fullname'] . ''; $outHTMLfn = "

" . $row['fullname']; if (!empty($row['degree'])) $outHTMLfn .= ", " . $row['degree']; $outHTMLfn .= "

"; $outHTML .= $outHTMLfn; // Titles requires another query.... $sql = sql_showtitles(DEPT,SDEPT,$id); $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $outHTMLDir = "
    "; $outlen = strlen($outHTMLDir); // construct Titles output $titles_array = array(); while ($row2 = mysqli_fetch_assoc($result)) { array_push($titles_array, $row2); $outHTMLDir .= "
  • " . $row2['description'] . (!empty($row2['sdeptname']) ? " of " . $row2['sdeptname'] : "") . "
  • \r\n"; } $returnData['titles'] = $titles_array; mysqli_free_result($result); if (!empty($row['email'])) { $outHTMLDir .= "
  • " . $row['email'] . "
  • "; } if (!empty($row['phone'])) { $outHTMLDir .= "
  • " . $row['phone'] . "
  • "; } if (!empty($row['office'])) { $outHTMLDir .= "
  • Office Hours: " . $row['office'] . "
  • "; } if (!empty($row['room_id'])) { $sql = "select room_number, buildings.short_description,building_number from rooms left join buildings on (building_id=buildings.id) where rooms.id=" . $row['room_id']; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row2 = mysqli_fetch_assoc($result); $outHTMLLoc = "
  • Campus Location: "; array_push($returnData, $row2); if (!empty($row2['building_number'])) { $outHTMLLoc .= ""; } $outHTMLLoc .= $row2['short_description'] . $row2['room_number']; if (!empty($row2['building_number'])) { $outHTMLLoc .= ""; } $outHTMLLoc .= "
  • \r\n"; mysqli_free_result($result); } else if (!empty($row['location'])) { $outHTMLLoc = "
  • Campus Location: " . $row['location'] . "
  • \r\n";; } $outHTMLDir .= $outHTMLLoc; if (!empty($row['has_cv'])) { $outHTMLDir .= "
  • View CV
  • \r\n"; } else if (!empty($row['resume_path'])) { $external = ""; if (stripos($row['homepage'],"ucf.edu") === false) $external = ' rel="external" '; $outHTMLDir .= "
  • View CV
  • \r\n"; } if (!empty($row['homepage'])) { $external = ""; if (stripos($row['homepage'],"ucf.edu") === false) $external = ' rel="external" '; $outHTMLDir .= "
  • View personal website
  • \r\n"; } if (strlen($outHTMLDir) != $outlen) { $outHTMLDir .= "
\r\n"; } $outHTML .= $outHTMLDir . "\r\n"; if (!empty($row['biography'])) { $biography = html_entity_decode($row['biography'],ENT_QUOTES,"utf-8"); if (stripos($biography,"

") === false && stripos($biography,"

    ") !== 0) { $biography = "

    " . $biography . "

    "; } $outHTML .= $biography . "\r\n"; } $outHTMLEd = show_education($id); if (!empty($outHTMLEd)) $outHTML .= "

    Education

    " .$outHTMLEd; if (!empty($row['interests'])) { $interests = html_entity_decode($row['interests'],ENT_QUOTES,"utf-8"); if (stripos($interests,"

    ") === false && stripos($interests,"

      ") !== 0) { $interests = "

      " . $interests . "

      "; } $outHTML .= "

      Research Interests

      \r\n" . $interests . "\r\n"; } if (!empty($row['research'])) { $research = html_entity_decode($row['research'],ENT_QUOTES,"utf-8"); if (stripos($research,"

      ") === false && stripos($research,"

        ") !== 0) { $research = "

        " . $research . "

        "; } $outHTML .= "

        Recent Research Activities

        " . $research . "\r\n"; } // Publications requires another query.... $sql = "select publications.id,forthcoming,DATE_FORMAT(publish_date,'%M %Y') as pubdate, citation, plural_description as pubtype from publications left join publications_categories on (publication_id=publications_categories.id) where user_id=" .$id . " order by level, pubtype, publish_date desc,citation"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); // construct Publication output $publications = ""; $publications_array = array(); while ($row2 = mysqli_fetch_assoc($result)) { array_push($publications_array, $row2); if (strcmp($publications,$row2['pubtype'])) { $publications = $row2['pubtype']; if (!empty($outHTMLPub)) $outHTMLPub .= "
      "; $outHTMLPub .= "

      " . $publications . "

        "; } $outHTMLPub .= "
      • " . (($row2['forthcoming']) ? "Forthcoming " : " ") . $row2['publish_date'] . " " . html_entity_decode($row2['citation'],ENT_QUOTES,"utf-8"); $outHTMLPub .= "
      • \n"; } $returnData['publications'] = $publications_array; if (!empty($outHTMLPub)) { $outHTMLPub .= "
      "; } if (!empty($outHTMLPub)) $outHTML .= "

      Selected Publications

      " .$outHTMLPub; mysqli_free_result($result); if (!empty($row['awards'])) { $awards = html_entity_decode($row['awards'],ENT_QUOTES,"utf-8"); $outHTML .= "

      Awards

      "; if (stripos($awards,"

      ") === false && stripos($awards,"

        ") !== 0) { $awards = "

        " . $awards . "

        \r\n"; } $outHTML .= $awards . "\r\n"; } if (!empty($row['activities'])) { $activities = html_entity_decode($row['activities'],ENT_QUOTES,"utf-8"); $outHTML .= "

        Activities

        "; if (stripos($activities,"

        ") === false && stripos($activities,"

          ") !== 0) { $activities = "

          " . $activities . "

          \r\n"; } $outHTML .= $activities . "\r\n"; } $outHTMLCourses = print_instructorcourses_new($id); if (!empty($outHTMLCourses)) { $outHTML .= "

          Courses

          \r\n" . $outHTMLCourses; } if (!empty($row['last_updated'])) { $outHTML .= "

          Updated: " . date("M j, Y",strtotime($row['last_updated'])) . "

          \r\n"; } } // individual else if (empty($outHTML) && empty($id)) { $outHTML = "

          Faculty and Staff

          "; $positionholder = ""; $profid = array(); while ($row = mysqli_fetch_assoc($result)) { if($row['title_group'] == "Administrative Faculty") { $row['title_group'] = "Administration"; } if(!in_array($row['id'],$profid)) { $profid[] = $row['id']; if (strcmp($positionholder,$row['title_group'])) { if($positionholder) $outHTML .= "
"; $outHTML .= "
"; $outHTML .= "
"; $positionholder = $row['title_group']; if($format == 2) $outHTML .= "

" . $positionholder . "

"; else $outHTML .= "

" . $positionholder . "

"; $outHTML .= "
"; $outHTML .= "
"; if($format == 2) $outHTML .= "
"; else $outHTML .= "
"; } if(!strcmp($positionholder,"Chair")) //$outHTML .= "
"; $outHTML .= "
"; elseif($format == 0) $outHTML .= "
"; elseif($format == 2) $outHTML .= "
"; else $outHTML .= "
"; if (!empty($row['photo_path'])) $photo_file = $row['photo_path']; else $photo_file = "profilephoto.jpg"; if($format == 0) {$outHTML .= '';} if($format == 2) {$outHTML .= '
';} $outHTML .= "" . $row['fullname']; if (!empty($row['degree'])) $outHTML .= ", " . $row['degree']; $outHTML .= ""; /* query for all titles to show */ $sql = sql_showtitles(DEPT,SDEPT,$row['id']); $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); // construct Titles output while ($row2 = mysqli_fetch_assoc($result2)) { $outHTML .= "
" . $row2['description'] . (!empty($row2['sdeptname']) ? " of " . $row2['sdeptname'] : "") . ""; } mysqli_free_result($result2); if (!empty($row['email']) && $format != 2) { $outHTML .= "
" . $row['email'] . ""; } if (!empty($row['interests'])) { $interests = html_entity_decode($row['interests'],ENT_QUOTES,"utf-8"); if ((stripos($interests,"
    ") !== false) ) { $commainterests = ""; libxml_use_internal_errors(true); try { $XMLdoc = new SimpleXMLElement("" . $interests . ""); } catch (Exception $e) { $XMLdoc = NULL; } if ($XMLdoc != NULL) { $XPresult = $XMLdoc->xpath('ul/li'); while (list(,$node) = each($XPresult)) { if (!empty($commainterests)) $commainterests .= "; "; $commainterests .= trim($node); } } else { $interests = strip_tags($interests, "
  • "); $arrayinterests = explode("
  • ", $interests); foreach ($arrayinterests as &$value){ $value = trim($value); } $commainterests = implode("; ", $arrayinterests); $commainterests = ltrim($commainterests, "; "); } $interests = $commainterests; } else { $interests = str_ireplace("

    ","",$interests); $interests = str_ireplace("

    ","",$interests); } if(!strcmp($positionholder,"Chair")) $interests = "
    Research Interests: " . $interests . "";else if(!empty($interests)) if($format == 0) $interests = "
    Research Interests: " . substr($interests, 0, 100) . "......" . ""; elseif($format == 2) $interests = "
    Research Interests: " . substr($interests, 0, 100) . "......" . ""; else $interests = "
    Research Interests: " . $interests . ""; $outHTML .= $interests . "\r\n"; } // interests if($format==2) $outHTML .="
"; if (!empty($row['email']) && $format == 2) { $outHTML .= "" . $row['email'] . ""; } $outHTML .= "
"; // row end }//end of if profid } // while loop end } // if if($format==3) return $returnData; return $outHTML; } function print_staffac($dept = 0, $ac = 0, $career_level = 0, $id = 0, $affiliations = "", $sort = 0, $format = 0) { $outHTML = ""; $sql = sql_showstaffac($dept,$ac,$career_level,$id,$affiliations, $sort); if (empty($sql)) return; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); while ($row = mysqli_fetch_assoc($result)) { if ($format == 1 || $format == 3) { if (empty($outHTML)) { if ($format == 1) { $outHTML .= "

" . $row['ac'] . " Faculty

\r\n"; } $outHTML .= "
    \r\n"; } $outHTML .= "\t
  • " . $row['fullname'] . "
  • \r\n"; } else if ($format == 4) { if (empty($outHTML)) { if ($row['affiliation'] != "active") { $outHTML .= "

    " . ucfirst($row['affiliation']) . " Faculty

    \r\n"; } else $outHTML .= "

    Faculty

    \r\n"; $outHTML .= "
      \r\n"; } $outHTML .= "\t
    • " . $row['fullname']; if (!empty($row['degree'])) { $outHTML .= " (" . $row['degree']; } if (!empty($row['institution'])) { $outHTML .= ", " . $row['institution'] . ")
    • \r\n"; } } else { $outHTML .= "
      \r\n"; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) $outHTML .= '
      ' . $row['fullname'] . '
      '; $outHTML .= "\r\n\r\n"; if (!empty($row['interests'])) { $interests = html_entity_decode($row['interests'],ENT_QUOTES,"utf-8"); if ((stripos($interests,"
        ") !== false) ) { $commainterests = ""; libxml_use_internal_errors(true); try { $XMLdoc = new SimpleXMLElement("" . $interests . ""); } catch (Exception $e) { $XMLdoc = NULL; } if ($XMLdoc != NULL) { $XPresult = $XMLdoc->xpath('ul/li'); while (list(,$node) = each($XPresult)) { if (!empty($commainterests)) $commainterests .= "; "; $commainterests .= trim($node); } } else { $commainterests = str_ireplace("
      • ","; ",$interests); $commainterests = strip_tags($commainterests); } $interests = $commainterests; } else { $interests = str_ireplace("

        ","",$interests); $interests = str_ireplace("

        ","",$interests); } $interests = "

        Research Interests: " . $interests . "

        "; $outHTML .= $interests . "\r\n"; }// interests $outHTML .= "
      \r\n"; } } // loop if (!empty($outHTML) && ($format == 1 || $format == 3 || $format == 4)) { $outHTML .= "
    "; } mysqli_free_result($result); do_dbcleanup(); echo $outHTML; } function show_education($id = 0) { $outHTML = ""; if (empty($id)) return $outHTML; $sql = sql_showeducation($id); $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); // construct Education output while ($row = mysqli_fetch_assoc($result)) { if (empty($outHTML)) $outHTML = "
      "; $outHTML .= "
    • " . trim($row['description']); if (!empty($row['field'])) $outHTML .= " in " . trim($row['field']); if (!empty($row['institution'])) $outHTML .= " from " . trim($row['institution']); if (!empty($row['year'])) $outHTML .= " (" . $row['year'] . ")"; $outHTML .= "
    • \n"; } if (!empty($outHTML)) $outHTML .= "
    "; mysqli_free_result($result); do_dbcleanup(); return $outHTML; } function show_updates($dept = 0, $quantity = 2, $infostyle = 0, $sort = 0, $front = false) { /* all arguments are optional and will default */ /* Arguments in order: department, quantity, information, sort, front */ global $db_user, $db_pass, $db, $db_server; // connect to database $mysqli_link = mysqli_connect($db_server, $db_user, $db_pass) or DIE ("ERROR: The Database is temporarily down. We apologize for the inconvenience and will have the database restored as soon as possible."); mysqli_select_db($db, $mysqli_link); if (!strcasecmp($infostyle,"long")) { $infostyle = 0; } else if (!strcasecmp($infostyle,"blurb")) { $infostyle = 1; } else if (!strcasecmp($infostyle,"short")) { $infostyle = 2; } else if ($infostyle < 0 || $infostyle > 2) { $infostyle = 0; } if (!strcasecmp($sort,"dept")) { $sort = 0; } else if (!strcasecmp($sort,"date")) { $sort = 1; } else if (!strcasecmp($sort,"revdate")) { $sort = 2; } else if ($sort < 0 || $sort > 2) { $sort = 0; } if (!strcasecmp($front,"true")) { $front = true; } else if (!strcasecmp($front,"false")) { $front = false; } else if ($front < 0 || $front > 1 || !($front || !$front)) { $front = false; } $show_all = false; $quantity = intval($quantity); if (empty($quantity)) $quantity = 2; if (empty($dept) || !strcasecmp($dept,"all")) { $show_all = true; } // get today's date and put in right format $date = date("Y-m-d"); $sql = "select updates.*, departments.short_description as dd from updates, departments where (departments.id=updates.department_id) "; if (!$show_all) { $sqlaux = "and `department_id`=" . $dept . " "; } $sql = $sql . $sqlaux; $sqlaux = ""; if ($show_front) { $sqlaux = "and `show_front`=TRUE "; } $sql = $sql . $sqlaux; $sql = $sql . "order by "; if ($sort == 0) { $sql = $sql . "dd ASC, postdate ASC "; } else if ($sort == 1) { $sql = $sql . "postdate ASC, dd ASC "; } else if ($sort == 2) { $sql = $sql . "postdate DESC "; } else { $sql = $sql . "dd ASC, postdate desc"; } if ($quantity > 0) { $sql = $sql . "limit " . $quantity; } $result = mysqli_query($sql); check_result($result,$sql); $outHTML = ""; $display_dept = ""; while ($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $postdate = stripcslashes($row['postdate']); $title = stripcslashes($row['title']); $blurb_title = stripcslashes($row['blurb_title']); if (!isset($row['blurb_title']) || empty($row['blurb_title'])) $blurb_title = $title; $description = stripcslashes($row['description']); $photo_path = stripcslashes(trim($row['photo_path'])); $filename = COMMON_PATH . $photo_path; $filename = str_replace("/","\\",$filename); $photo_extra = stripcslashes(trim($row['photo_extra'])); $byline = stripcslashes($row['byline']); $links = stripcslashes($row['links']); // blurb if ($infostyle == 1) { $outHTML = $outHTML . '
    '; if (!empty($photo_path) && file_exists($filename)) $outHTML = $outHTML . '
    photo
    '; $outHTML = $outHTML . '

    ' . $blurb_title . '

    '; $klength = strlen($description); $description = chop_text($description,100,'next',"[Read More]"); $outHTML = $outHTML . $description . "


    "; } //blurb // short else if ($infostyle == 2) { if (empty($outHTML)) $outHTML = '
      '; $outHTML = $outHTML . '
    • ' . $postdate . ' ' . $blurb_title . '
    • \n'; } else { if ($show_all) { if ($display_dept != $row['dd']) { $display_dept = $row['dd']; $outHTML .= "

      " . $display_dept . ":
      "; } } $outHTML = $outHTML . '

      ' . $title . '

      '; if (!empty($photo_path) && file_exists($filename)) { $outHTML = $outHTML . '
      photo
      ' . "\n"; } $outHTML = $outHTML . '

      '; $description = strip_tags($description); $klength = strlen($description); $description = chop_text($description,600,'next',"[Read More]"); $outHTML = $outHTML . $description . "


      \n"; } //blurb }//end While //clean up and output if ($infostyle == 2) $outHTML = $outHTML . "
    "; if (empty($outHTML)) { $outHTML = "

    There are currently no updates.

    "; } echo $outHTML; mysqli_close($mysqli_link); } function print_updates($department = 0, $quantity = 2, $infostyle = 0, $sort = 0, $front = false) { if (!strcasecmp($infostyle,"long")) { $infostyle = 0; } else if (!strcasecmp($infostyle,"blurb")) { $infostyle = 1; } else if (!strcasecmp($infostyle,"short")) { $infostyle = 2; } else if (intval($infostyle) < 0 || intval($infostyle) > 2) { $infostyle = 0; } else { $infostyle = intval($infostyle); } if (!strcasecmp($sort,"dept")) { $sort = 0; } else if (!strcasecmp($sort,"date")) { $sort = 1; } else if (!strcasecmp($sort,"revdate")) { $sort = 2; } else if (intval($sort) < 0 || intval($sort) > 2) { $sort = 0; } else { $sort = intval($sort); } if (!strcasecmp($front,"true")) { $front = true; } else if (!strcasecmp($front,"false")) { $front = false; } else if (intval($front) < 0 || intval($front) > 1 || !($front || !$front)) { $front = false; } $show_all = false; $quantity = intval($quantity); if (empty($quantity) || $quantity < 0) $quantity = 2; if (empty($department) || !strcasecmp($department,"all")) { $show_all = true; } $sql = "select updates.*, departments.short_description as dd from updates left join departments on (departments.id=updates.department_id) where (`enddate` IS NULL or `enddate` > CURDATE())"; if (!$show_all) { $sql .= " and `department_id`=" . $department; } if ($show_front) { $sql .= " and `show_front`=TRUE "; } $sql .= " order by "; if ($sort == 0) { $sql .= " dd ASC, postdate ASC "; } else if ($sort == 1) { $sql .= " postdate ASC, dd ASC "; } else if ($sort == 2) { $sql .= " postdate DESC "; } else { $sql .= " dd ASC, postdate desc"; } if ($quantity > 0) { $sql .= " limit " . $quantity; } $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $outHTML = ""; $display_dept = ""; while ($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $postdate = stripcslashes($row['postdate']); $title = stripcslashes($row['title']); $blurb_title = stripcslashes($row['blurb_title']); if (!isset($row['blurb_title']) || empty($row['blurb_title'])) $blurb_title = $title; $description = stripcslashes($row['description']); $photo_path = stripcslashes(trim($row['photo_path'])); $filename = COMMON_PATH . $photo_path; $filename = str_replace("/","\\",$filename); $photo_extra = stripcslashes(trim($row['photo_extra'])); $byline = stripcslashes($row['byline']); $links = stripcslashes($row['links']); // blurb if ($infostyle == 1) { $outHTML .= '
    '; if (!empty($photo_path) && file_exists($filename)) $outHTML .= 'photo'; $outHTML .= '

    ' . $blurb_title . '

    '; $klength = strlen($description); $description = chop_text($description,100,'next',"[Read More]"); $outHTML .= "

    " . $description . "

    \n\r"; } //blurb // short else if ($infostyle == 2) { if (empty($outHTML)) $outHTML = '
      '; $outHTML .= "
    • " . $postdate . " " . $blurb_title . "
    • \n\r"; } else { if ($show_all) { if ($display_dept != $row['dd']) { $display_dept = $row['dd']; $outHTML .= "

      " . $display_dept . "

      "; } } $outHTML .= '

      ' . $title . '

      '; if (!empty($photo_path) && file_exists($filename)) { $outHTML .= 'photo' . "\n"; } $description = strip_tags($description); $klength = strlen($description); $description = chop_text($description,600,'next',"[Read More]"); $outHTML .= "

      " . $description . "


\n"; } //blurb }//end While //clean up and output if ($infostyle == 2 && !empty($outHTML)) $outHTML .= ""; if (empty($outHTML)) { $outHTML = "

There are currently no updates.

"; } echo $outHTML; do_dbcleanup(); } function print_departmentcontact($department = 0, $subdepartment = 0, $format = 0) { $outHTML = ""; $endtag = ""; $department = intval($department); if (is_numeric($subdepartment) && !empty($subdepartment)) $subdepartment = array(intval($subdepartment)); if (is_string($subdepartment) && !empty($subdepartment)) { $subdepartment = explode(",",$subdepartment); $subdepartment = array_map("intval",$subdepartment); if (array_sum($subdepartment) == 0) $subdepartment = 0; } if (empty($department) || $department < 0 || $subdepartment < 0) { echo "

This information is not available.

"; return; } $sql = "select address, paddress, fax, web, room_number, buildings.short_description as bsd,building_number"; if (!empty($subdepartment) && is_array($subdepartment)) { $values = "(" . implode(",",$subdepartment) . ")"; $sql .= ", departments_sub.phone, departments_sub.location,departments_sub.room_id, departments_sub.email as demail, REPLACE(CONCAT_WS(' ',fname,mname,lname),' ',' ') as fullname,departments_sub.short_description as dssd,users.email as uemail from departments_sub left join users on (departments_sub.contact_id=users.id) left join rooms on(rooms.id=departments_sub.room_id) left join buildings on (rooms.building_id=buildings.id) where departments_sub.id IN " . $values; } else { $sql .= ", departments.phone, departments.room_id, departments.location, departments.email as demail from departments left join rooms on(rooms.id=departments.room_id) left join buildings on (rooms.building_id=buildings.id) where departments.id=" . $department; } $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if (mysqli_num_rows($result) >= 1) { $outHTML = "
    \r\n"; $endtag = "
\r\n"; } while ($row = mysqli_fetch_array($result)) { $outHTMLLoc = ""; if (!empty($row['room_id'])) { if (!empty($row['building_number'])) { $outHTMLLoc .= ""; } $outHTMLLoc .= $row['bsd'] . $row['room_number']; if (!empty($row['building_number'])) { $outHTMLLoc .= ""; } } else if (!empty($row['location'])) { $outHTMLLoc = trim($row['location']); } if (!empty($row['dssd']) && !empty($row['fullname'])) $outHTML .= "\t
  • " .$row['dssd'] . "
  • \r\n"; if (!empty($outHTMLLoc)) $outHTML .= "\t
  • Main Office: " . $outHTMLLoc . "
  • \r\n"; if (!empty($row['phone'])) $outHTML .= "\t
  • " .$row['phone'] . "
  • \r\n"; if (!empty($row['fax'])) $outHTML .= "\t
  • Fax: " . $row['fax'] . "
  • \r\n"; if (!empty($row['demail'])) $outHTML .= "\t
  • " . $row['demail'] . "
  • \r\n"; if (!empty($row['uemail'])) $outHTML .= "\t
  • " . $row['fullname'] . "
  • \r\n"; if (!empty($row['address'])) $outHTML .= "\t
  • Mailing Address:
    " . $row['address'] . "
  • \r\n"; if (!empty($row['paddress'])) $outHTML .= "\t
  • Physical Address:
    " . $row['paddress'] . "
  • \r\n"; } $outHTML .= $endtag; mysqli_free_result($result); $endtag = ""; if ($format == 0 && empty($subdepartment)) { $sql = "select short_description, phone, fax, email from departments_sub where department_id=" . $department . " and (phone is not NULL or fax is not NULL) order by short_description"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if (mysqli_num_rows($result) > 0) { $outHTML .= "

    Other Department Contacts

    \n\r
      \r\n"; $endtag = "
    \r\n"; } while ($row = mysqli_fetch_assoc($result)) { $outHTML .= "\t
  • " . $row['short_description'] . "
  • \r\n"; if (!empty($row['phone'])) $outHTML .= "
  • " . $row['phone'] . "
  • \r\n"; if (!empty($row['fax'])) $outHTML .= "
  • Fax: " . $row['fax'] . "
  • \r\n"; if (!empty($row['email'])) $outHTML .= "\t
  • " . $row['email'] . "
  • \r\n"; } $outHTML .= $endtag; } echo $outHTML; do_dbcleanup(); } function print_departments($format = 0) { $sql = "select description, web,courses_offered from departments where show_directory=true and id<>11 order by courses_offered desc, description"; $outHTML = ""; $offered_flag = true; $result = mysqli_query(get_dbconnection(),$sql); while ($row = mysqli_fetch_array($result)) { if (empty($outHTML)) { $outHTML = "

    Departments and Programs

      "; } if ($offered_flag && $row['courses_offered'] == false) { $outHTML .= "

    Centers, Institutes, and Offices

    \n\r"; echo $outHTML; do_dbcleanup(); } function show_name($id = 0,$link = false,$showed = true,$showmembership = true,$showtitle = true, $department = 0, $filter = 0) { $sql = $outHTML = ""; $in_db = false; $department = intval($department); $filter = intval($filter); $filter = ($filter > 2 || $filter < 0) ? $filter = 0 : $filter = $filter; if (empty($id)) return; $sql = 'select id, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, (select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree from users where id=' . $id . ' limit 1'; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if (mysqli_num_rows($result) == 0) { do_dbcleanup(); return; } $row = mysqli_fetch_assoc($result); $fullname = $row['fullname']; if ($showed & !empty($row['degree'])) $fullname .= ", " . $row['degree']; mysqli_free_result($result); $deptHTML = ""; $linkurl = ""; $rows = 0; $dsd = ""; $positions = 0; switch ($filter) { case 0 : $sqlaux = ""; break; case 1 : $sqlaux = " and users_departments.subdepartment_id IS NULL "; break; case 2 : $sqlaux = " and users_departments.subdepartment_id IS NOT NULL "; break; default: $sqlaux = ""; break; } $sql = "select in_db, departments.web,long_description as dname, TRIM(CONCAT_WS(\" \",titles.description,users_departments.title_description)) as workingtitle,departments_sub.description as dsd, multiple,affiliation from departments left join users_departments on (department_id=departments.id) left join titles on (users_departments.title_id=titles.id) left join departments_sub on (users_departments.subdepartment_id=departments_sub.id) where user_id=" . $id . ((!empty($department)) ? " and departments.id=" . $department : "") . $sqlaux . " order by users_departments.affiliation,departments.description"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $positions = mysqli_num_rows($result); while ($row = mysqli_fetch_assoc($result)) { $rows++; $notitle = false; $linkurl = ""; $link_closing = ""; if (empty($deptHTML)) { if (!$showtitle && $showmembership) { $deptHTML = " is part of "; } else if ($showtitle && $filter != 2) { $deptHTML = " is "; } else if ($showtitle && $filter == 2) { $deptHTML = ", "; } } else if ($showtitle || $showmembership) { $deptHTML .= ", "; if ($rows == $positions) $deptHTML .= "and "; } if ($showtitle) { $workingtitle = trim($row['workingtitle']); if (empty($workingtitle)) { $workingtitle = "member"; $notitle = true; } $affiliation = trim($row['affiliation']); if ($affiliation == "none" || $affiliation == "active") { $affiliation = ""; } else { $affiliation .= " "; } $affiliation = strtolower($affiliation); if ($filter != 2) { $workingtitle = strtolower($workingtitle); } $workingtitle = $affiliation . $workingtitle; if ($positions > 1) { if ((bool)($row['multiple']) == true || is_null($row['multiple'])) { $deptHTML .= (is_vowel(substr($workingtitle,0,1)) ? "an " : "a ") . $workingtitle; } else { $deptHTML .= "the " . $workingtitle; } } else { $deptHTML .= $workingtitle; } } if ($showtitle && $showmembership) { if ($notitle || !((bool)($row['multiple']) == true || is_null($row['multiple']))) { $deptHTML .= " of the "; } else { $deptHTML .= " in the "; } } if ($link) { if ($row['in_db'] && !empty($row['web'])) { $linkurl = ""; } else if ($row['in_db']) { $linkurl = ""; } else if (!empty($row['web'])) { $linkurl = ""; } if (!empty($linkurl)) { $link_closing = ""; } } $dsd = $row['dsd']; if ($showmembership) { if ($positions > 0) { $deptHTML .= $linkurl . $row['dname']; if (!empty($dsd)) { $deptHTML .= " " . $dsd; } $deptHTML .= $link_closing; } else { $deptHTML .= $row['dname']; } } else if ($showtitle && !empty($dsd)) { $deptHTML .= " of "; if ($positions > 1) { $deptHTML .= $linkurl .$dsd . $link_closing; } else { $deptHTML .= $dsd; } } } // loop if ($link && !($showmembership || ($showtitle && !empty($dsd)))) { $outHTML = $linkurl . $fullname . $link_closing; } else { if ($positions > 1) { $outHTML = $fullname . $deptHTML; } else { $outHTML = $linkurl . $fullname . $link_closing . $deptHTML; } } do_dbcleanup(); return $outHTML; } function print_departmentcalendarevents ($department = 0, $subdepartment = 0, $month = 0, $year = 0) { $outHTML = ""; $department = intval($department); $subdepartment = intval($subdepartment); $year = intval($year); $month = intval($month); if (is_string($id) && !empty($id)) { $id = explode(",",$id); $id = array_map("intval",$id); if (array_sum($id) == 0) $id = 0; } $id = (!is_array($id) ? intval($id) : array_map("intval",$id)); if ($quantity < 0) { $quantity = 3; } /* set defaults in case weird user or XSS */ if (empty($month)) { $month = date("n"); }; if (empty($year)) { $year = date("Y"); }; if (!empty($id) && is_array($id)) { $values = implode(",",$id); $id = "(" . $values . ")"; } else if (!empty($id)) { $id = "(" . $id . ")"; } if( $month < 12 ) { $next_month = $month+1; $next_year = $year; $next_link = "m=" . $next_month . "&" . "y=" . $year; } else { $next_year = $year+1; $next_link = "m=1&y=" . $next_year; $next_month = 1; } if( $month > 1 ) { $previous_month = $month-1; $next_month = $month+1; if ($next_month > 12) $next_month = 1; $previous_link = "m=". $previous_month . "&y=" . $year; $previous_year = $year; } else { $previous_year = $year-1; $previous_link = "m=12&y=".$previous_year; $previous_month = 12; } $table_caption_prev = date("F Y",mktime(0,0,0,$previous_month,1,$previous_year)); $table_caption = date("F Y",mktime(0,0,0,$month,1,$year)); $table_caption_next = date("F Y",mktime(0,0,0,$next_month,1,$next_year)); $outHTML = ''; $outHTML .= ''; $outHTML .= ''; $outHTML .= ''; $outHTML .= ''; $outHTML .= ""; $thismonth = mktime(0,0,0,$month,1,$year); $first_day = date("w",$thismonth); $total_days_in_month = date("t",$thismonth); for( $i = 0 ; $i < $first_day; $i++ ) { $outHTML .= ""; } // $sql = "select id,title,startdate,enddate from events where ( MONTH(startdate)=" .$month . " and YEAR(startdate)=" . $year . ")"; $sql = "select id,title,startdate,enddate from events where event_type='external' and ( startdate >= '" . $year . "-" . $month . "-01' and startdate < date_add('" . $year . "-" . $month . "-01',interval 1 month))"; if (!empty($department)) $sql .= " and department_id=" . $department; if (!empty($subdepartment) && $subdepartment > 0 ) { $sql .= " and `subdepartment_id`=" . $subdepartment; } $sql .= " order by startdate"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row = mysqli_fetch_assoc($result); $cpos = $first_day; for( $i = 1; $i <= $total_days_in_month ; $i++) { $class = ""; if( $i==date("j") && $month==date("n") && $year==date("Y") ) $class = "today"; $cpos++; $outHTML .= '"; if( $cpos == 7 ) { $outHTML .= "\r\n"; $cpos = 0; } } $last_day = 7-$cpos; for( $i = 0 ; $i < $last_day ; $i++ ) { $outHTML .= "\r\n"; } $outHTML .= "
    «' . $table_caption_prev . '' . $table_caption . '' . $table_caption_next . "»" . '
    SundayMondayTuesdayWednesdayThursdayFridaySaturday
     
    ' . $i . '
    '; if ($row) { $thisday = date("j",strtotime($row['startdate'])); $thiscellday = date("j",mktime(0,0,0,$month,$i,$year)); if ($thisday == $thiscellday ) { $outHTML .= "
      "; $outeventHTML = "
    • " . $row['title'] . "
    • "; while (($row = mysqli_fetch_assoc($result)) && (date("j",strtotime($row['startdate'])) == date("j",mktime(0,0,0,$month,$i,$year)))) { $outeventHTML .= "
    • " . $row['title'] . "
    • "; } $outHTML .= $outeventHTML . "
    "; } } $outHTML .= "
     
    \r\n"; if ($result) { mysqli_free_result($result); do_dbcleanup(); } echo $outHTML; } /** * print_departmentevents * * This function outputs events based of a given department in a variety of formats based on the parameters. * * @param (int) (department) the department id to show events for * @param (int) (subdepartment) the sub-department to show events for * @param (int) (quantity) the number of events to show * @param (int) (sort) the sorting direction; 1 for descending, 2 for usage_type, anything else for ascending * @param (int) (format) the format to output with; * @param (int) (id) When set to an id, only this event will show * @param (str/array) (usage) limits by type of event; exhibition, lecture, etc * @param (int) (hidden) will show or hide events when none exist; 0 for show, 1 for hidden */ function print_departmentevents ($department = 0, $subdepartment = 0, $quantity = 0, $sort = 0, $format = 0, $id = 0, $usage = "", $hidden = 0) { $subdepartmentdescription = ""; $outHTML = ""; $department = intval($department); $sort = intval($sort); $quantity = intval($quantity); $subdepartment = intval($subdepartment); $format = intval($format); if (is_string($id) && !empty($id)) { $id = explode(",",$id); $id = array_map("intval",$id); if (array_sum($id) == 0) $id = 0; } $id = (!is_array($id) ? intval($id) : array_map("intval",$id)); if ($quantity < 0) { $quantity = 3; } if($hidden == 1){ $displayheader = true; } if (!empty($id) && is_array($id)) { $values = implode(",",$id); $id = "(" . $values . ")"; } else if (!empty($id)) { $id = "(" . $id . ")"; } if (!empty($id)) { $sql = "select startdate,enddate,allday,title,events.location,events.room_id,cost,moreinfo,events.description,photo_path,photo_extra,event_type,audience_type,usage_type,media,departments.short_description as departmentdescription from events left join departments on (departments.id=events.department_id) where events.id IN " . $id . " "; } else { if (empty($department)) return; $sql = "(select events.id,title,startdate,enddate,allday,events.location,events.room_id,cost,moreinfo,events.description,photo_path,photo_extra,event_type,audience_type,usage_type,media,departments.short_description as departmentdescription from events left join departments on (departments.id=events.department_id) where `event_type`='external'"; if (!empty($usage) && (is_string($usage) || is_array($usage))) { if (is_string($usage)) { $usage = explode(",",$usage); } if (is_array($usage)) { $usage = array_map("enquote",$usage); } $usage = implode(",",$usage); $sql .= "and `usage_type` in (". $usage . ")"; } $sql.= " and `approved`=TRUE and DATE(enddate)" . (($sort == 1) ? "<" : ">=") . "CURRENT_DATE() and `department_id`=" . $department . " "; if (!empty($subdepartment) && $subdepartment > 0 ) { $sql .= "and `subdepartment_id`=" . $subdepartment . " "; $sql2 = "select short_description from departments_sub where id=" . $subdepartment . " limit 1"; $result = mysqli_query(get_dbconnection(),$sql2); check_result($result,$sql); $row = mysqli_fetch_assoc($result); $subdepartmentdescription = strtolower($row['short_description']) . " "; if ($format == 0) $outHTML .= "

    Showing only " . $subdepartmentdescription ."events.

    "; mysqli_free_result($result); } $sql .= ") UNION "; $sql .= "(select events.id,title,startdate,enddate,allday,events.location,events.room_id,cost,moreinfo,events.description,photo_path,photo_extra,event_type,audience_type,usage_type,media,departments.short_description as departmentdescription from events right join events_departments on (events.id=events_departments.event_id) left join departments on (departments.id=events_departments.department_id) where `event_type`='external' and `approved`=TRUE and DATE(enddate)" . (($sort == 1) ? "<" : ">=") . "CURRENT_DATE() and events_departments.department_id=" . $department . " "; if (!empty($subdepartment) && $subdepartment > 0 ) { $sql .= "and events_departments.subdepartment_id=" . $subdepartment . " "; } $sql .= ") "; } $sql .= "order by "; if ($sort == 1) { $sql .= "startdate DESC "; } else if ($sort == 2){ $sql .= "usage_type ASC"; } else { $sql .= "startdate ASC "; } if ($quantity > 0 && empty($id)) { $sql .= "limit " . $quantity; } $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); if (!$result) { echo "

    This information is currently unavailable.

    "; return; } while ($row = mysqli_fetch_assoc($result)) { $starttime = strtotime($row['startdate']); $endtime = strtotime($row['enddate']); $startdate = getdate($starttime); $enddate = getdate($endtime); $title = trim($row['title']); $photo = ""; $photosize = 2; if (empty($id)) $photosize = 1; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) { $photo = "\"photo\""; } if ($startdate["yday"] == $enddate["yday"]) { if (($startdate["hours"] == $enddate["hours"] && $startdate["minutes"] == $enddate["minutes"]) || ( empty($enddate["hours"]) && empty($enddate["minutes"]) )) { $dateinfo = date("l, F j, Y; g:ia",$starttime); } else { $dateinfo = date("l, F j, Y; g:ia", $starttime) . " - " . date("g:ia",$endtime); } } else { $dateinfo = date("l, F j, Y",$starttime) . " - " . date("l, F j, Y",$endtime); if (((empty($enddate["hours"]) && !empty($enddate["minutes"])) || (!empty($enddate["hours"]) && empty($enddate["minutes"]))) && ((empty($startdate["hours"]) && !empty($startdate["minutes"]) || (!empty($startdate["hours"]) && empty($enddate["minutes"]) )))) { $dateinfo .= "; " . date("g:ia",$starttime) . " - " . date("g:ia",$endtime); } } if ($format == 0) { $outHTML .= "
    "; if (!empty($photo)) $outHTML .= "
    " . $photo . "
    \r\n"; $outHTML .= "

    " . $title . "

    \n"; $outHTML .= "

    " . $dateinfo . "

    "; $outHTMLLoc = ""; if (!empty($row['room_id'])) { $sql = "select room_number, buildings.description as bsd, rooms.description as rd, building_number from rooms left join buildings on (building_id=buildings.id) where rooms.id=" . $row['room_id'] . " limit 1"; $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row2 = mysqli_fetch_assoc($result2); $outHTMLLoc = "Campus Location: "; if (!empty($row2['building_number'])) { $outHTMLLoc .= ""; } $outHTMLLoc .= $row2['bsd'] . ", " . $row2['rd']; if (empty($row2['rd']) && !empty($row2['room_number'])) { $outHTMLLoc .= "Room " . $row2['room_number']; } else if (!empty($row2['room_number'])) { $outHTMLLoc .= "(" . $row2['room_number'] . ")"; } if (!empty($row2['building_number'])) { $outHTMLLoc .= ""; } $outHTMLLoc .= "
    "; mysqli_free_result($result2); } else if (!empty($row['location'])) { $outHTMLLoc = "Location: " . $row['location'] . "
    "; } $outHTML .= "".$outHTMLLoc.""; if (!empty($row['audience_type']) && $row['audience_type'] != "Open to the Public") $outHTML .= "Audience: " . trim($row["audience_type"]) . "
    "; if (!empty($row['cost'])) $outHTML .= "Cost: " . trim($row["cost"]) . "
    "; $outHTML .= "

    \r\n"; $description = trim($row['description']); if (stripos($description,"

    ") === false) { $description = "

    " . $description . "

    "; } $outHTML .= $description; if (!empty($row['media'])) { $outHTML .= "

    Media

    "; $outHTML .= "

    " . $row['media'] . "

    "; } if (!empty($row['moreinfo'])) { $moreinfo = trim($row['moreinfo']); $outHTML .= "

    More Information

    "; if (stripos($moreinfo,"

    ") === false) { $moreinfo = "

    " . $moreinfo . "

    "; } $outHTML .= $moreinfo; } $outHTML .= "
    \r\n"; } else if ($format == 1) { $outHTML .= "".$title."

    ".$dateinfo . "

    "; } else if ($format == 2) { if($hidden == 1 && $displayheader == true){ $outHTML .= "

    Events

    "; $displayheader = false; } $outHTML .= "
    "; if (!empty($photo)) $outHTML .= "
    " . $photo . "
    \r\n"; $outHTML .= "

    " . $title . "

    " . $dateinfo . "

    \r\n
    \r\n"; } $departmentdescription = $row["departmentdescription"]; }//end while $description = ""; if (!empty($id) || $format == 1) { if (empty($subdepartment)) { $description = $departmentdescription; } else { $description = $subdepartmentdescription . " "; } } if (empty($outHTML)) { if($hidden == 0){ echo "

    Return to this page for " . $description ."upcoming event information.

    "; } } $link = "/events.php"; if (!empty($outHTML) && (!empty($id) || $format == 1)) { if (!empty($subdepartmentdescription)) { $link .= "?sd=" . $subdepartment; } $outHTML .= "

    View all upcoming events

    "; // OLD version $outHTML .= "

    View all upcoming " . $description . " events

    "; } else if (!empty($subdepartmentdescription) && $format == 1) { $outHTML .= "

    View all upcoming " . $departmentdescription . " events

    "; } else if(!empty($outHTML) && $hidden == 1){ $outHTML .= "

    View all upcoming events.

    "; } echo $outHTML; mysqli_free_result($result); do_dbcleanup(); } /** * get_semester * * This function guesses a term based on the current month. It is used to provide a default for term-related data such as courses * * @return (string) (term) */ function get_semester() { $now = getdate(); $term = ""; switch ($now['mon']) { case 11: case 12: $term = "Spring " . ($now['year']+1); break; case 1: case 2: case 3: $term = "Spring " . $now['year']; break; case 4: case 5: case 6: $term = "Summer " . $now['year']; break; default: $term = "Fall " . $now['year']; break; } return $term; } function show_instructorcourses($id = 0, $term = "", $career = "",$catalogref_filter_any = "",$catalogref_filter_none = "", $prefix_filter_any = "") { $sqlaux = ""; $term = trim($term); $id = intval($id); $career = trim($career); $summer_flag = false; if (empty($id)) return; /* Guess current term */ if (empty($term) || $term == "-") { $term = get_semester(); } if (stripos($term,"summer") !== false) { $summer_flag = true; } // check any filters if (!empty($course_filter_any)) { if (is_array($course_filter_any)) { $filters = $course_filter_any; } else { $filters = explode(",",$catalogref_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check none filters if (!empty($catalogref_filter_none)) { if (is_array($catalogref_filter_none)) { $filters = $catalogref_filter_none; } else { $filters = explode(",",$catalogref_filter_none); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check prefix filters if (!empty($prefix_filter_any)) { if (is_array($prefix_filter_any)) { $filters = $prefix_filter_any; } else { $filters = explode(",",$prefix_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "prefix IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // setup course list $sql = "select courses.id, number, IF(ISNULL(description),\"No Description Available\",description) as description, CONCAT(prefix,catalog_number) as catalogref,syllabus_file,term,section, title, instruction_mode, session, CONCAT(meeting_days,' ',class_start,' - ',class_end) as dateandtime from courses left join users on (courses.user_id = users.id) where term='" . $term . "' and title NOT IN ('THESIS','DIRECTED RESEARCH','INDEPENDENT STUDY','RESEARCH','DISSERTATION','INTERNSHIP','DIRECTED EXPERIENCE') and title NOT LIKE '%ABROAD%' and title NOT LIKE 'CO-OP%' and title NOT LIKE 'HON DIRECT RDG%' and title NOT LIKE 'HON UGRD THESIS%'" . $sqlaux; if (!strcasecmp($career,'UGRD')) { $sql .= " and career='UGRD'"; } else if (!strcasecmp($career,'GRAD')) { $sql .= " and career='GRAD'"; } $sql .= " and user_id=" . $id . " order by catalogref, title, number"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $num_results = mysqli_num_rows($result); if ($num_results == 0) return ""; $outHTML = "

    " . $term . " Courses

    "; $outHTML .= "
    "; $outHTML .= ""; $outHTML .= "\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n"; if ($summer_flag) { $outHTML .= "\t\t\t\t"; } else { $outHTML .= "\t\t\r\n"; } $outHTML .= "\r\n"; $outHTML .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n"; if ($summer_flag) { $outHTML .= "\t\t\r\n"; } $outHTML .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n"; while ($row = mysqli_fetch_assoc($result)) { $outHTML .= "\r\n\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; if ($summer_flag) { $outHTML .= "\t\r\n"; } $outHTML .= "\t\r\n"; $outHTML .= "\r\n"; $outHTML .= "\r\n"; $outHTML .= "\r\n\t\r\n\r\n"; } $outHTML .= "
    Course NumberCourseTitleModeSessionDate and TimeSyllabus
    " . $row['number'] . "" . trim($row['catalogref']) . "" . trim($row['title']) . "" . trim($row['instruction_mode']) . "" . trim($row['session']) . "" . trim($row['dateandtime']) . "\r\n"; if (!empty($row["syllabus_file"])) { $syllbusURL = "http://www.cah.ucf.edu/common/files/syllabi/" . str_replace(" ","",$row['catalogref'] . $row['section'] . $row['term'] . ".pdf"); $outHTML .= "Available"; } else { $outHTML .= "Unavailable"; } $outHTML .= "
    " . $row['description'] . "
    \r\n
    \r\n"; do_dbcleanup(); return $outHTML; } function print_instructorcourses_new($id = 0, $term = "", $career = "",$catalogref_filter_any = "",$catalogref_filter_none = "", $prefix_filter_any = "") { $sqlaux = ""; $sqlterm = ""; $term = trim($term); $id = intval($id); $career = trim($career); $summer_flag = false; $guessterm = ""; $terms = array(); $termcourses = array(); $termlabels = array(); if (empty($id)) return; if (empty($term)) { $sql = sql_termselect(); $result = mysqli_query(get_dbconnection(),$sql); while ($row = mysqli_fetch_assoc($result)) { if ($row['term'] != "-") { $terms[] = $row['term']; if (empty($sqlterm)) { $sqlterm = "term in ("; } else { $sqlterm .= ","; } $sqlterm .= "'" . $row['term'] . "'"; } } if (!empty($sqlterm)) $sqlterm .= ") "; $guessterm = get_semester(); } else { $terms[] = $term; $guessterm = $term; $sqlterm = "term='" . mysqli_real_escape_string(get_dbconnection(),$term) . "'"; } // check any filters if (!empty($course_filter_any)) { if (is_array($course_filter_any)) { $filters = $course_filter_any; } else { $filters = explode(",",$catalogref_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check none filters if (!empty($catalogref_filter_none)) { if (is_array($catalogref_filter_none)) { $filters = $catalogref_filter_none; } else { $filters = explode(",",$catalogref_filter_none); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check prefix filters if (!empty($prefix_filter_any)) { if (is_array($prefix_filter_any)) { $filters = $prefix_filter_any; } else { $filters = explode(",",$prefix_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "prefix IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // setup course list $sql = "select courses.id, number, IF(ISNULL(description),\"No Description Available\",description) as description, CONCAT(prefix,catalog_number) as catalogref,syllabus_file,term,section, title, instruction_mode, session, CONCAT(meeting_days,' ',class_start,' - ',class_end) as dateandtime from courses left join users on (courses.user_id = users.id) where " . $sqlterm . $sqlaux . " and (user_id=" . $id . " or suser_id=" . $id . ")"; if (!strcasecmp($career,'UGRD')) { $sql .= " and career='UGRD'"; } else if (!strcasecmp($career,'GRAD')) { $sql .= " and career='GRAD'"; } $sql .= " order by term, catalogref, title, number"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $num_results = mysqli_num_rows($result); if ($num_results == 0) return ""; /* build output based on rows */ while ($row = mysqli_fetch_assoc($result)) { $termindex = trim($row['term']); if (stripos($termindex,"summer") !== false) { $summer_flag = true; } if (empty($termcourses[$termindex])) { $termcourses[$termindex] = "\t\t\t
    "; $termcourses[$termindex] .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n"; if ($summer_flag) { $termcourses[$termindex] .= "\t\t\r\n"; } $termcourses[$termindex] .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n"; } $termcourses[$termindex] .= "\r\n\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; if ($summer_flag) { $termcourses[$termindex] .= "\t\r\n"; } $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\r\n"; $termcourses[$termindex] .= "\r\n"; $termcourses[$termindex] .= "\r\n\t\r\n\r\n"; } $outHTML .= "
      \r\n"; $termlabels = str_replace(" ","",$terms); for ($c = 0; $c < count($terms); $c++) { $outHTML .= "\t\t" . $terms[$c] . "\r\n"; if (!empty($termcourses[$terms[$c]])) { $termcourses[$terms[$c]] = "
      \r\n" . $termcourses[$terms[$c]] . "
    Course NumberCourseTitleModeSessionDate and TimeSyllabus
    " . $row['number'] . "" . trim($row['catalogref']) . "" . trim($row['title']) . "" . trim($row['instruction_mode']) . "" . trim($row['session']) . "" . trim($row['dateandtime']) . "\r\n"; if (!empty($row["syllabus_file"])) { $syllbusURL = "http://www.cah.ucf.edu/common/files/syllabi/" . str_replace(" ","",$row['catalogref'] . $row['section'] . $row['term'] . ".pdf"); $termcourses[$termindex] .= "Available"; } else { $termcourses[$termindex] .= "Unavailable"; } $termcourses[$termindex] .= "
    " . $row['description'] . "
    \r\n
    \r\n"; } else { $termcourses[$terms[$c]] = "
    \r\n

    No courses found for " . $terms[$c] .".

    \r\n
    \r\n"; } } $outHTML .= "\t\r\n\t
    "; /* physical order of the content matters so iterate the same way */ for ($c = 0; $c < count($terms); $c++) { $outHTML .= "\t\t" . $termcourses[$terms[$c]]; } do_dbcleanup(); return $outHTML; } function print_instructorcourses($id = 0, $term = "", $career = "",$catalogref_filter_any = "",$catalogref_filter_none = "", $prefix_filter_any = "") { $sqlaux = ""; $sqlterm = ""; $term = trim($term); $id = intval($id); $career = trim($career); $summer_flag = false; $guessterm = ""; $terms = array(); $termcourses = array(); $termlabels = array(); if (empty($id)) return; if (empty($term)) { $sql = sql_termselect(); $result = mysqli_query(get_dbconnection(),$sql); while ($row = mysqli_fetch_assoc($result)) { if ($row['term'] != "-") { $terms[] = $row['term']; if (empty($sqlterm)) { $sqlterm = "term in ("; } else { $sqlterm .= ","; } $sqlterm .= "'" . $row['term'] . "'"; } } if (!empty($sqlterm)) $sqlterm .= ") "; $guessterm = get_semester(); } else { $terms[] = $term; $guessterm = $term; $sqlterm = "term='" . mysqli_real_escape_string(get_dbconnection(),$term) . "'"; } // check any filters if (!empty($course_filter_any)) { if (is_array($course_filter_any)) { $filters = $course_filter_any; } else { $filters = explode(",",$catalogref_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check none filters if (!empty($catalogref_filter_none)) { if (is_array($catalogref_filter_none)) { $filters = $catalogref_filter_none; } else { $filters = explode(",",$catalogref_filter_none); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check prefix filters if (!empty($prefix_filter_any)) { if (is_array($prefix_filter_any)) { $filters = $prefix_filter_any; } else { $filters = explode(",",$prefix_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "prefix IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // setup course list $sql = "select courses.id, number, IF(ISNULL(description),\"No Description Available\",description) as description, CONCAT(prefix,catalog_number) as catalogref,syllabus_file,term,section, title, instruction_mode, session, CONCAT(meeting_days,' ',class_start,' - ',class_end) as dateandtime from courses left join users on (courses.user_id = users.id) where " . $sqlterm . $sqlaux . " and (user_id=" . $id . " or suser_id=" . $id . ")"; if (!strcasecmp($career,'UGRD')) { $sql .= " and career='UGRD'"; } else if (!strcasecmp($career,'GRAD')) { $sql .= " and career='GRAD'"; } $sql .= " order by term, catalogref, title, number"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $num_results = mysqli_num_rows($result); if ($num_results == 0) return ""; /* build output based on rows */ while ($row = mysqli_fetch_assoc($result)) { $termindex = trim($row['term']); if (stripos($termindex,"summer") !== false) { $summer_flag = true; } if (empty($termcourses[$termindex])) { $termcourses[$termindex] = "\t\t\t"; $termcourses[$termindex] .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n"; if ($summer_flag) { $termcourses[$termindex] .= "\t\t\r\n"; } $termcourses[$termindex] .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n"; } $termcourses[$termindex] .= "\r\n\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\t\r\n"; if ($summer_flag) { $termcourses[$termindex] .= "\t\r\n"; } $termcourses[$termindex] .= "\t\r\n"; $termcourses[$termindex] .= "\r\n"; $termcourses[$termindex] .= "\r\n"; $termcourses[$termindex] .= "\r\n\t\r\n\r\n"; } $outHTML .= "\r\n
    \r\n\t
      \r\n"; $termlabels = str_replace(" ","",$terms); for ($c = 0; $c < count($terms); $c++) { $outHTML .= "\t\t" . $terms[$c] . "\r\n"; if (!empty($termcourses[$terms[$c]])) { $termcourses[$terms[$c]] = "
      \r\n" . $termcourses[$terms[$c]] . "
    Course NumberCourseTitleModeSessionDate and TimeSyllabus
    " . $row['number'] . "" . trim($row['catalogref']) . "" . trim($row['title']) . "" . trim($row['instruction_mode']) . "" . trim($row['session']) . "" . trim($row['dateandtime']) . "\r\n"; if (!empty($row["syllabus_file"])) { $syllbusURL = "http://www.cah.ucf.edu/common/files/syllabi/" . str_replace(" ","",$row['catalogref'] . $row['section'] . $row['term'] . ".pdf"); $termcourses[$termindex] .= "Available"; } else { $termcourses[$termindex] .= "Unavailable"; } $termcourses[$termindex] .= "
    " . $row['description'] . "
    \r\n
    \r\n"; } else { $termcourses[$terms[$c]] = "
    \r\n

    No courses found for " . $terms[$c] .".

    \r\n
    \r\n"; } } $outHTML .= "\t\r\n\t
    "; /* physical order of the content matters so iterate the same way */ for ($c = 0; $c < count($terms); $c++) { $outHTML .= "\t\t" . $termcourses[$terms[$c]]; } $outHTML .= "\t
    \r\n
    \r\n"; do_dbcleanup(); return $outHTML; } /** * print_departmentcourses * * This function outputs courses in either an HTML table or a JSON object based on a given department or list as well as filters, term, career level, and number of records. * * @param (int) (department) the department id to show courses for; it may be blank if catalogref_filter_any is not * @param (string) (term) the term to show courses for; Spring YYYY, Fall YYYY, Summer YYYY; required * @param (string) (career) the course career to show; values "GRAD" "UNDERGRAD", blank for both * @param (string|array) (catalogref_filter_any) the courses to include in addition to the ones from the department; can be blank or used to show only these courses if department is 0; format can be an array or comma seperated list of courses; i.e. ENC1101,ENC1101H, ENC1102,ENC1102H * @param (string|array) (catalogref_filter_none) the courses to not include from the department; can be blank; format can be an array or comma seperated list * @param (int) (order) Sorting order the output should be in; 0|1 catalogref ascending or not * @param (string) (output) the output format; "html" "json" * @param (bool) (link) paramater to include a link to the instructor detail page (staff.php?id=MMID), if available */ function print_departmentcourses($department = 0, $term = "", $career = "",$catalogref_filter_any = "",$catalogref_filter_none = "", $prefix_filter_any = "",$order = 0,$output="html",$link = true,$offset = 0, $numrecords = 0) { $sqlaux = ""; $outHTML = ""; $outJS = ""; $js = array(); $term = trim($term); $department = intval($department); $career = trim($career); $summer_flag = false; $order = intval($order); $output = trim($output); $link = (bool)$link; if (empty($department) && empty($catalogref_filter_any)) return; /* Guess current term */ if (empty($term) || $term == "-") { $term = get_semester(); } if (stripos($term,"summer") !== false) { $summer_flag = true; } // get department name if available if (!empty($department)) { $sql = "select description from departments where id=" . $department . " limit 1"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row = mysqli_fetch_row($result); $departmentname = $row['description']; mysqli_free_result($result); } // check any filters if (!empty($catalogref_filter_any)) { if (is_array($catalogref_filter_any)) { $filters = $catalogref_filter_any; } else { $filters = explode(",",$catalogref_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and (" . $sqlfilter1; } } // check none filters if (!empty($catalogref_filter_none)) { if (is_array($catalogref_filter_none)) { $filters = $catalogref_filter_none; } else { $filters = explode(",",$catalogref_filter_none); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check prefix filters if (!empty($prefix_filter_any)) { if (is_array($prefix_filter_any)) { $filters = $prefix_filter_any; } else { $filters = explode(",",$prefix_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "prefix IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // setup course list $sql = "select SQL_CALC_FOUND_ROWS distinct courses.id, number, IF(ISNULL(description),\"No Description Available\",description) as description, CONCAT(prefix,catalog_number) as catalogref, title,section,term, IF(ISNULL(courses.user_id),instructor,TRIM(CONCAT(lname,', ',fname))) as instructor, IF(ISNULL(courses.suser_id),sinstructor,(select TRIM(CONCAT(lname,', ',fname)) from users where id=courses.suser_id)) as sinstructor, users.id as uid, courses.suser_id as suid, instruction_mode, session,syllabus_file, CONCAT(meeting_days,' ',class_start,' - ',class_end) as dateandtime from courses left join users on (courses.user_id = users.id) where term='" . mysqli_real_escape_string(get_dbconnection(),$term) ."'". $sqlaux; if (!strcasecmp($career,'UGRD')) { $sql .= " and career='UGRD'"; } else if (!strcasecmp($career,'GRAD')) { $sql .= " and career='GRAD'"; } if (!empty($department) && !empty($catalogref_filter_any)) { $sql .= " or department_id=" . $department; } else if (!empty($department) && empty($catalogref_filter_any)) { $sql .= " and department_id=" . $department; } if (!empty($catalogref_filter_any)) $sql .= ")"; if (empty($order)) { $sql .= " order by catalogref, title, number"; } else if ($order == 1) { $sql .= " order by catalogref desc, title,number"; } if (!empty($numrecords)) { $sql .= " limit " . $offset . ", " . $numrecords; } $result = mysqli_query(get_dbconnection(),$sql); $result2 = mysqli_query(get_dbconnection(),"select FOUND_ROWS()"); check_result($result,$sql); $num_results = mysqli_num_rows($result); $totalRecords = mysqli_fetch_array($result2); $totalRecords = $totalRecords[0]; $outHTML .= ""; $outHTML .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n"; $outHTML .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n"; $c = 0; while ($row = mysqli_fetch_assoc($result)) { $js["data"][$c]["coursenumber"] = $row['number']; $js["data"][$c]["catalogref"] = $row['catalogref']; $js["data"][$c]["title"] = htmlentities(trim($row['title']),ENT_NOQUOTES,"UTF-8",false); $js["data"][$c]["description"] = $row['description']; $outHTML .= "\r\n\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $js["data"][$c]["mode"] = trim($row['instruction_mode']); $outHTML .= "\t\r\n"; // clean up date and times that are bogus or misleading; study abroad, WWW, etc. $dateandtime = trim($row['dateandtime']); if ($dateandtime == "-" || $dateandtime == "12:00AM - 12:00AM" || $dateandtime == "1:00AM - 1:00AM") { $dateandtime = ""; } else if ($summer_flag) { $dateandtime = "; " . $dateandtime; } $js["data"][$c]["dateandtime"] = (($summer_flag) ? "Session " . $row['session'] : "") . $dateandtime; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\r\n"; $c++; } /* if ($output === "html" && empty($c)) { $outHTML .= ""; } */ $outHTML .= "
    Course NumberCourseTitleDescriptionInstructorModeDate and TimeSyllabus
    " . $row['number'] . "" . trim($row['catalogref']) . "" . htmlentities(trim($row['title']),ENT_NOQUOTES,"UTF-8",false) . "" . trim($row['description']) . ""; if (!empty($row['uid']) && $link) { $outHTML .= "" . trim($row['instructor']) . ""; $js["data"][$c]["instructor"] = "" . trim($row['instructor']) . ""; } else { $outHTML .= trim($row['instructor']); $js["data"][$c]["instructor"] = trim($row['instructor']); } // second instructor; concat if (!empty($row['suid'])) { if ($link) { $outHTML .= " and " . trim($row['sinstructor']) . ""; $js["data"][$c]["instructor"] .= " and " . trim($row['sinstructor']) . ""; } else { $outHTML .= " and " . trim($row['sinstructor']); $js["data"][$c]["instructor"] .= " and " . trim($row['sinstructor']); } } $outHTML .= "" . trim($row['instruction_mode']) . "" . (($summer_flag) ? "Session " . $row['session'] : "") . $dateandtime . ""; if (!empty($row["syllabus_file"])) { $syllbusURL = "http://www.cah.ucf.edu/common/files/syllabi/" . str_replace(" ","",$row['catalogref'] . $row['section'] . $row['term'] . ".pdf"); $js["data"][$c]["syllabus"] = "Available"; $outHTML .= "Available"; } else { $js["data"][$c]["syllabus"] = "Unavailable"; $outHTML .= "Unavailable"; } $outHTML .= "

    No courses offered for " . $term . "

    \r\n"; if ($output === "js") { //print_r($js["data"]); //echo "

    "; //$jsTemp = array("data"=>array_values($js["data"])); $outJS = json_encode($js); echo $outJS; } else { echo $outHTML; } do_dbcleanup(); } function print_courses($department = 0, $term = "", $career = "",$quantity = 2,$catalogref_filter_any = "",$catalogref_filter_none = "", $prefix_filter_any = "",$order = 0,$featured = false) { $sqlaux = ""; $term = trim($term); $department = intval($department); $career = trim($career); $summer_flag = false; $order = intval($order); $quantity = intval($quantity); $featured = (bool)$featured; $outHTML = ""; if (empty($department)) return; /* Guess current term */ if (empty($term) || $term == "-") { $term = get_semester(); } if (stripos($term,"summer") !== false) { $summer_flag = true; } // get department name $sql = "select description from departments where id=" . $department . " limit 1"; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row = mysqli_fetch_row($result); $departmentname = $row['description']; mysqli_free_result($result); // check any filters if (!empty($catalogref_filter_any)) { if (is_array($catalogref_filter_any)) { $filters = $catalogref_filter_any; } else { $filters = explode(",",$catalogref_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and (" . $sqlfilter1; } } // check none filters if (!empty($catalogref_filter_none)) { if (is_array($catalogref_filter_none)) { $filters = $catalogref_filter_none; } else { $filters = explode(",",$catalogref_filter_none); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // check prefix filters if (!empty($prefix_filter_any)) { if (is_array($prefix_filter_any)) { $filters = $prefix_filter_any; } else { $filters = explode(",",$prefix_filter_any); } $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "prefix IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sqlaux .= " and " . $sqlfilter1; } } // setup course list $sql = "select distinct courses.id, number, description, CONCAT(prefix,catalog_number) as catalogref, title, IF(ISNULL(courses.user_id),instructor,TRIM(CONCAT(lname,', ',fname))) as instructor, users.id as uid, instruction_mode, session,syllabus_file,courses.location, CONCAT(meeting_days,' ',class_start,' - ',class_end) as dateandtime from courses left join users on (courses.user_id = users.id) where term='" . $term . "' and description is not null" . $sqlaux; if (!strcasecmp($career,'UGRD')) { $sql .= " and career='UGRD'"; } else if (!strcasecmp($career,'GRAD')) { $sql .= " and career='GRAD'"; } if (!empty($catalogref_filter_any)) { $sql .= " or "; } else { $sql .= " and ("; } $sql .= "department_id=" . $department; $sql2 = "select courses,courses_filter from departments where id=" . $department; $result2 = mysqli_query(get_dbconnection(),$sql2); check_result($result2,$sql2); $row = mysqli_fetch_assoc($result2); $includecourses = trim($row['courses']); $excludecourses = trim($row['courses_filter']); mysqli_free_result($result2); if (!empty($includecourses)) { $filters = explode(",",$includecourses); $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sql .= " or " . $sqlfilter1; } } if (!empty($excludecourses)) { $filters = explode(",",$excludecourses); $sqlfilter1 = ""; foreach ($filters as $value) { if (!empty($sqlfilter1)) $sqlfilter1 .= " , "; if (empty($sqlfilter1)) $sqlfilter1 = "CONCAT(prefix,catalog_number) NOT IN ("; $sqlfilter1 .= "'" . strtoupper($value) . "'"; } if (!empty($sqlfilter1)) { $sqlfilter1 .= ") "; $sql .= " and (" . $sqlfilter1; } } $sql .= ")"; if ($featured) { $sql .= " and featured=true"; } if (empty($order)) { $sql .= " order by catalogref, title, number"; } else if ($order == 1) { $sql .= " order by catalogref desc, title,number"; } if ($quantity <= 0) $quantity = 2; $sql .= " limit " . $quantity; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $num_results = mysqli_num_rows($result); while ($row = mysqli_fetch_assoc($result)) { $outHTML .= "

    " . trim($row['catalogref']) . ": " . htmlentities(trim($row['title']),ENT_NOQUOTES,"UTF-8",false) . "

    \r\n"; $outHTML .= "

    " . trim($row['description']); $outHTML .= " Read more course details.

    \r\n"; } if (!empty($outHTML)) { $outHTML = "

    Featured Courses for " . $term . "

    " . $outHTML; echo $outHTML; } do_dbcleanup(); } function print_highlights($department = 0, $type = '',$subdepartment = 0, $ac = 0, $user_id = 0, $id = 0, $quantity = 3, $months_old = 12, $format = 0, $order = 0, $new_window = false ){ $department = intval($department); $subdepartment = intval($subdepartment); $type = trim($type); $ac = intval($ac); $user_id = intval($user_id); if (is_string($id) && !empty($id)) { $id = explode(",",$id); $id = array_map("intval",$id); if (array_sum($id) == 0) $id = 0; } $id = (!is_array($id) ? intval($id) : array_map("intval",$id)); if (!empty($id) && is_array($id)) { $values = implode(",",$id); $id = "(" . $values . ")"; } else if (!empty($id)) { $id = "(" . $id . ")"; } $quantity = intval($quantity); $months_old = intval($months_old); $new_window = (bool)($new_window); $outHTML = ""; $windowtarget = ""; if ($new_window) { $windowtarget = ' rel="external" '; } $sql = "select highlights.*, departments.description as dname from highlights left join highlights_departments on (highlight_id=highlights.id) left join departments on (department_id=departments.id) left join academic_categories on (academic_categories.id=highlights_departments.academic_id) where "; if (!empty($user_id) && empty($id)) { $sql .= " highlights.id IN (select highlight_id from highlights_users where user_id=" . $user_id . ")"; } else if (!empty($id)) { $sql = "select highlights.*, \"\" as dname from highlights where highlights.id IN " . $id . " "; } else { if ($months_old >= 0) { $sql .= " `datestamp` >= (CURDATE() - INTERVAL " . $months_old . " MONTH) and `datestamp` <= CURDATE()"; } else { $sql .= " `datestamp` <= (CURDATE() - INTERVAL " . abs($months_old) . " MONTH) and `datestamp` <= CURDATE()"; } if (!empty($department)) { $sql .= " and departments.id=" .$department . " "; if (!empty($subdepartment)) { $sql .= " and subdepartment_id=" . $subdepartment . " "; } if (!empty($ac)) { $sql .= " and academic_categories.id=" . $ac; } } //Used for CAH research pages, department is empty, and subdepartment is research. if (empty($department) && !empty($subdepartment)) { $sql .= " and subdepartment_id=" . $subdepartment . " "; } if (!empty($type)) { $sql .= " and highlight_type='" . mysqli_real_escape_string(get_dbconnection(),$type) . "' "; } } //Fix for grouping formats 6 and 7, to remove duplicate items, Bryce should have added this to the function originally if ($format == 6 || $format == 7) { $sql .= "group by `id`"; //echo $sql; } if ($order == 0) { $sql .= " order by dname, datestamp desc, highlight_type, title"; } else if ($order == 1) { $sql .= " order by datestamp desc, title"; } if (!empty($quantity) && $quantity > 0 && empty($id)) $sql .= " limit " . $quantity; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $department = ""; while ($row = mysqli_fetch_assoc($result)) { if ($department != $row['dname']) { $department = $row['dname']; if ($format == 0) $outHTML .= "

    ". $department. "

    \n\r"; } $date = date("F Y",strtotime($row['datestamp'])); $photo = ""; $photosize = 5; if ($format == 1 || $format == 5 || $format == 6 || $format == 8) $photosize = 1; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) { $photo = "\"photo\""; } // Check to see if there is only one person involved with the highlight, if so, see if they have a photo if (empty($photo)) { $sql = "select photo_path,photo_extra,REPLACE(CONCAT_WS(' ',fname,mname,lname),' ',' ') as fullname from users left join highlights_users on (user_id=users.id) where highlight_id=" . $row['id']; $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result2,$sql); if (mysqli_num_rows($result2) == 1) { $row2 = mysqli_fetch_assoc($result2); $filename = COMMON_PATH . $row2['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row2['photo_path']) && file_exists($filename)) { $size = "&sz=1"; if (!empty($id)) $size = "&sz=2"; $photo = "\"""; } } mysqli_free_result($result2); } $title = trim($row['title']); $description = html_entity_decode($row['description'],null,"UTF-8"); $description = str_replace(" & ", " & ",$description); $desclen = strlen($description); if (empty($id) && $format == 0) { $description = summarize_text($description,125); } else if (empty($id) && ($format == 1 || $format == 2 || $format == 3) || $format == 5 || $format == 8) { $description = chop_text($description,200,"next","[Read More]"); if ($format == 2 || $format == 1 || $format == 5 || $format == 8) { $description = "

    " . $photo . strip_tags($description,"") . "

    "; } else{ $description = "

    " . strip_tags($description,"") . "

    "; } } else if (empty($id) && $format == 6) { $description = chop_text($description,200,"next","[Read More]"); $loop++; //Loop Count for Music Page to only display titles after first item if ($loop == 1) { $description = "

    " . $photo . "" . $title . "
    " . strip_tags($description,"") . "

    "; } else {$description = "

    " . $title . "

    ";} } if ($format == 0) { if (!empty($title)) { $title = "

    " .$title . "

    "; } $outHTML .= "
    " . $photo . $title ."

    " . $date . "

    "; } else if ($format == 1) { $outHTML .= '

    ' . $department . '

    '; } else if ($format == 2) { $outHTML .= '

    ' . $date . '

    '; } else if ($format == 3) { if (!empty($title)) { $title = "

    " .$title . "

    "; } $outHTML .= "
    " . $title ."

    " . $date . "

    \r\n
    \r\n"; $outHTML .= "
    "; if (!empty($photo)) { $outHTML .= "
    " . $photo . "
    \r\n"; } } else if ($format == 4) { if (!empty($title)) $outHTML .= "

    " .$title . "

    "; if (stripos($description,"

    ") === false || (stripos($description,"

    ") != 0)) { $description = "

    " . $photo . $description . "

    "; } else { $description = "

    " . $photo . substr(stristr($description,"

    "),3); } } else if ($format == 7) { $description = "

    " . $title . "

    "; } if (stripos($description,"

    ") === false) { $description = "

    " . $description . "

    "; } $outHTML .= $description . "\n\r"; if ($format == 0) { if ($desclen > strlen($description)) { $outHTML .= "

    [Read Full Highlight]

    "; } $outHTML .= "
    \r\n"; } else if ($format == 1 || $format == 2 || $format == 3) { $outHTML .= "
    \r\n"; if ($format == 3) { $outHTML .= "
    \r\n"; } } } // while if (empty($outHTML)) { $outHTML = "

    There are no highlights available at this time.

    "; } echo $outHTML; do_dbcleanup(); } function print_faculty ($department = 0, $subdepartment = 0) { $sqlaux = ""; $department = intval($department); $sql = sql_showstaff($department,$subdepartment, 0); if (empty($sql)) return; $outHTML .= "
    "; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $num_results = mysqli_num_rows($result); $outHTML .= ""; $outHTML .= "\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n"; $outHTML .= "\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n"; while ($row = mysqli_fetch_assoc($result)) { $outHTML .= "\r\n\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\t\r\n"; $outHTML .= "\r\n"; } $outHTML .= "
    NamePositionE-mailPhone
    " . trim($row['fullname']) . "" . trim($row['wtitle']) . "" . (empty($row['email']) ? "N/A" : "" . $row['email']) . "" . (empty($row['phone']) ? "N/A" : $row['phone']) . "
    \r\n
    \r\n"; echo $outHTML; do_dbcleanup(); } /** * print_upcomingevents * * This function outputs events based of a given department in a variety of formats based on the parameters. * * @param (int) (department) the department id to show events for * @param (int) (quantity) the number of events to show * @param (int) (sort) the sorting direction; 1 for descending, anything else for ascending * @param (int) (format) the format to output with; * @param (int) (subdepartment) the sub-department to show events for * @param (int) (id) When set to an id, only this event will show * @param (str/array) (usage) limits by type of event; exhibition, lecture, etc */ function print_upcomingevents ($department = 0, $quantity = 3, $infostyle = 1, $sort = 0, $grouping = 0, $subdepartment = 0,$id = 0, $usage = "") { $tempdepartment = $department; $department = (!is_array($department) ? intval($department) : array_map("intval",$department)); $quantity = intval($quantity); $infostyle = intval($infostyle); $sort = intval($sort); $subdepartment = intval($subdepartment); $subdepartmentdescription = ""; $departmentdescription = ""; $sponsorHTML = ""; $outHTML = ""; $grouping = intval($grouping); if (is_string($id) && !empty($id)) { $id = explode(",",$id); $id = array_map("intval",$id); if (array_sum($id) == 0) $id = 0; } $id = (!is_array($id) ? intval($id) : array_map("intval",$id)); $infostyle = ($infostyle > 12 || $infostyle < 0) ? 0 : $infostyle; $sort = ($sort > 2 || $sort < 0) ? 0 : $sort; $grouping = ($grouping > 2 || $grouping < 0) ? 0 : $grouping; $quantity = ($quantity < 0) ? 3 : $quantity; $department = ($department < 0) ? 0 : $department; $sql = "select latestevents.* , departments.description as ddd, departments.short_description as dd from events as latestevents left join departments on (departments.id=latestevents.department_id) where `event_type`='external' and `approved`=TRUE "; if (!empty($id) && is_array($id)) { $values = implode(",",$id); $id = "(" . $values . ")"; } else if (!empty($id)) { $id = "(" . $id . ")"; } else if (empty($id)) { $sql .= "and enddate" . (($sort == 2) ? "<" : ">=") . "CURRENT_DATE() "; } if (!empty($department) && is_array($department)) { $values = implode(",",$department); $department = "(" . $values . ")"; } else if (!empty($department)) { $department = "(" . $department . ")"; } if (!empty($department) && empty($id)) { $sql .= "and `department_id` in " . $department . " "; } if (!empty($usage) && (is_string($usage) || is_array($usage))) { if (is_string($usage)) { $usage = explode(",",$usage); } if (is_array($usage)) { $usage = array_map("enquote",$usage); } $usage = implode(",",$usage); $sql .= "and `usage_type` in (". $usage . ")"; } if (!empty($subdepartment) && empty($id)) { $sql .= "and `subdepartment_id`=" . $subdepartment . " "; $sql2 = "select short_description from departments_sub where id=" . $subdepartment . " limit 1"; $result = mysqli_query(get_dbconnection(),$sql2); check_result($result,$sql); $row = mysqli_fetch_assoc($result); $subdepartmentdescription = strtolower($row['short_description']) . " "; mysqli_free_result($result); } if (!empty($id)) { $sql .= "and latestevents.id IN " . $id . " "; } /* different SQL statement all together here, the above doesn't matter for this */ if ($grouping == 1) { $sql = "select latestevents.*, departments.description as ddd, departments.short_description as dd from departments right join (select * from events where `event_type`='external' and `approved`=true and enddate >=CURRENT_DATE() ) as latestevents on (department_id=departments.id) group by dd "; } $sql .= "order by "; switch ($sort) { case 0: $sql .= "dd ASC, startdate ASC "; break; case 1: $sql .= "startdate ASC, dd ASC "; break; case 2: $sql .= "startdate DESC "; break; default: $sql .="dd ASC, startdate desc"; break; } if ((empty($id)) && $quantity > 0) { $sql .= "limit " . $quantity; } $display_dept = ""; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $outHTML = ""; $toggleid = 0; while ($row = mysqli_fetch_assoc($result)) { $eid = $row['id']; $dateinfo = trim($row['dateinfo']); $title = trim($row['title']); $description = trim($row['description']); $defdescription = trim($row['ddd']); $moreinfo = trim($row['moreinfo']); $audience = trim($row['audience_type']); $location = ""; if (!empty($row['room_id'])) { $sql = "select room_number, buildings.description as bsd, rooms.description as rd, building_number from rooms left join buildings on (building_id=buildings.id) where rooms.id=" . $row['room_id'] . " limit 1"; $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row2 = mysqli_fetch_assoc($result2); if (!empty($row2['building_number'])) { $location .= ""; } $location .= $row2['bsd'] . ", " . $row2['rd']; if (!empty($row2['room_number'])) { if (!empty($row2['rd'])) { $location .= "(" . $row2['room_number'] . ")"; } else { $location .= "Room " . $row2['room_number']; } } if (!empty($row2['building_number'])) { $location .= ""; } mysqli_free_result($result2); } else if (!empty($row['location'])) { $location = trim($row['location']); } $cost = trim($row['cost']); $date = date("M j, g:ia",strtotime($row['startdate'])); if ((empty($department) || is_array($tempdepartment)) && empty($id)) { if ($display_dept != $row['dd']) { $display_dept = $row['dd']; switch ($infostyle) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 9: case 10: $outHTML .= "

    " . $display_dept . ":

    "; break; case 7: case 8: $outHTML .= "

    " . $display_dept . "

    "; break; } } } $starttime = strtotime($row['startdate']); $endtime = strtotime($row['enddate']); $startdate = getdate($starttime); $enddate = getdate($endtime); $photo = ""; $photosize = 2; if ($infostyle == 0 || $infostyle == 6) $photosize = 1; $filename = COMMON_PATH . $row['photo_path']; $filename = str_replace("/","\\",$filename); if (!empty($row['photo_path']) && file_exists($filename)) { $photo = "\"photo\""; } if ($startdate["yday"] == $enddate["yday"]) { if (($startdate["hours"] == $enddate["hours"] && $startdate["minutes"] == $enddate["minutes"]) || ( empty($enddate["hours"]) && empty($enddate["minutes"]) )) { $dateinfo = date("l, F j, Y; g:ia",$starttime); if ($infostyle == 10) { $dateinfo = date("F j, Y; g:ia",$starttime); } } else { $dateinfo = date("l, F j, Y; g:ia", $starttime) . " - " . date("g:ia",$endtime); if ($infostyle == 10) { $dateinfo = date("F j, Y; g:ia",$starttime) . " - " . date("g:ia",$endtime); } } } else { $dateinfo = date("l, F j, Y",$starttime) . " - " . date("l, F j, Y",$endtime); if ($infostyle == 10) { $dateinfo = date("F j, Y",$starttime) . " - " . date("F j, Y",$endtime); } if (((empty($enddate["hours"]) && !empty($enddate["minutes"])) || (!empty($enddate["hours"]) && empty($enddate["minutes"]))) && ((empty($startdate["hours"]) && !empty($startdate["minutes"]) || (!empty($startdate["hours"]) && empty($enddate["minutes"]) )))) { $dateinfo .= "; " . date("g:ia",$starttime) . " - " . date("g:ia",$endtime); } } switch ($infostyle) { case 0 : $outHTML .= "

    ".$title."

    ".$dateinfo . "

    "; break; case 1: $outHTML .= "

    ".$title."
    Date: ".$dateinfo . "
    Location: " . $location . "
    " . $description . "
    " . $moreinfo . "

    "; break; case 2: case 3: $outHTML .= "" . $title. "
    Date: ".$dateinfo . "
    Location: " . $location . "
    " . $description; break; case 4: $outHTML .= "

    " . $title. "

    ".$dateinfo . "
    Location: " . $location . "
    "; if(!empty($cost)) $outHTML .= "Cost: " . $cost . "
    "; $outHTML .= $description; break; case 12: case 5: $outHTML .= "

    " . $date . "
    ".$title."

    "; break; case 6 : $outHTML .= "
    \r\n"; if (!empty($photo)) $outHTML .= "
    " . $photo . "
    \r\n"; $outHTML .= "

    ".$title."

    ".$date . "

    "; break; case 7: $outHTML .= "

    ".$title."

    "; $outHTML .= "

    Date: ".$dateinfo . "
    " . ((!empty($location)) ? "Location: " . $location . "
    ": ""); $outHTML .= ((!empty($audience) && $audience != "Open to the Public") ? "Audience: " . $audience . "
    ": ""); $outHTML .= ((!empty($cost)) ? "Cost: " . $cost . "
    ": "") . "

    "; break; case 8: $outHTML .= "
    "; if (!empty($photo)) { $outHTML .= "
    " . $photo . "
    "; } $outHTML .= "

    Date: ".$dateinfo . "
    " . ((!empty($location)) ? "Location: " . $location . "
    ": ""); $outHTML .= ((!empty($audience) && $audience != "Open to the Public") ? "Audience: " . $audience . "
    ": ""); $outHTML .= ((!empty($cost)) ? "Cost: " . $cost . "
    ": "") . "

    "; if (!empty($description)) { $description = html_entity_decode($description,ENT_QUOTES,"utf-8"); if (stripos($description,"

    ") === false) { $description = "

    " . $description . "

    "; } $outHTML .= $description . "\r\n"; } $outHTML .= "
    \r\n"; break; case 9 : $outHTML .= "

    ".$title."

    ".$dateinfo . "

    "; break; case 10: $outHTML .= "

    ".$title."
    ".$dateinfo . "

    "; break; case 11: $outHTML .= "
    "; $outHTML .= "
    ".date("M",$starttime)."
    ".date("j",$starttime)."
    "; $outHTML .= "

    ".$title."

    "; $outHTML .= "

    "; if($startdate["yday"] != $enddate["yday"]) $outHTML .= date("M j", $starttime) . " - " . date("M j",$endtime); else $outHTML .= date("g:ia",$starttime) ." - ". date("g:ia",$endtime); $outHTML .= " • ".$display_dept."

    "; break; default: $outHTML .= "

    ".$title."
    ".$dateinfo . "

    "; break; } if (!empty($id) && is_numeric($id) && $id > 0) { $sql = "select distinct dname, web from (select departments.long_description as dname, web from events left join departments on (departments.id=events.department_id) where events.id=" . $id . " UNION "; $sql .= "select departments.long_description as dname, web from events_departments join departments on (departments.id=events_departments.department_id) where events_departments.event_id=" . $id . ") as deptsponsorlist"; $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result2,$sql); $sc = 1; $sponsorHTML = ""; $tsc = mysqli_num_rows($result2); while ($row2 = mysqli_fetch_assoc($result2)) { if (!empty($sponsorHTML)) { if ($sc == $tsc) { $sponsorHTML .= " and "; } else { $sponsorHTML .= ", "; } } $sponsorHTML .= "" . $row2["dname"] . ""; $sc++; } if (!empty($sponsorHTML)) { $outHTML .= "

    Sponsored by: " . $sponsorHTML . "

    \r\n"; } mysqli_free_result($result2); } if ($infostyle == 4 || $infostyle == 3 || $infostyle == 8) { $peopleHTML = ""; $sql = "select REPLACE(CONCAT_WS(' ',fname,mname,lname),' ',' ') as fullname, user_id from events_users left join users on (user_id = users.id) where event_id=" . $row['id'] . " order by lname"; $result2 = mysqli_query(get_dbconnection(),$sql); check_result($result2,$sql); while ($row2 = mysqli_fetch_assoc($result2)) { if (empty($peopleHTML)) { $peopleHTML .= "
      "; } $peopleHTML .= "
    • " .show_name($row2['user_id'],false,false) . "
    • "; } mysqli_free_result($result2); if (!empty($peopleHTML)) { $outHTML .= "

      CAH Participants:

      " . $peopleHTML .= "
    "; } if ( !empty($moreinfo)) { $outHTML .= "

    More Information: " . $moreinfo . "

    "; } } if ($infostyle == 4) { $outHTML .= "
    "; } if ($infostyle == 6) $outHTML .= "
    "; if ($infostyle == 8) $outHTML .= "

    View all events

    \r\n"; }//end While if (empty($outHTML)) $outHTML = "

    Return to this page for " . $subdepartmentdescription ."upcoming event information.

    "; echo $outHTML; do_dbcleanup(); } function print_thumbnails($directory = "", $caption = "", $id = "") { $directory = trim($directory); $caption = trim($caption); $id = trim($id); $outHTML = ""; $pi = $_SERVER['PATH_INFO']; if (empty($id)) return; if (empty($directory)) return; // no xss if (!preg_match('/^[a-z][-\w]*$/i',"",$pi)) { $pi = ""; } $app_root = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - strlen(strrchr($_SERVER['SCRIPT_FILENAME'], "\\"))); $filedirectory = realpath($app_root . "/" . $directory); $pathdirectory = $pi . $directory; $cprdirectory = substr($app_root,strlen(COMMON_PATH_ROOT)) . "/" . $directory; if (empty($filedirectory)) return; foreach (new DirectoryIterator($filedirectory) as $file) { // changed to include the '.' check because of Macs leaving files in directories that are hidden for them but not Windows if ( (!$file->isDot()) && !$file->isDir() && $file->isFile() && strpos($file->getFilename(),".") !== 0 ) { $filename = $file->getFilename(); $fext = strrpos($filename, ".", 1) + 1; if ($fext != false) $fext = strtolower(substr($filename, $fext, strlen($filename) - $fext)); else $fext = ""; if (!strcmp($fext,"jpg") || !strcmp($fext,"jpeg") || !strcmp($fext,"gif") || !strcmp($fext,"png")) { $outHTML .= "getFilename() . "\" rev=\"group:" . $id . "\" title=\"" . $caption . "\" class=\"floatbox\" >\"\"\n\r"; } } } echo $outHTML; } function chop_text($string = '', $length = 500, $break = 'next', $suffix = '...') { $string = trim(str_replace("\n", ' ', str_replace("\r", ' ', strip_tags($string,"")))); $cut = substr($string, 0, $length); $marker = substr($string, $length); if (strpos($string, '.') == $length || strpos($string, '!') == $length || strpos($string, '?') == $length || strlen($string) < $length) { return $cut; } else { if ($break == 'nearest') { $before = (strrpos($cut, '.') > 0) ? strrpos($cut, '.') : 0; if (strrpos($cut, '!') > $before) $before = strrpos($cut, '!'); if (strrpos($cut, '?') > $before) $before = strrpos($cut, '?'); $before_diff = $length-$before; $after = (strpos($marker, '.') > 0) ? strpos($marker, '.') : 0; if (strpos($marker, '!') > 0 && strpos($marker, '!') < $after) $after = strpos($marker, '!'); if (strpos($marker, '?') > 0 && strpos($marker, '?') < $after) $after = strpos($marker, '?'); $after_diff = $after; if ($before_diff > $after_diff) { $display = substr($string, 0, $after+$length+1); } else $display = substr($string, 0, $before+1); return $display . ' ' . $suffix; } else { $ender = strpos($marker, '.'); if (strpos($marker, '!') > 0 && strpos($marker, '!') < $ender) $ender = strpos($marker, '!'); if (strpos($marker, '?') > 0 && strpos($marker, '?') < $ender) $ender = strpos($marker, '?'); $display = substr($string, 0, $ender+$length+1); return $display . ' ' .$suffix; } } } function summarize_text($string = '', $length = 100) { $string = trim(str_replace("\n", ' ', str_replace("\r", ' ', $string))); $textfield = strtok($string, " "); while($textfield) { $text .= " " . $textfield; $words++; // Check if the limit has been met. ALSO check if the last character in the token word is an End Punctuation. If not, move on to the next word if (($words >= $length) && ((substr($textfield, -1) == "!")||(substr($textfield, -1) == ".")||(substr($textfield, -1) == ":")||(substr($textfield, -1) == "?"))) { break; } else { $textfield = strtok(" "); }; }; // STEP 2: Once text has been trimmed to the word limit (to the nearest sentence), check for any HTML closing tags (">") $tags = 0; $textfield = strtok($text, ">"); //var_dump($textfield,$text); while($textfield) { $paired = true; $ltcount = substr_count($textfield,"<"); $gtcount = substr_count($textfield,">"); if ($ltcount != $gtcount) { $paired = false; } // Only re-add the closing tag if there is a tag to close (text might of been trimmed in first step where closing tag would of been excluded) if ((substr($textfield, -1,1) == "!") || (substr($textfield, -1,1) == ".") || (substr($textfield, -1,1) == ":") || (substr($textfield, -1,1) == "?") || ((!strrpos($textfield,">") && $paired)) ) { //if ((substr($textfield, -1,1) != "/") || (substr($textfield, -2,1) != "/")) { $revText .= $textfield; } else { $revText .= $textfield . ">"; // . '---' . $tags . '---'; }; $tags++; // Count the number of words when each closing tag is met to ensure the word count isn't under the limit ($length) // Note: Using a different word count method in order not to break the current String position in the "strtok()" method $wordCount = explode(" ", $revText); $words = count($wordCount); // If word count is over, check to see if the tag being closed in a paragraph. If so, return the trim text if ($words >=$length) { if (($tags >= 2) && ((substr($textfield, -2,2) == '"); }; } elseif (substr($textfield, -3,3) == '"); }; }; if (substr($revText,-2,2) != "p>") { $revText .= "

    "; $revText = ltrim($revText); if (substr($revText,0,2) != ""; $message .= 'Whole query: ' . $sql; } else { $message = "There was a database problem. Please report this to cahweb@ucf.edu."; } if (!$return) { die($message); } else { return false; } } return true; } } function staff_listcompress($interests) { if ((stripos($interests,"
      ") !== false) ) { $commainterests = ""; libxml_use_internal_errors(true); try { $XMLdoc = new SimpleXMLElement("" . $interests . ""); } catch (Exception $e) { $XMLdoc = NULL; } if ($XMLdoc != NULL) { $XPresult = $XMLdoc->xpath('ul/li'); while (list(,$node) = each($XPresult)) { if (!empty($commainterests)) $commainterests .= "; "; $commainterests .= trim($node); } } else { $interests = strip_tags($interests, "
    • "); $arrayinterests = explode("
    • ", $interests); foreach ($arrayinterests as &$value){ $value = trim($value); } $commainterests = implode("; ", $arrayinterests); $commainterests = ltrim($commainterests, "; "); } $interests = $commainterests; } else { $interests = str_ireplace("

      ","",$interests); $interests = str_ireplace("

      ","",$interests); } return $interests; } function staff_location($location) { $sql = "select room_number, buildings.short_description,building_number from rooms left join buildings on (building_id=buildings.id) where rooms.id=" . $location; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $row = mysqli_fetch_assoc($result); $outHTML = "
    • Campus Location: "; if (!empty($row['building_number'])) { $outHTML .= ""; } $outHTML .= $row['short_description'] . $row['room_number']; if (!empty($row['building_number'])) { $outHTML .= ""; } $outHTML .= "
    • \r\n"; mysqli_free_result($result); return $outHTML; } function show_facstaff($id = 0) { $sql = $outHTML = ""; $in_db = false; $department = intval($department); $filter = intval($filter); $filter = ($filter > 2 || $filter < 0) ? $filter = 0 : $filter = $filter; if (empty($id)) return; $sql = 'select id, email, interests, photo_path, photo_extra, REPLACE(CONCAT_WS(" ",fname,mname,lname)," "," ") AS fullname, (select short_description from degrees, education where education.degrees_id=degrees.id and education.user_id=users.id order by degrees.level limit 1) as degree from users where id=' . $id . ' limit 1'; $result = mysqli_query(get_dbconnection(),$sql); //echo $sql; check_result($result,$sql); if (mysqli_num_rows($result) == 0) { do_dbcleanup(); return; } $row = mysqli_fetch_assoc($result); $fullname = $row['fullname']; $email = $row['email']; $photo = $row['photo_path']; $photoextra = $row['photo_extra']; if (!empty($row['interests'])) { $interests = html_entity_decode($row['interests'],ENT_QUOTES,"utf-8"); if ((stripos($interests,"
        ") !== false) ) { $commainterests = ""; libxml_use_internal_errors(true); try { $XMLdoc = new SimpleXMLElement("" . $interests . ""); } catch (Exception $e) { $XMLdoc = NULL; } if ($XMLdoc != NULL) { $XPresult = $XMLdoc->xpath('ul/li'); while (list(,$node) = each($XPresult)) { if (!empty($commainterests)) $commainterests .= "; "; $commainterests .= trim($node); } } else { $interests = strip_tags($interests, "
      • "); $arrayinterests = explode("
      • ", $interests); foreach ($arrayinterests as &$value){ $value = trim($value); } $commainterests = implode("; ", $arrayinterests); $commainterests = ltrim($commainterests, "; "); } $interests = $commainterests; } else { $interests = strip_tags($interests); $interests = str_ireplace("

        ","",$interests); $interests = str_ireplace("

        ","",$interests); } $interests = "

        Research Interests: " . $interests . "

        "; //$outHTML .= $interests . "\r\n"; } // interests $emaillink = "
        ".$email.""; if ($showed & !empty($row['degree'])) $fullname .= ", " . $row['degree']; mysqli_free_result($result); $deptHTML = ""; $linkurl = ""; $rows = 0; $dsd = ""; $positions = 0; switch ($filter) { case 0 : $sqlaux = ""; break; case 1 : $sqlaux = " and users_departments.subdepartment_id IS NULL "; break; case 2 : $sqlaux = " and users_departments.subdepartment_id IS NOT NULL "; break; default: $sqlaux = ""; break; } $sql = "select in_db, departments.web,long_description as dname, TRIM(CONCAT_WS(\" \",titles.description,users_departments.title_description)) as workingtitle,departments_sub.description as dsd, multiple,affiliation from departments left join users_departments on (department_id=departments.id) left join titles on (users_departments.title_id=titles.id) left join departments_sub on (users_departments.subdepartment_id=departments_sub.id) where departments.web = 'http://mll.cah.ucf.edu/' and user_id=" . $id . ((!empty($department)) ? " and departments.id=" . $department : "") . $sqlaux . " order by users_departments.affiliation,departments.description, workingtitle"; //echo "||".$sql; $result = mysqli_query(get_dbconnection(),$sql); check_result($result,$sql); $positions = mysqli_num_rows($result); $titles = ""; while ($row = mysqli_fetch_assoc($result)) { $rows++; $notitle = false; $linkurl = ""; $link_closing = ""; $linkurl = ""; $link_closing = ""; //Photo Display $filename = COMMON_PATH . $photo; $filename = str_replace("/","\\",$filename); $photos = ''; if (!empty($photo) && file_exists($filename)) { $photos = '
        '. $linkurl .'' . $fullname . ''. $link_closing .'
        '; } //if ($row['affiliation'] == 'active') { if ($row['dsd'] != '') { $titles .= "
        ".$row['workingtitle']." of ".$row['dsd']; } else { $titles .= "
        ".$row['workingtitle']; } //} } // loop $outHTML .= "
        " . $photos . $linkurl . $fullname . $link_closing . $titles . $emaillink . $interests . "
        "; do_dbcleanup(); return $outHTML; } function print_historyToday(){ global $db_user, $db_pass, $db_server; $dbc = mysqli_connect($db_server, $db_user, $db_pass,"as"); if (!$dbc) { echo "

        This information is currently unavailable.

        "; } else { mysqli_select_db($dbc,"as"); $sql = "select DATE_FORMAT(event_date,'%Y') as eyear, description from history_events where DAYOFMONTH(event_date)=DAYOFMONTH(CURDATE()) and MONTH(event_date)=MONTH(CURDATE()) order by event_date desc"; $result = mysqli_query($dbc,$sql); $outHTML = ""; while ($row = mysqli_fetch_assoc($result)) { if (empty($outHTML)) $outHTML = "
          "; $outHTML .= "
        • " . $row['eyear'] . " " . $row['description'] . "
        • \n"; } if (!empty($outHTML)) $outHTML .= "
        "; echo $outHTML; mysqli_free_result($result); mysqli_close($dbc); } } function print_historyOnDate($day, $month){ global $db_user, $db_pass, $db_server; $dbc = mysqli_connect($db_server, $db_user, $db_pass,"as"); if (!$dbc) { echo "

        This information is currently unavailable.

        "; } else { $day = htmlspecialchars(stripslashes($day)); $month = htmlspecialchars(stripslashes($month)); mysqli_select_db($dbc,"as"); $sql = "select DATE_FORMAT(event_date,'%Y') as eyear, description from history_events where DAYOFMONTH(event_date)='".$day."' and MONTH(event_date)='".$month."' order by event_date desc"; $result = mysqli_query($dbc,$sql); $outHTML = ""; while ($row = mysqli_fetch_assoc($result)) { if (empty($outHTML)) $outHTML = "
          "; $outHTML .= "
        • " . $row['eyear'] . " " . $row['description'] . "
        • \n"; } if (!empty($outHTML)) $outHTML .= "
        "; return $outHTML; mysqli_free_result($result); mysqli_close($dbc); } } ?>
        masthead
        masthead

        Transforming Historic Records into an Interactive Museum Tool

        JailLedger1Jailbook3JailBook2

        Working with the Museum of Seminole County History, UCF Director of Public History and Associate Professor, Dr. Scot French wanted to transform an aging Jail Book into a digital format. Local business E-Z Photo Scan stepped in to volunteer its resources to make this hope a reality. Click here to read about this collaborative effort in creating an interactive museum tool.

        Counting Kills in the Debary Hall Game Ledger

        From 1904 to 1941, the DeBary family recorded the kind and amount of game killed in hunts on or near their namesake winter retreat. Along with the game bagged on registered hunts, the family documented various notes from these excursions, including weather conditions, hunting locations, wildlife observations, the amount of guns or people involved in each hunt, and remarks on the training and health of their hunting dogs. For this project, I focused only on the recordings documenting the wild game killed on the property. The following charts were generated to help visualize and understand the data within the ledger. After transcribing and organizing the game record’s scrawled cursive into spreadsheets, I was able to use Shiva VisualEyes tools to chart this raw data into coherent and interpretive graphs. The following charts not only exhibit a very diverse makeup in the kinds of game killed at DeBary Hall, but they also show a gradual decline in the amount of game hunted at DeBary Hall over the span of the 37 years recorded in the ledger. This rundown will examine each chart created and make deductions from their findings. Afterwards, I will explain the significance of the ledger and its data to revealing new details on Florida and US Southern history in general.

        Before diving into the numbers killed, the first question that should be asked is this: What game did the DeBarys and their guests hunt the most of? These pie charts break down the kills by kinds of animals.

        http://www.viseyes.org/shiva/go.htm?shivaGroup=Visualization&chartType=PieChart&dataSourceUrl=https://docs.google.com/spreadsheets/d/1L-rKE9u0dHRs2WJzE4wgvHUk6fMmJtOjBhoIJPxxakE/edit?usp=sharing&query=&height=900&width=900&is3D=false&pieHole=0&title=Most Common Game Hunted at Debary Hall (1904-1941)&fontName=Arial&fontSize=automatic&sliceVisibilityThreshold=.001&pieSliceText=percentage&tooltipText=value&legend=right&legendTextStyle=&backgroundColor=&chartArea=&colors=0040ff,ffbf00,ff0000,00ff40,2000ff,dfff00,&pieSliceTextStyle=&titleTextStyle=&tooltipTextStyle=&ud=false

        94% of the animals killed by the DeBarys were quail and snipe. Quail took up 66% of the ledger’s recorded kills, equaling 6,172 killed over the ledger’s 37 year span. Snipe took up 28% of the ledger’s total kills, equaling to 2,564. Considering that each of these birds have their own space for recordings in the ledger, this find was expected. The “quail” hunted here was the Northern Bobwhite, which thrives in pine forests like those that once dominated the landscape around DeBary Hall and Central Florida as a whole. Choice habitat plays a part in quail’s strong presence in this ledger, but the DeBary family might have also raised quail on their property to hunt them in the field. Because there is photographic evidence of the family raising pheasants, another popular game bird, and that there are notes within the ledger observing quail as “very wild,” it is safe to assume that the DeBary household at least dabbled in raising and managing quail populations on their acreage.

        The “snipe” recorded in the ledger refers to Wilson’s Snipe, a shorebird that is hunted more for sport than meat. Known for flying in a fast, zigzagging path, Wilson’s Snipe are challenging game to take down for a marksmen. Their migration into Florida for the winter made them key targets for the DeBarys as they finished out their seasonal stay at the hall.

        5.96% of the remaining game were either ducks, bass, or doves, which were recorded in the ledger under a space titled “Various.” 356 ducks were recorded within the ledger. Though ducks make up a mere 3% of the game killed, this group was the most diverse when it came to specific species represented. The DeBarys recorded six kinds of duck being shot within their game record, which were the Hooded Merganser, the American Black Duck (Blackhead), the Mallard, the Blue-Winged Teal, the Lesser Scaup (Broadbill), and the Ruddy Duck. 156 bass, most likely Largemouth Bass or Striped Bass , were fished at the hall, making up 2% of the game recorded. Mourning Doves, totaling at 54 recorded kills, make up 0.6% of the ledger’s game.

        The remaining 0.4% of the game recorded in the ledger, labeled “Other Game” in the preceding pie chart, is divided between nine animals that were killed irregularly among the more popular targets The next pie chart will break down the 0.4% of “Other Game.”

        http://www.viseyes.org/shiva/go.htm?shivaGroup=Visualization&chartType=PieChart&dataSourceUrl=https://docs.google.com/spreadsheets/d/1sTeJTakec-Kph5ljLTHy6dirtWy9-5hxxu39UtJ49wo/edit?usp=sharing&query=&height=900&width=900&is3D=false&pieHole=0&title=Miscellaneous Game Hunted at Debary Hall (1904-1941)&fontName=Arial&fontSize=automatic&sliceVisibilityThreshold=.001&pieSliceText=percentage&tooltipText=value&legend=right&legendTextStyle=&backgroundColor=&chartArea=&colors=0040ff,ffbf00,ff0000,df00ff,2000ff,20ff00,8000ff,666666,dfff00,&pieSliceTextStyle=&titleTextStyle=&tooltipTextStyle=&ud=false

        Within the variety of creatures that make up the remaining 0.4% of kills, rattlesnakes and rails make up 0.1%, a quarter of the “Other Game” represented in the previous pie chart. 14 rattlesnakes, presumably Eastern Diamondbacks, were all killed in one day. The 11 rails (shorebirds) were killed randomly, and they were made up of 3 distinct species; the King Rail, the Greater Yellowlegs, and the American Coot. The 6 Killdeer recorded in the ledger met their deaths in one day like the rattlesnakes, making up 0.06%. Raccoon and Foxes, numbering 4 kills each, make up 0.04%. Alligators and rabbits make up 0.02%, or 2 killed each. A single deer and a lone Bald Eagle make up the remaining game percentage with 0.01% each.

        All in all, 13 kinds of animals were killed at DeBary Hall. Of these creatures, only two of them were considered endangered or threatened during the ledger’s time span, the Bald Eagle and the American Black Duck. Both species though have recovered their numbers since then and are of least concern for now. Fortunately, the Debarys did not aid substantially in creating a threatened, endangered, or extinct species. However, a gradual decline in kills is observed in the ledger when one tallies the amount of game killed per season.

        http://www.viseyes.org/shiva/go.htm?shivaGroup=Visualization&chartType=LineChart&dataSourceUrl=https://docs.google.com/spreadsheets/d/1B0hQtudXzgaRP5b5WadUVBQI9zmlI0d7moqBn_0En2E/edit?usp=sharing&query=&height=400&width=850&title=Number of Game Killed Per Season (1904-1941)&areaOpacity=.3&fontName=Arial&fontSize=automatic&isStacked=false&lineWidth=2&pointSize=4&legend=right&legendTextStyle=&hAxis=baselineColor=000000,format=0000,title=SEASON,&series=&titleTextStyle=&tooltipTextStyle=&vAxis=format=0,title=NUMBEROFKILLS,&backgroundColor=fill=ffffff,stroke=000000,&chartArea=&colors=0040ff,ffbf00,ff0000,&ud=false

        This line chart demonstrates a decline in all game numbers over the time period recorded in the DeBary Hall hunting ledger. A “season” represents the time the family was in Florida. The DeBarys usually came into Florida by early November/mid-December, and they would stay until the coming of Spring in early March. This chart generates the sums of the quail, snipe, and the rest of the game killed each season.On average, snipe and all the other game declined one kill per season. Quail, despite being game that was more or less raised by the family, declined 6 kills per season on average. Three notable declines are explainable: the 1908 season was not recorded in the ledger, and the 1924 and 1925 season were banned by state legislation to actually help bird numbers recover. But even considering this background information, the lines representing game kills show far more decrease than increase or stability in kills over time. This bar chart below also exemplifies this conclusion in the data:

        http://www.viseyes.org/shiva/go.htm?shivaGroup=Visualization&chartType=BarChart&dataSourceUrl=https://docs.google.com/spreadsheets/d/1B0hQtudXzgaRP5b5WadUVBQI9zmlI0d7moqBn_0En2E/edit?usp=sharing&query=&height=1000&width=650&title=Number of Game Killed Per Season (1904-1941)&areaOpacity=.3&fontName=Arial&fontSize=automatic&isStacked=false&lineWidth=20&pointSize=10&legend=right&legendTextStyle=fontName=8,&hAxis=format=0,title=NumbersKilled,&series=&titleTextStyle=&tooltipTextStyle=&vAxis=format=0,title=Seasons,&backgroundColor=&chartArea=&colors=0040ff,ff0000,ff8a00,&ud=false

        With a gradual decline so evident within this data, it begs a bigger question; what is responsible for this obvious declivity? There are two possible answers to this question, and each can be supported by more data held within the pages of the ledger.

        The first viable answer is a growing disinterest toward hunting by the DeBary family as time progressed. An analyse of the average days hunted in each season questions this supposition, determining if mere lack of interest over time explains a decline in kills. Here is a graph exhibiting the days hunted per season:

        http://http://www.viseyes.org/shiva/go.htm?shivaGroup=Visualization&chartType=LineChart&dataSourceUrl=https://docs.google.com/spreadsheets/d/1xeefRkTZ5ed-OQJXMzqtWGLPShdr0NrcCbR70XVi2qo/edit?usp=sharing&query=&height=500&width=750&title=Days Hunted Per Season&areaOpacity=.3&fontName=Arial&fontSize=automatic&isStacked=false&lineWidth=2&pointSize=7&legend=right&legendTextStyle=&hAxis=format=0,title=Seasons,&series=&titleTextStyle=&tooltipTextStyle=&vAxis=format=0,title=NumberofDaysHunted,&backgroundColor=&chartArea=&colors=&ud=false

        As one can see, the amount of days hunted per season is a little but not too similar with the gradual decline in kills charted previously. The average season had 18.5 hunting days. The 1912 and 1917 seasons had the most days hunted at 37 and 42 while the 1914 and 1937 were very short at 4 days each. The days hunted in these seasons are reflected and seemingly explain the high and low game kills of those years, but other seasons do not coordinate in such ways. For example, the 1936 and 1939 seasons had above average days hunted, but the kill numbers were much more dismal than previous seasons with around the same amount of days hunted. For the most part, the days hunted do affect the amount of kills per season, but, as shown in the kill numbers and the days hunted of the 1930s, there was no obvious disinterest over time that explains the gradual decline of game kills recorded in the ledger.

        The second and probably the most viable answer is a reply already stressed by environmentalist and conservationists abroad. Continued human population growth and development of Central Florida’s natural environment throughout the early 20th century led to habitat loss and thus a decline in game and wild animals within the peninsula. More research and data is needed to solidify this claim, but it is a safe assumption to make. Though the population did not boom in Florida before WWII like it did afterwards, tourists and farmers were already permeating and establishing their presence in the peninsula. With this influx of people, the environment suffered. Increasing human population in the early 20th century transformed Florida’s hinterlands through the expansion of agriculture, the dredging of wetlands, and the introduction of invasive plants and animals (even in the ledger, one can see complaints of nonnative water hyacinth choking the waterways and grounds for birds). Because of a late Victorian fashion trend in feathered hats, widespread unrestricted hunting also came into the state, decimating thousands of birds.  Florida already suffered multiple blows to its natural resources and ecosystems even before the 1904 season was recorded in the ledger, prompting early regional conservation groups like to retaliate through supporting the passage bird protection laws and hiring wardens to enforce those laws.  There is quite a bit of historical evidence on the existence of habitat change throughout the state already, so it more than likely is a factor at least on the reduction of game numbers over time in the ledger. Though the ledger does not concisely describe the effects of habitat loss and development on the environment around DeBary hall, it does contain some details that can be used to help prove this point further. Bevy observations run through portions of the ledger (these are notes chronicling the amount of quail groups, or bevies, seen during a hunt), but, because of inconsistent and sometimes piecemeal recordings, they are not as trustworthy as the daily listings of kills. Nevertheless, such data could strengthen the notion that wildlife species were dwindling because of human activity.

         

        Despite begging bigger questions to be answered, this project did succeed in doing one thing; it shows how incredibly valuable this ledger, and other hunting ledgers like it, are at revealing the environmental conditions of the past and enriching the ecological history of Florida and the US South. By recording the game killed, these documents offer an intimate glimpse into historic wildlife numbers that were not as documented as they are in more recent decades. The addition and comparison of other hunting ledgers inside and outside of Florida can reveal just how much the environment changed in this state and other North American regions as human development prospered, and such data can show the true impact of human activity over the lands and waters of the continent over time. Though this project only uncovers one small regions’ wildlife numbers, it can be used as a template for similar studies in the future and slowly began a reevaluation by environmental historians into how wildlife numbers in the US and have responded to, respond to, and will respond to human activity in prior, present, and prospected times.

        James A. “Drew” Padgett

        Sanford: Then and Now

        Telling the Story of a Small Town in the Digital Age

        Contributed by Callie Henson, History Graduate Student

        The community of Sanford, FL began as a small steamboat shipping town and blossomed into one of the most productive celery and citrus cities in Florida from the onset of the 20th century until the 1960s. Sanford’s story is told by photographs in an Arcadia publication, Images of America: Sanford.

        This project focuses on the way in which small, once-booming towns, in this case Sanford, FL, use their history to create and maintain their own community narratives. Using a simple digital slider tool called Juxtapose JS and the familiar historical trope “then and now,” the project attempts to reveal how these types of stories can be crafted and altered drastically. The tool also adds a level of interactivity and serves as a dynamic way to compare the photographs, as opposed to a book of printed photos.

        The study uses photographs collected from local residents, the Sanford Museum, Sanford City Halland other local sources as historical artifacts and compares them directly with current photographs of the exact same physical places. This study uses photographs from multiple points in a building or location’s history to reveal that the story of that place can radically change. This study employs four different categories to measure these changes and evaluate the variations in the narrative: Dilapidated, Enriched, Maintained, Vanished. Ultimately, it’s the choices of the people who shape the town, both historically and in how they present the narrative.

        Dilapidated Sanford: Sanford Ave

        [juxtapose leftsrc=”http://projects.cah.ucf.edu/publichistory/wp-content/uploads/sites/2/2015/11/19785820285_6efd0a324f_o.jpg” rightsrc=”http://projects.cah.ucf.edu/publichistory/wp-content/uploads/sites/2/2015/11/SanfordAve-025.jpg”]

        First Photo: 1980s
        Second Photo: 2009

        Photo I have, but need to find on my computer/camera: Summer 2015 (Becomes Enriched Sanford with newest photo)

        Tags:

        Enriched Sanford: NAS Sanford

        [juxtapose leftsrc=”http://projects.cah.ucf.edu/publichistory/wp-content/uploads/sites/2/2015/11/19001697919_e446337d12_o1.jpg” rightsrc=”http://projects.cah.ucf.edu/publichistory/wp-content/uploads/sites/2/2015/11/18567442903_bf92ae8603_b.jpg”]

        Tags: