Audition Search Results Backup

[insert_php]
// Audition Roles********************************************************************************************

$parms = “yes”;

$parmgen = $_GET[‘Gender’] ;

$parmminage = $_GET[‘minage’] ;
$parmmaxage = $_GET[‘maxage’] ;
$parmsall = $parmgen . $parmminage . $parmmaxage;

if ($parmsall == NULL ) { $parms = “no”;}

if ($parmgen <> “”) {$parmgen = “‘” . $_GET[‘Gender’] . “‘”;}
$parmgen = str_replace(“~”,”/”,$parmgen);
$parmgenlike = “‘%” . $_GET[‘Gender’] .”%'”;
$parmgenlike = str_replace(“~”,”/”,$parmgenlike);
$today = date(“Y-m-d”);

if ($parms == “yes”) {

echo ”

Roles

“;
echo “

“;
echo “

“;

$mysqli = new mysqli(‘localhost’, ‘lictc_user’, ‘lictc’, ‘lictc’);

if ($mysqli->connect_error) {
die(‘Connect Error (‘ . $mysqli->connect_errno . ‘) ‘
. $mysqli->connect_error);
}

mysqli_set_charset($mysqli, ‘utf8mb4’);

if ($parmgen <> “‘All'” and $parmgen <> “”) {

$sql = “SELECT Role, RoleType, Gender, AgeMin, AgeMax, Description, Requirement, SongstoKnow, Ethnicity, Performances.ShowName, AuditionRoles.Production, AuditionInfo.LastDate
from `AuditionRoles`
INNER JOIN Performances
ON AuditionRoles.Production = Performances.Production
INNER JOIN AuditionInfo
ON AuditionRoles.Production = AuditionInfo.Production
where Gender like $parmgenlike AND $parmminage <= AgeMax AND $parmmaxage >= AgeMin AND LastDate >= ‘$today'”;

}
else {

$sql = “SELECT Role, RoleType, Gender, AgeMin, AgeMax, Description, Requirement, SongstoKnow, Ethnicity, Performances.ShowName, AuditionRoles.Production, AuditionInfo.LastDate
from `AuditionRoles`
INNER JOIN Performances
ON AuditionRoles.Production = Performances.Production
INNER JOIN AuditionInfo
ON AuditionRoles.Production = AuditionInfo.Production
where $parmminage <= AgeMAX AND $parmmaxage >= AgeMin AND LastDate >= ‘$today'”;

}

$result = $mysqli->query($sql);

if ($result->num_rows > 0) {

echo “

” ;

while($row = $result->fetch_assoc()) {

// output data of each row

$agemin = $row[“AgeMin”];
$agemax = $row[“AgeMax”];
if($row[“AgeMin”] == “1”) {$agemin = “”;}
if($row[“AgeMax”] == “99”) {$agemax = “”;}

$ages = $agemin . “-” . $agemax;
if ($agemin == “”) {$ages= $agemax ;}
if ($agemax == “”) {$ages= $agemin . “+”;}
if ($agemin == “” and $agemax ==””) {$ages = “”;}
$showparm = “” ;

$desc = “” . $showparm . $row[“ShowName”] . “
” ;
if ($row[“Ethnicity”] <> “”) {$desc = $desc . “(” . $row[“Ethnicity”] . “) “;}
$desc = $desc . $row[“Description”];
if ($row[“Requirement”] <> “”) {$desc = $desc . “
” . $row[“Requirement”];}
if ($row[“SongstoKnow”] <> “”) {$desc = $desc . “
Songs to Know – ” . $row[“SongstoKnow”];}
$role = $row[“Role”] ;
if ($row[“RoleType”] <> “”) {
$role = $role . “(” . $row[“RoleType”] . “)” ;
}
echo “

” .

” .

” .

” ;
}
} else { echo “0 results”;
}
echo “

” .
“Role” . “
” .
“M/F” . “
” .
“Age” . “
” .
“Description” . “
” . $role . “ ” . $row[“Gender”]. “ ” . $ages . “ ” . $desc . “

“;

$mysqli->close();
}

[/insert_php]