Audition Details Backup

[insert_php]

$parms = “yes”;
if($_GET[“parm1”] == “”) $parms = “no”;
$parm1 = “‘” . $_GET[‘parm1’] . “‘”;
$parm2 = $_GET[‘parm1’] ;
echo “

“;
echo “

“;

$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$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 AuditionInfo.Production, AuditionCategory, AuditionInstructions, RehearsalDates, AuditionQuestions, Submissions, AuditionDates, CallBackDates, ProductionNotes, Performances.ShowName, Performances.Company, Performances.Note1, Performances.ShowNote, Performances.Times, Performances.Director, Performances.MusicalDirector, Performances.Choreographer, Performances.Producer from `AuditionInfo`
INNER JOIN Performances
ON AuditionInfo.Production = Performances.Production
where AuditionInfo.Production = $parm1 “;
} else {
$sql = “SELECT AuditionInfo.Production, AuditionCategory, AuditionInstructions, RehearsalDates, AuditionQuestions, Submissions, AuditionDates, CallBackDates, ProductionNotes, Performances.ShowName, Performances.Company, Performances.Note1, Performances.ShowNote, Performances.Times, Performances.Director, Performances.MusicalDirector, Performances.Choreographer, Performances.Producer from `AuditionInfo`
INNER JOIN Performances
ON AuditionInfo.Production = Performances.Production “;
}

$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// output data of each row

while($row = $result->fetch_assoc()) {
$showfix = str_replace(” “,”~”,$row[“ShowName”]);
$showfix = str_replace(“&”,”^”,$showfix);
$showfix2 = str_replace(“&”,”and”,$row[“ShowName”]);
$showname = $row[“ShowName”];
$showname = str_replace(“‘”,”’”,$showname);
$companyorig = $row[“Company”];
$dates = $row[“AuditionDates”];
$dates = str_replace(“\n”, “%0D%0A%09%09%09”, $dates);
$dates = str_replace(“\r”, “”, $dates);

$rolesparm = “Cast List“;
$showparm = “” ;

echo “

” ;
echo “

” ;
if ($row[“Director”] <> “”) {
echo “

” ;
}
if ($row[“MusicalDirector”] <> “”) {
echo “

” ;
}
if ($row[“Choreographer”] <> “”) {
echo “

” ;
}
if ($row[“Producer”] <> “”) {
echo “

” ;
}

if ($row[“ProductionNotes”] <> “”) {
echo “

” ;
}
if ($row[“AuditionInstructions”] <> “” ) {
echo “

” ;
}
if ($row[“RehearsalDates”] <> “”) {
echo “

” ;}
if ($row[“Times”] <> “”) {
echo “

” ;}

$auditionQ = $row[“AuditionQuestions”];
if (strpos($auditionQ, “@”) !== false ) {
echo “

” ;
}
elseif (strpos($auditionQ, “www.”) !== false) {
echo “

” ;
}
else {
if ($auditionQ <> “”) {
echo “

” ;
}
}

if ($row[“Type”] == “Appointment”) {
echo “

” ;}

if ($row[“ShowNote”] <> “” ) {
echo “

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

” . “Show” . “ ” . $row[“ShowName”] . “
” . “Company” . “ ” . $row[“Company”] . “
” . “Director” . “ ” . $row[“Director”] . “
” . “Musical Director” . “ ” . $row[“MusicalDirector”] . “
” . “Choreographer” . “ ” . $row[“Choreographer”] . “
” . “Producer” . “ ” . $row[“Producer”] . “
” . “Notes” . “ ” . $row[“ProductionNotes”] . “
” . “Instructions” . “ ” .
$row[“AuditionInstructions”] . “
” . “Rehearsal Dates” . “ ” . $row[“RehearsalDates”] . “
” . “Performance Dates” . “ ” . $row[“Times”] . “
” . “Questions” . “ ” . “Send Mail“. “
” . “Questions” . “ ” . “Check Online” . “
” . “Questions” . “ ” . $row[“AuditionQuestions”] . “
” . “Submissions” . “ ” . $row[“Submissions”] . “
” . “Show Info” . “ ” . $row[“ShowNote”] . “

“;

$mysqli->close();

// Audition Times ************************************************************************

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’);

$sql = “SELECT AuditionType, AuditionDate, AuditionTime, AuditionEndTime, AuditionLocation, AuditionAddress,
AuditionTown
from `AuditionDates`
where Production = $parm1
order by AuditionDate, AuditionTime “;

$result = $mysqli->query($sql);
$oldloc = “aaaa”;
$oldphase = “aaaa”;
if ($result->num_rows > 0) {
echo ”

Auditon Location/Date/Times

“;
echo “

“;

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

// output data of each row

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

$time = $row[“AuditionTime”];
$d = new DateTime($time);
$timef = $d->format( ‘g:i A’ );
if ($timef == “12:00 AM”) {
$timef = “TBD”;
}
$endtime = $row[“AuditionEndTime”];
$d = new DateTime($endtime);
$timeendf = $d->format( ‘g:i A’ );
if ($timeendf <> “12:00 AM”) {
$timef = $timef . ” – ” . $timeendf ;
}

$newloc = $row[“AuditionLocation”] . $row[“AuditionAddress”] . $row[“AuditionTown”];
$newtype = $row[“AuditionType”];

if ($newtype == “oldtype”) {
echo “

“;
} else {
echo “

“;
}
if ($newloc == “oldloc”) {
echo “

” .

” .

“;
} else {
echo “

” ;
echo “

” .

“;
}
$oldloc = $newloc;
$oldtype = $newtype;

}
} else {

}
echo “

” .
“Type” . “
” .
“Location” . “
” .
“Date” . “
” .
“Time” . “
” . “
” . $row[“AuditionType”]. “ ” . “ ” . $datef . “ ” . $timef . “
” . $row[“AuditionLocation”] ;
if ($row[“AuditionAddress”] <> “”) {echo “
” . $row[“AuditionAddress”] ;}
if ($row[“AuditionTown”] <> “”) {echo “
” . $row[“AuditionTown”] ;}
echo “
” . $datef . “ ” . $timef . “

“;

$mysqli->close();

// Audition Roles *********************************************************************
//Roles *******************************************************************

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

$sql = “SELECT Role, RoleType, Gender, AgeMin, AgeMax, Ethnicity, Description, Requirement, SongstoKnow
from `AuditionRoles`
where Production = $parm1 order by (CASE
when RoleType = ‘Lead’ then 1
when RoleType = ‘Major’ then 2
when RoleType = ‘Supporting’ then 3
when RoleType = ‘Featured’ then 4
when RoleType = ‘Featured’ then 5
when RoleType = ‘Chorus/Ensemble’ then 6
when RoleType = ‘Ensemble’ then 7 End), ID, Role”;

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

if ($result->num_rows > 0) {
echo ”

Roles

“;
echo “

“;
echo “

“;

echo “

“;

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

// output data of each row

$agemin = $row[“AgeMin”];
$agemax = $row[“AgeMax”];
if($row[“AgeMin”] == “1”) {$agemin = “”;}
if($row[“AgeMax”] == “99”) {$agemax = “”;}

$ages = $agemin . “-” . $agemax;
if ($agemin == “”) {$ages= $agemax ;}
if ($agemax == “”) {$ages= $agemin . “+”;}
if ($agemin == “” and $agemax ==””) {$ages = “”;}
if ($agemax == $agemin) {$ages = $agemin;}

$desc = $row[“Description”] ;
if ($row[“Ethnicity”] <> “”) {$desc = “(” . $row[“Ethnicity”] . “) ” . $desc ;}
if ($row[“Requirement”] <> “”) {$desc = $desc . “
” . $row[“Requirement”] . ““;}
if ($row[“SongstoKnow”] <> “”) {$desc = $desc . “
Songs to Know – ” . $row[“SongstoKnow”];}

$role = $row[“Role”] ;
if ($row[“RoleType”] <> “”) {
$role = $role . ” (” . $row[“RoleType”] . “)” ;
}
echo “

” .

” .

” .

” ;
}
} else {

}
echo “

” .
“Role” . “
” .
“M/F” . “
” .
“Age” . “
” .
“Description” . “
” . $role . “ ” . $row[“Gender”]. “ ” . $ages . “ ” . $desc . “

“;

$mysqli->close();

$linktext = “http://www.lictc.org/audition-details/?parm1=” . $parm2 ;
//$mailtext = “window.location.href=’mailto:?subject=Here\’s an audition you might be interested //in&body=Showname:%09” . “showname” . “%0D%0ACompany:%09” . $companyorig . “%0D%0AAuditons:%09%09” . //$dates . “%0D%0A%0D%0AMore info:%09” . “linktext” . “%0D%0A%0D%0AGood Luck!” . “‘” ;

$mailtext = “window.location.href=’mailto:?subject=Here\’s an audition you might be interested in&body=Showname:%09” . “$showname” . “%0D%0ACompany:%09” . $companyorig . “%0D%0AAuditons:%09%09” . $dates . “%0D%0A%0D%0AMore info:%09” . “$linktext” . “%0D%0A%0D%0AGood Luck!”. “‘” ;

echo ““;
echo str_repeat(‘ ‘, 5);

echo ““;

[/insert_php]