Role Search Backup

Search our cast lists to see who has played a role in a show you are casting
Enter a partial role name and/or a partial show name then click on Search. Role could be a character name or a production role (e.g. director, musical director, choreographer, producer, stage manager). Don’t worry about upper or lower case.

Role:
Show:


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

if ($parms == “yes”) {

$parm1 = str_replace(“‘”,””,$role) ;
$parm1x = $parm1;
$parm1 = “‘%” . $parm1 . “%'” ;

$parm2 = str_replace(“‘”,””,$show) ;
$parm2x = $parm2;
$parm2 = “‘%” . $parm2 . “%'” ;

// CAST SEARCH
$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 ($role <> “”” and $show <> “””) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Role like $parm1 and ShowName like $parm2 and Cast.Type != ‘Production’ order by ID, Role, Opens DESC “;
}
elseif ($role <> “”” ) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Role like $parm1 and Cast.Type <> ‘Production’ order by ID, Role, Opens DESC”;
}
elseif ($show <> “”” ) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where ShowName like $parm2 and Cast.Type != ‘Production’ order by ID, Role, Opens DESC”;
}

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

if ($result->num_rows > 0) {

echo “Results for Role= ” . $parm1x . “ and Show = ” . $parm2x . “ “;

echo “

Cast

“;

// 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). “/” . substr($opens, 0, 4) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2). “/” . substr($closes, 0, 4) ;
$dates = $openm . “-” . $closesm;
$comp = $row[“Company”];
$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 = “
” ;

echo “

“;

}
} else {
echo “0 results”;
}

echo “

Role Name Show Company
” . $row[“Role”] . “” . “ ” . $persparm . $row[“Name”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “

“;
$mysqli->close();

// PRODUCTION SEARCH
$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 ($role <> “”” and $show <> “””) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Role like $parm1 and ShowName like $parm2 and Cast.Type = ‘Production’ order BY Field (Role,’Casting Director’, ‘Stage Manager’,’Choreographer’,’Music Director’,’Musical Director’,’Assistant Director’, ‘Director’,’Producer’) DESC, ID, Opens DESC”;
}
elseif ($role <> “”” ) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Role like $parm1 and Cast.Type = ‘Production’ order BY Field (Role,’Casting Director’, ‘Stage Manager’,’Choreographer’,’Music Director’,’Musical Director’,’Assistant Director’, ‘Director’,’Producer’) DESC, Name, Opens DESC”;
}
elseif ($show <> “”” ) {
$sql = “SELECT Cast.ID, Cast.Type, Cast.Role, Cast.Name, Performances.ShowName, Performances.Venue, Performances.Opens, Performances.Closes, Performances.Production, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where ShowName like $parm2 and Cast.Type = ‘Production’ order BY Field (Role,’Casting Director’, ‘Stage Manager’,’Choreographer’,’Music Director’,’Musical Director’,’Assistant Director’, ‘Director’,’Producer’) DESC, ID, Opens DESC”;
}

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

if ($result->num_rows > 0) {

echo “Results for Role= ” . $parm1x . “ and Show = ” . $parm2x . “ “;

echo “

Production Team

“;

// 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). “/” . substr($opens, 0, 4) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2). “/” . substr($closes, 0, 4) ;
$dates = $openm . “-” . $closesm;
$comp = $row[“Company”];
$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 = “
” ;

echo “

“;

}
} else {
echo “0 results”;
}

echo “

Role Name Show Company
” . $row[“Role”] . “” . “ ” . $persparm . $row[“Name”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “

“;
$mysqli->close();
}

[/insert_php]