[insert_php]
$parms = “yes”;
if($_GET[“prod”] == “”) $parms = “no”;
$prod = “‘” . $_GET[‘prod’] . “‘”;
$person = $_GET[‘person’] ;
$start = $_GET[‘start’] ;
if ($person <> “”) {
$pers = str_replace(“~”,” “,$person);
$pers = str_replace(“\'”,”‘”,$pers);
$pers = str_replace(“^”,”&”,$pers);
echo “ Performance Schedule for ” . “” . $pers . ““;
};
$showparm = ““];
date_default_timezone_set(“America/New_York”);
$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”);
$startday = $today;
if ($start <> “”) {
$startday = $start;
}
if ($startday < $today) {
$startday = $today;
}
$enddate = date("Y-m-t", strtotime($startday));
$nextstring = $enddate . " +1 day";
$nextmonth = date("Y-m-d",strtotime("$nextstring"));
$startdate = date("Y-m-1",strtotime($startday));
$prevstring = $startdate . " -1 month";
$prevmonth = date("Y-m-01",strtotime("$prevstring"));
if ($parms == "no") {
$sql = "SELECT Times.Date, Times.Time, Times.TVenue, Times.TAddress, Times.TTown, Performances.Production, Performances.ShowName, Performances.Company, Performances.Venue, Performances.Address, Performances.Town, Performances.TicketURL from `Performances`
INNER JOIN Times
ON Times.Production = Performances.Production where Date >=’$startday’ and Date <= '$enddate' and Performances.Status = 'active'
order by Times.Date, Times.Time";
} else {
$sql = "SELECT Times.Date, Times.Time, Times.TVenue, Times.TAddress, Times.TTown, Performances.Production, Performances.ShowName, Performances.Company, Performances.Venue, Performances.Address, Performances.Town, Performances.TicketURL from `Performances`
INNER JOIN Times
ON Times.Production = Performances.Production where Date >= ‘$today’ and Performances.Production = $prod
order by Times.Date, Times.Time”;
}
$result = $mysqli->query($sql);
$olddate = “old”;
$oldmonth = “old”;
if ($result->num_rows > 0) {
// output data of each row
echo “
“;
echo “
” .”Click show name for performance details. Click map icon for map. Click on company name to see shows performed by that company.” . “ | |||
” . “ | |||
” . “” . $monthName . “ | |||
” . “ < ” . “” . $monthName . “ > | |||
” . “” . $monthName . “ > | |||
” . $showdatef . “ | |||
” . $timef , “ | ” . $showparm . $row[“ShowName”] . “” . “ | ” . $mapparm . ” ![]() |
” . $compphrase . $row[“TAddress”] . “ ” . $row[“TTown”] . “ |
” . $timef , “ | ” . $showparm . $row[“ShowName”] . “” . “ | ” . $mapparm . ” ![]() |
” . $compphrase . $row[“Address”] . “ ” . $row[“Town”] . “ |
“;
$mysqli->close();
[/insert_php]