[insert_php]
$parms = “yes”;
if($_GET[“parm1”] == “”) $parms = “no”;
$parm1 = “‘” . $_GET[‘parm1’] . “‘”;
$parm2 = $_GET[‘parm1’] ;
$showparm = ““;
$today = date(“Y-m-d”);
echo “
” .”Click on company name to see shows performed by that company. For current shows, click on date range to see show dates, times and location.
” . “ |
“;
echo “
“;
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 ($parms <> “no”) {
$sql = “SELECT Production, Company, ShowName, Author, Director, Opens, Closes, Type, TicketCost, Times, Address, Town, Venue, Tickets, TicketURL, Note1, ShowNote from `Performances` where Production = $parm1 “;
} else {
$sql = “SELECT Production, Company, ShowName, Author, Director, Opens, Closes, Type, TicketCost, Times, Address, Town, Venue, Tickets, Note1, ShowNote from `Performances` “;
}
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$tixcost = $row[“TicketCost”];
$ticketcost = str_replace(“$”,”\$”,$tixcost);
$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;
$openmon3 = date(“M”, strtotime($opens));
$openm3y = $openmon3 . ” ” . substr($opens, 0, 4) ;
$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$showfix = str_replace(“&”,”^”,$showfix);
$showfix2 = str_replace(“‘”,”@”,$showfix);
if ($row[“TicketURL”] <> “”) {
$ticketinfo = $row[“Tickets”] . ” ” . “Online Tickets” ;
}
else {
$ticketinfo = $row[“Tickets”] ;
}
$castparm = “Cast List“;
$showparm = “” ;
$company = $row[“Company”];
$company = trim($company,” “);
$company = str_replace(” “,”~”,$company);
$companyparm = “” ;
echo “
” . “Show” . “ |
” . $row[“ShowName”] . “ |
” ;
echo “
” . “Type” . “ |
” . $row[“Type”] . “ |
” ;
if ($row[“Author”] <> “”) {
echo “
” . “Written By” . “ |
” . $row[“Author”] . “ |
” ;
}
if ($row[“Director”] <> “”) {
echo “
” . “Director” . “ |
” . $row[“Director”] . “ |
” ;
}
echo “
” . “Company” . “ |
” . $companyparm . $row[“Company”] . “” . “ |
” ;
echo “
” . “Venue” . “ |
” . $row[“Venue”] . “ |
” ;
echo “
” . “ |
” . $row[“Address”] . “ |
” ;
echo “
” . “ |
” . $row[“Town”]. “ |
” ;
if ($today > $closes) {
echo “
” . “Opened” . “ |
” . $openm3y . “” . “ |
” ;
} else {
echo “
” . “Dates” . “ |
” . $showparm . $dates . “” . “ |
” ;
}
if ($row[“Times”] <> “”) {
echo “
” . “Times” . “ |
” . $row[“Times”] . “ |
” ;
}
if ($row[“TicketCost”] <>“”) {
echo “
” . “Cost” . “ |
” . $ticketcost . “ |
” ;
}
if ($row[“Tickets”] <> “”) {
echo “
” . “Ticket Info” . “ |
” . $row[“Tickets”] . “ |
” ;
}
if ($row[“TicketURL”] <> “” and $today <= $closes) {
$href = "location.href='http://" . $row["TicketURL"] ."'";
echo "
|
” . “ |
” ;
}
if ($row[“ShowNote”] <> “”) {
echo “
” . “Description” . “ |
” . $row[“ShowNote”] . “ |
” ;
}
if ($row[“Note1”] <> “”) {
echo “
” . “Note” . “ |
” . $row[“Note1”] . “ |
” ;
}
echo “
“;
$production = $row[“Production”];
}
$location = “location.href=’cast-list/?parm1=” . $parm2 . “&show=” . $showfix2 . “‘” ;
$mysqli->close();
$mysqli = new mysqli(‘localhost’, ‘lictc_user’, ‘lictc’, ‘lictc’);
if ($mysqli->connect_error) {
die(‘Connect Error (‘ . $mysqli->connect_errno . ‘) ‘
. $mysqli->connect_error);
}
}
$sql = “SELECT Production from `Cast` where Production = $parm1 “;
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// There are cast entries, so display button
echo ““;
echo str_repeat(‘ ‘, 5);
}
$mysqli->close();
echo ““;
echo “
“;
$url = “http://www.lictc.org/wp-content/uploads/” . $production . “.jpg”;
$file_exists = (@fopen($url, “r”)) ? true : false;
if ($file_exists == 1) {
echo “
“;
}
[/insert_php]