Performance History Backup

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

if ($parms == “yes”) {

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

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

$perfparm = “Back“;

if ($parm1 <> “”) {
echo “” . $name1 . ““;

$url = “http://www.lictc.org/wp-content/uploads/” . $parmurl . “-headshot.jpg”;
$file_exists = (@fopen($url, “r”)) ? true : false;

if ($file_exists == 1) {
echo ”  Headshot“;
}

/*
if ($file_exists == 1) {
echo ”  Headshot“;
}
*/
$url = “http://www.lictc.org/wp-content/uploads/” . $parmurl . “-resume.pdf”;
$file_exists = (@fopen($url, “r”)) ? true : false;

if ($file_exists == 1) {
echo ”  Resume“;
}

/*
if ($file_exists == 1) {
echo ”  Resume“;
}
*/

echo “

“;
}

/* CAST */

$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, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Name like $parm1 and Cast.Type <> ‘Production’ order by Opens DESC”;
}
else {
$sql = “SELECT 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 Name like $parm1 and Closes >= ‘$today’ and Cast.Type <> ‘Production’ order by Opens DESC”;
}

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

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

Cast

“;

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) ;
$openmonth = date(“F”, strtotime($opens));
$openmon3 = date(“M”, strtotime($opens));
$openm3y = $openmon3 . ” ” . substr($opens, 0, 4) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2) . “/” . substr($closes, 0, 4);
$comp = $row[“Company”];
$dates = $openm . ” – ” . $closesm;
$pers0 = $row[“Name”] .” in ” . $row[“ShowName”];
$pers = str_replace(” “,”~”,$pers0);
$pers = str_replace(“&”,”^”,$pers);

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

// echo “

“;
echo “

“;

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

echo “

Opened Role Show Company
” . $dates . “” . “ ” . $row[“Role”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “
” . $openm3y . “” . “ ” . $row[“Role”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “

“;
$mysqli->close();

//PRODUCTION TEAM

echo “

“;

$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, Performances.Company from `Cast`
INNER JOIN Performances
ON Cast.Production = Performances.Production
where Name like $parm1 and Cast.Type = ‘Production’ order by Opens DESC”;
}
else {
$sql = “SELECT 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 Name like $parm1 and Closes >= ‘$today’ and Cast.Type = ‘Production’ order by Opens DESC”;
}

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

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

echo “

Production Team

“;
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) ;
$openmonth = date(“F”, strtotime($opens));
$openmon3 = date(“M”, strtotime($opens));
$openm3y = $openmon3 . ” ” . substr($opens, 0, 4) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2) . “/” . substr($closes, 0, 4);
$comp = $row[“Company”];
$dates = $openm . ” – ” . $closesm;
$pers0 = $row[“Name”] .” in ” . $row[“ShowName”];
$pers = str_replace(” “,”~”,$pers0);
$pers = str_replace(“&”,”^”,$pers);

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

// echo “

“;
echo “

“;

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

echo “

Opened Role Show Company
” . $dates . “” . “ ” . $row[“Role”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “
” . $openm3y . “” . “ ” . $row[“Role”] . “ ” . $showparm . $row[“ShowName”] . “” . “ ” . $comp . “

“;
$mysqli->close();
}

[/insert_php]