Now Playing – backup

[insert_php]
$parms = “yes”;
if($_GET[“prod”] == “”) $parms = “no”;
$prod = “‘” . $_GET[‘prod’] . “‘”;
$person = $_GET[‘person’] ;
$compparm = $_GET[‘company’] ;
$compdisplay = str_replace(“~”,” “,$compparm);
$company = “‘” . $_GET[‘company’] . “‘”;
$company = str_replace(“~”,” “,$company);

if ($person <> “”) {
$pers = str_replace(“~”,” “,$person);
$pers = str_replace(“‘”,”‘”,$pers);
echo “ Performance Schedule for ” . “” . $pers . ““;

};

if ($compparm <> “”) {
//echo “

“;
echo “” . $compdisplay. “
“;

//**************

$mysqli = new mysqli(‘localhost’, ‘lictc_user’, ‘lictc’, ‘lictc’);

if ($mysqli->connect_error) {
die(‘Connect Error (‘ . $mysqli->connect_errno . ‘) ‘
. $mysqli->connect_error);
}

$sql = “SELECT Company, Address, Town, Zip, Phone, Website, Email from `Companies`
where Company = $company “;

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

if ($result->num_rows > 0) {

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

if ($row[“Address”] <> “”) {echo $row[“Address”] . “, ” . $row[“Town”];}
if ($row[“Website”] <> “”) {echo “
” . “” . $row[“Website”] .
” ;}
if ($row[“Email”] <> “”) {echo “
” . “” . $row[“Email”] .
” ;}
if ($row[“Phone”] <> “”) {echo “
” . $row[“Phone”];}

}
}
$mysqli->close();

}

$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”);
$date = strtotime(“+5 day”);
$wkend = date(“Y-m-d”, $date);

if ($compparm != “”) {
echo “

” . “Click on date range to see show dates, times and location.   Click on show name for performance details.

” . “

“;
$sql = “SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances`
where Closes >= ‘$today’ and Opens <= '$wkend' and Status = 'active' and Company = $company order by ShowName, Company"; } else { echo "” .”Click show name for performance details.  Click on company name to see shows performed by that company.  Click on date range to see show dates, times and location.

” ;
$sql = “SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances`
where Closes >= ‘$today’ and Opens <= '$wkend' and Status = 'active' order by ShowName, Company"; } $result = $mysqli->query($sql);
$olddate = “old”;

echo “

“;
if ($result->num_rows > 0) {

echo “

Now Playing

“;

if ($compparm == “”) {
echo “

“;
echo “

“;
} else {
echo “

Show Company Dates
“;
echo “

“;
}

// output data of each

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

$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$showfix = str_replace(“&”,”^”,$showfix);
$showparm = ““;
$persparm = “
“;

$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;

$comp = $row[“Company”];
$comp = trim($comp,” “);
$comp = str_replace(” “,”~”,$comp);
$companyparm = “
” ;

if ($compparm == “”) {
echo “

“;
} else {
echo “

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

Dates Type Show
” . $persparm . $dates . “
” . $showparm . $row[“ShowName”] . ““. “ ” . $companyparm . $row[“Company”] . ““. “ ” . $persparm . $dates . “
” . $persparm . $dates . “ ” . $row[“Type”] . “ ” . $showparm . $row[“ShowName”] . ““. “

“;
$mysqli->close();

//COMING SOON *******************************************************************

//Coming Soon

$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”);
$oldmonth = “Start”;

if ($compparm != “”) {
$sql = “SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances`
where Closes >= ‘$today’ and Opens > ‘$wkend’ and Status = ‘active’ and Company = $company order by Opens”;
} Else {
$sql = “SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances`
where Closes >= ‘$today’ and Opens > ‘$wkend’ and Status = ‘active’ order by Opens, ShowName”;
}

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

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

“;
echo “

Coming Soon

“;
//echo

“;

if ($compparm == “”) {
echo “

“;
echo “

“;
} else {
echo “

Show Company Dates
“;
echo “

“;
}

// output data of each row

while($row = $result->fetch_assoc()) {
$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$showfix = str_replace(“&”,”^”,$showfix);
$showparm = ““;
$persparm = “
“;

$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;
$openmonth = date(“F”, strtotime($opens));

$comp = $row[“Company”];
$comp = trim($comp,” “);
$comp = str_replace(” “,”~”,$comp);
$companyparm = “
” ;

if ($compparm == “”) {
if ($openmonth <> $lastmonth) {
echo “

“;
$lastmonth = $openmonth ;
}
echo “

“;
} else {
echo “

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

Dates Type Show
” . $openmonth . “
” . $showparm . $row[“ShowName”] . ““. “ ” . $companyparm . $row[“Company”] . ““. “ ” . $persparm . $dates . “
” . $persparm . $dates . “ ” . $row[“Type”] . “ ” . $showparm . $row[“ShowName”] . ““. “

“;
$mysqli->close();

//Previous Shows ************************************************************
if ($compparm <> “”) {

$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”);
$oldmonth = “Start”;

if ($compparm != “”) {
$sql = “SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances`
where Closes < '$today' and Status = 'active' and Company = $company order by Opens DESC"; } Else { $sql = "SELECT Production, Company, ShowName, Type, Venue, Town, Opens, Closes from `Performances` where Closes < '$today' and Status = 'active' order by Opens DESC, ShowName"; } $result = $mysqli->query($sql);
$olddate = “old”;

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

“;
echo “

Past Shows

“;
//echo

“;

if ($compparm == “”) {
echo “

“;
echo “

“;
} else {
echo “

Show Company Dates
“;
echo “

“;
}

// output data of each row

while($row = $result->fetch_assoc()) {
$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$showfix = str_replace(“&”,”^”,$showfix);
$showparm = ““;
$persparm = “
“;

$opens = $row[“Opens”];
$openm = substr($opens, 5, 2) . “/” . substr($opens, 8, 2) ;
$openmy = substr($opens, 5, 2) . “/” . substr($opens, 0, 4) ;
$closes = $row[“Closes”];
$closesm = substr($closes, 5, 2) . “/” . substr($closes, 8, 2) ;
$dates = $openm . “-” . $closesm;
$openmonth = date(“F”, strtotime($opens));
$openmon3 = date(“M”, strtotime($opens));
$openm3y = $openmon3 . ” ” . substr($opens, 0, 4) ;

$comp = $row[“Company”];
$comp = trim($comp,” “);
$comp = str_replace(” “,”~”,$comp);
$companyparm = “
” ;

if ($compparm == “”) {
if ($openmonth <> $lastmonth) {
echo “

“;
$lastmonth = $openmonth ;
}
echo “

“;
} else {
echo “

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

Opened Type Show
” . $openmonth . “
” . $showparm . $row[“ShowName”] . ““. “ ” . $companyparm . $row[“Company”] . ““. “ ” . $persparm . $dates . “
” . $openm3y . “ ” . $row[“Type”] . “ ” . $showparm . $row[“ShowName”] . ““. “

“;
$mysqli->close();
}

if ($compparm != “”) {
echo ““;
}
[/insert_php]