Cast Search Backup

Search our cast lists to see if someone you know is in a show
Enter a partial name and click on Search
(Don’t worry about upper or lower case)

Keyword:


[insert_php]
$parms = “yes”;
$name = “‘” . $_GET[‘person’] . “‘”;
if ($name == “””) {$parms = “no”;}

if ($parms == “yes”) {

$parm1 = str_replace(“‘”,””,$name) ;
$parm1 = str_replace(“~”,” “,$parm1);
$parm1 = “‘%” . $parm1 . “%'” ;

$parm2 = “now”;
$type = “‘” . $_GET[‘type’] . “‘”;
if ($type == “‘all'”) {$parm2 = “all”;}

$perfparm = “Back“;

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

if ($mysqli->connect_error) {
die(‘Connect Error (‘ . $mysqli->connect_errno . ‘) ‘
. $mysqli->connect_error);
}
$today = date(“Y-m-d”);

if ($parm2 == “all”) {
$sql = “SELECT Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Name like $parm1 order by Type”;
}
else {
$sql = “SELECT Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Name like $parm1 and Closes >= ‘$today’ order by Type”;
}

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

if ($result->num_rows > 0) {
// print header
echo “

“;
echo “

“;

// output data of each row

while($row = $result->fetch_assoc()) {
$type = $row[“Type”];
$opens = $row[“Opens”];
$openm = substr($opens, 5, 2) . “/” . substr($opens, 8, 2) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2) ;
$dates = $openm . “-” . $closesm;
$pers0 = $row[“Name”] .” in ” . $row[“ShowName”];
$pers = str_replace(” “,”~”,$pers0);
$pers = str_replace(“&”,”^”,$pers);
$name0 = $row[“Name”];
$name = str_replace(” “,”~”,$name0);
$name = str_replace(“&”,”^”,$name);
$name = str_replace(“&”,”^”,$name);

$showparm = ““;
$persparm = “
” ;
$personparm = “
” ;

echo “

“;

}
} else {
echo “0 results”;
}

echo “

Name Role Show Dates
” . $personparm . $row[“Name”] . “” . “ ” . $row[“Role”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $persparm . $dates . “

“;
$mysqli->close();
}
[/insert_php]