<?php
$searchfor = "";
if (strpos($_SERVER['REQUEST_URI'],"/family-children") !== false) {
$searchfor = "Head of Family Children";
} else if (strpos($_SERVER['REQUEST_URI'],"/family-finance") !== false) {
$searchfor = "Head of Family Finance";
} else if (strpos($_SERVER['REQUEST_URI'],"/personal-injury") !== false) {
$searchfor = "Head of Personal Injury";
} else if (strpos($_SERVER['REQUEST_URI'],"/employment ") !== false) {
$searchfor = "Head of Employment";
} else if (strpos($_SERVER['REQUEST_URI'],"/court-of-protection") !== false) {
$searchfor = "Head of Court of Protection";
}
?>
<?php
$People = new WA_MySQLi_RS("People",$DBConnection,0);
$People->setQuery("SELECT service_contents.*, join_expertise.*, staff.* FROM service_contents INNER JOIN join_expertise ON service_contents.ServicesID = join_expertise.RowsExpertiseContentID INNER JOIN staff ON join_expertise.RowsStaffContentID = staff.StaffID WHERE service_contents.ServicesID = ? GROUP BY StaffID ORDER BY IF(Locate(?,StaffJob)=1,0,1), StaffOrder ASC");
$People->bindParam("i", "".($PageContents->getColumnVal('ServicesID')) ."", "-1"); //WAQB_Param1
$People->bindParam("s", "".($searchfor) ."", "-1"); //WAQB_Param2
$People->execute();
?>