. */ include("./include/include.php"); include("./include/g_approved.php"); admin_header(); if( !in_array("candidate_viewlist", $_SESSION['sess_functions']) ) { echoln("You are not authorized to see this page."); }else { $title = "Candidates "; if( isset($_REQUEST['sort']) ) { $sort = $_REQUEST['sort']; }else { $sort = ""; } switch( $sort ) { case "fname": $title .= "by first name"; $sqlorder = "ORDER BY `FirstName`, `LastName`, `Created`"; break; case "lname": $title .= "by family name"; $sqlorder = "ORDER BY `LastName`, `FirstName`, `Created`"; break; case "nationality": $title .= "by nationality"; $sqlorder = "ORDER BY `Nationality`, `FirstName`, `LastName`"; break; case "local": $title .= "by local"; $sqlorder = "ORDER BY `BodyName`, `FirstName`, `LastName`"; break; case "position": $title .= "by position"; $sqlorder = "ORDER BY `candidatepost`.`position`, `FirstName`, `LastName`"; break; case "approved": $title .= "by approval status"; $sqlorder = "ORDER BY `Approved`, `FirstName`, `LastName`"; break; case "datemodify": $title .= "by modified date"; $sqlorder = "ORDER BY `Modified`, `FirstName`, `LastName`"; break; case "datecreate": default: $title .= "by candidation date"; $sqlorder = "ORDER BY `Created`, `FirstName`, `LastName`"; break; } echoln("

".$title."

"); $query = "SELECT `candidates`.`id` AS `id`, `FirstName`, `LastName`, `candidates`.`Email` AS `Email`, `CountryCodes`.`Name` AS `Nationality`, `BodyName`, `candidatepost`.`position` AS `Position`, `Approved`, `Created`, `Modified` FROM `candidates`, `ab_bodies`, `candidatepost`, `CountryCodes` WHERE `candidates`.`Position`=`candidatepost`.`id` AND `candidates`.`BodyCode`=`ab_bodies`.`BodyCode` AND `candidates`.`Nationality`=`CountryCodes`.`Code` ".$sqlorder; if( @mysql_num_rows( $res=doquery($query) )<1 ) { echoln("Empty selection."); }else { echoln(""); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); $i = 0; while( $row = mysql_fetch_array($res) ) { $i++; if( ($i%2)==1 ) echoln(" "); else echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); if( in_array("candidate_approve", $_SESSION['sess_functions']) ) { echoln(" "); } echoln(" "); } echoln("
 CreatedModifiedFirst nameFamily nameLocalNationalityPositionApproved
"); if( in_array("candidate_viewdetail", $_SESSION['sess_functions']) ) { echoln(" \"Show "); } echoln(" \"Send "); if( in_array("candidate_edit", $_SESSION['sess_functions']) ) { echoln(" edit"); } echoln(" ".get_date(substr($row['Created'], 0, 10))."".get_date(substr($row['Modified'], 0, 10))."".$row['FirstName']."".$row['LastName']."".$row['BodyName']."".ucwords(strtolower($row['Nationality']))."".$row['Position']."\"".$Approved_text[
"); } } admin_footer(); ?>