Audition Calendar Backup

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

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”);
echo “

“;
echo “

“;
echo “

“;
//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 ($parms == “no”) {
$sql = “SELECT AuditionDate, AuditionTime, AuditionType, Performances.Production, Performances.ShowName, AuditionTown from `AuditionDates`
INNER JOIN Performances
ON AuditionDates.Production = Performances.Production where AuditionDate >= ‘$today’
order by AuditionDate, AuditionTime”;
} else {
$sql = “SELECT AuditionDate, AuditionTime, AuditionType, Performances.Production, Performances.ShowName, AuditionTown from `AuditionDates`
INNER JOIN Performances
ON AuditionDates.Production = Performances.Production where AuditionDate >= ‘$today’
order by AuditionDate, AuditionTime”;
}

$result = $mysqli->query($sql);
$olddate = “old”;

if ($result->num_rows > 0) {
// output data of each row

while($row = $result->fetch_assoc()) {

$showparm = ““;

$mm = substr($row[“AuditionDate”],5,2);
$dd = substr($row[“AuditionDate”],8,2);
$yy = substr($row[“AuditionDate”],0,4);
$datestring = $row[“AuditionDate”];

$dateObj = DateTime::createFromFormat(‘Y-m-d’, $datestring);
$monthName = $dateObj->format(‘F’);
$dayName = $dateObj->format(‘D’);
$datef = $dayName . ” ” . substr($monthName,0,3) . ” ” . $dd;
$showdatef = $datef;
if ($showdatef == $olddate) {
$showdatef = “”;
}
$olddate = $datef;

$time = $row[“AuditionTime”];
$d = new DateTime($time);
$timef = $d->format( ‘g:i A’ );

echo “

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

Date Time Show Type
” . $showdatef . “ ” . $timef , “ ” . $showparm . $row[“ShowName”] . ““. “ ” . $row[“AuditionType”] . “

“;
$mysqli->close();

[/insert_php]