| Server IP : 104.21.21.239 / Your IP : 216.73.216.68 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/banners/domains/stagemag/ |
Upload File : |
<?php
/**
* programeditfill.php – Pre-fill a production from the prefill catalog
* Converted from programeditfill.php
*/
/* ── Partner gate: not logged in + partner → register page ── */
require_once __DIR__ . '/functions.php';
init_session();
$partner = $_GET['partner'] ?? $_POST['partner'] ?? '';
if (!isset($_SESSION['member']) && $partner === 'MTI') {
header('Location: /newmain-register-login.php?partner=MTI');
exit;
}
if (!isset($_SESSION['member']) && $partner === 'Concord') {
header('Location: /newmain-register-login.php?partner=Concord');
exit;
}
include __DIR__ . '/header.php';
?>
<div id="content">
<div class="container-fluid">
<?php
/* ── Video-allowed IDs for JS toggle ── */
$stmtVideo = db_read()->prepare("SELECT id FROM stagemag.prefill WHERE videoallowed > 0");
$stmtVideo->execute();
$hasvideoRows = $stmtVideo->fetchAll();
?>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
<script>
function showField(value) {
console.log(value);
var field = document.getElementById("additional-field");
field.style.display = (<?php
$parts = [];
foreach ($hasvideoRows as $i => $vr) {
$parts[] = 'value === "' . (int)$vr['id'] . '"';
}
echo implode(' || ', $parts);
?>) ? "block" : "none";
}
</script>
<?php
/* ==================================================================
POST-BACK: save prefill data into the production
================================================================== */
if (isset($_GET['editsaveclient'])):
$editsaveclient = (int)$_GET['editsaveclient'];
$showname = (int)$_POST['showname'];
$stmtStuff = db_read()->prepare("SELECT * FROM stagemag.prefill WHERE id = :id");
$stmtStuff->execute([':id' => $showname]);
$getstuff = $stmtStuff->fetch();
if (!$getstuff) {
echo '<p>Production not found.</p>';
include __DIR__ . '/footer.php';
exit;
}
/* ── Build specialcredits HTML (title page) ── */
ob_start();
?>
<table style="max-width:600px;width:100%" width="">
<tbody>
<?php if (empty($getstuff['creditshtml'])): ?>
<tr>
<td colspan="3"><center><h1><?= htmlspecialchars($getstuff['Title']) ?></h1></center></td>
</tr>
<tr><td colspan="3"> </td></tr>
<tr><td colspan="3"><center>at</center></td></tr>
<tr><td colspan="3"> </td></tr>
<tr><td colspan="3"> </td></tr>
<tr>
<td colspan="3"><center><?= nl2br(htmlspecialchars($getstuff['BillingCredits'])) ?></center></td>
</tr>
<?php else: ?>
<tr>
<td colspan="3"><center>
<?php
$newhtml = $getstuff['creditshtml'];
$newhtml = preg_replace('/class="rider-text__100"/i', 'class="rider-text__100" style="font-size:30pt;"', $newhtml);
$newhtml = preg_replace('/class="rider-text__75"/i', 'class="rider-text__75" style="font-size:22pt;"', $newhtml);
$newhtml = preg_replace('/class="rider-text__66"/i', 'class="rider-text__66" style="font-size:18pt;"', $newhtml);
$newhtml = preg_replace('/class="rider-text__50"/i', 'class="rider-text__50" style="font-size:15pt;"', $newhtml);
$newhtml = preg_replace('/class="rider-text__30"/i', 'class="rider-text__30" style="font-size:12pt;"', $newhtml);
$newhtml = preg_replace('/class="rider-text__25"/i', 'class="rider-text__25" style="font-size:11pt;"', $newhtml);
$newhtml = preg_replace('/<div class="rider-text__100" style="font-size:30pt;"> <\/div>/i', '', $newhtml);
$newhtml = str_ireplace('<td>', '<td><center>', $newhtml);
$newhtml = str_ireplace('</td>', '</center></td>', $newhtml);
$newhtml = str_ireplace('<p>', '<p style="text-align:center;">', $newhtml);
echo $newhtml;
?>
</center></td>
</tr>
<tr><td colspan="3"> </td></tr>
<tr><td colspan="3"> </td></tr>
<?php endif; ?>
<tr><td colspan="3"> </td></tr>
<tr><td colspan="3"><center>Starring</center></td></tr>
<tr><td colspan="3"> </td></tr>
<tr>
<td style="width:33%" width="33%"><center>Actors<br />Actors<br />Actors</center></td>
<td style="width:33%" width="33%"><center>Actors<br />Actors<br />Actors</center></td>
<td style="width:33%" width="33%"><center>Actors<br />Actors<br />Actors</center></td>
</tr>
<tr><td colspan="3"> </td></tr>
<?php if (empty($getstuff['creditshtml'])): ?>
<tr><td colspan="3"><?= $getstuff['SpecialBilling'] ?></td></tr>
<?php endif; ?>
<?php if (!empty($getstuff['BillingCredits'])): ?>
<tr>
<td colspan="3"><center><?= nl2br(htmlspecialchars($getstuff['BillingCredits'])) ?></center></td>
</tr>
<?php endif; ?>
<tr><td colspan="3"> </td></tr>
<?php if (empty($getstuff['creditshtml']) || $partner === 'Concord'): ?>
<br><br>
<center>
<?php
if (stripos($partner, 'concord') !== false) {
$clearme = preg_replace('/www\.concordtheatricals\./i',
'<a href="https://www.concordtheatricals.com/">www.concordtheatricals.</a>',
$getstuff['Clearances']);
$clearme = preg_replace('/Concord Theatricals/i',
'<a href="https://www.concordtheatricals.com/">Concord Theatricals</a>',
$clearme);
} else {
$clearme = $getstuff['Clearances'];
}
echo $clearme;
?>
</center>
<?php endif; ?>
<div style="font-size:10pt;">
<?php
$videolicense = $_POST['videolicense'] ?? '';
$vlNoVideo = ($getstuff['videolicense'] === 'No video license');
$vlHasLicense = !$vlNoVideo;
$formHasVL = isset($_POST['videolicense']);
$formVLNone = ($videolicense === 'None');
$isDisneyYes = ($getstuff['isdisney'] === 'Yes');
if ($vlNoVideo) {
echo 'The videotaping or other video or audio recording of this production is strictly prohibited.';
} elseif ($vlHasLicense && $formHasVL && !$formVLNone && $isDisneyYes) {
echo 'ANY VIDEO RECORDING MADE OF THIS PERFORMANCE IS AUTHORIZED FOR PERSONAL, AT-HOME, NON-COMMERCIAL USE ONLY. THE SALE OR DISTRIBUTION OF SUCH RECORDING IS STRICTLY PROHIBITED UNDER FEDERAL COPYRIGHT LAW.';
} elseif ($vlHasLicense && $formHasVL && $formVLNone && $isDisneyYes) {
echo 'The videotaping or other video or audio recording of this production is strictly prohibited';
} elseif ($vlHasLicense && $formHasVL && !$formVLNone && !$isDisneyYes) {
echo 'ANY VIDEO RECORDING MADE OF THIS PERFORMANCE IS AUTHORIZED FOR PERSONAL, AT-HOME, NON-COMMERCIAL USE ONLY. THE SALE OR DISTRIBUTION OF SUCH RECORDING IS STRICTLY PROHIBITED UNDER FEDERAL COPYRIGHT LAW.';
} elseif ($vlHasLicense && $formHasVL && $formVLNone && !$isDisneyYes) {
echo 'The videotaping or other video or audio recording of this production is strictly prohibited';
}
if ((int)$getstuff['mtiid'] > 0): ?>
<br><br>
<?= htmlspecialchars($getstuff['Title'] ?? '') ?> Is presented through special arrangement with Music Theatre International (MTI). </br>All authorized performance materials are also supplied by MTI. <br/><a href="https://www.mtishows.com">www.mtishows.com</a>
<?php endif; ?>
</div>
<?php
/* capture the title-page HTML */
$specialcredits = ob_get_clean();
/* ── end specialcredits ── */
/* ── Alert for special billing requiring bios (Concord titles, etc.) ── */
if (stripos($getstuff['SpecialBilling'] ?? '', 'bio') !== false
&& ($getstuff['Licensing'] === 'Concord'
|| stripos($getstuff['Title'], 'Murder on the Orient Express') !== false
|| stripos($getstuff['Title'], 'Evita') !== false
|| stripos($getstuff['Title'], 'Jesus Christ') !== false
|| stripos($getstuff['Title'], 'Joseph') !== false
|| stripos($getstuff['Title'], 'Ken Ludwig') !== false
|| stripos($getstuff['Title'], 'School of Rock') !== false
|| stripos($getstuff['Title'], 'Witness for the Prosecution') !== false
)
) {
$stmtAlert = db_write()->prepare(
"UPDATE stagemag.productions SET alert = 1, alertmessage = :msg WHERE id = :id"
);
$stmtAlert->execute([
':msg' => $getstuff['SpecialBilling'],
':id' => $editsaveclient,
]);
}
/* ── Update production with prefill data ── */
$extrabio = str_replace("\r\n", '<br>', $getstuff['AuthorBio'] ?? '');
$extrabio = str_replace("\n", '<br>', $extrabio);
$stmtUpdProd = db_write()->prepare(
"UPDATE stagemag.productions
SET productionname = :title,
extrabio = :extrabio,
titlepage = :titlepage
WHERE id = :id"
);
$stmtUpdProd->execute([
':title' => $getstuff['Title'] ?? '',
':extrabio' => $extrabio,
':titlepage' => $specialcredits,
':id' => $editsaveclient,
]);
/* ── Song list ── */
if (!empty($getstuff['SongList'])) {
if (in_array($getstuff['Licensing'], ['MTI', 'Concord', 'ConcordNew'], true)) {
$songlist = str_replace(["\r\n", "\n\r", "\n", "\r"], '<br />', $getstuff['SongList']);
} else {
$songlist = nl2br(htmlspecialchars($getstuff['SongList']));
}
$stmtSong = db_write()->prepare(
"UPDATE stagemag.productions
SET songlisttitle = 'Song List', songlist = :sl
WHERE id = :id"
);
$stmtSong->execute([':sl' => $songlist, ':id' => $editsaveclient]);
}
/* ── Character list → cast rows ── */
if (!empty($getstuff['CharacterList'])) {
$lines = preg_split("/\r\n|\n|\r/", $getstuff['CharacterList']);
foreach ($lines as $line) {
$line = trim($line);
if ($line === '') continue;
$stmtOrd = db_write()->prepare(
"SELECT ordernum FROM stagemag.cast
WHERE programid = :pid AND typer = 1
ORDER BY ordernum DESC LIMIT 1"
);
$stmtOrd->execute([':pid' => $editsaveclient]);
$ordRow = $stmtOrd->fetch();
$newordernum = $ordRow ? (int)$ordRow['ordernum'] : 1;
$stmtCast = db_write()->prepare(
"INSERT INTO stagemag.cast (programid, ordernum, typer, name, role)
VALUES (:pid, :ord, 1, 'Name', :role)"
);
$stmtCast->execute([
':pid' => $editsaveclient,
':ord' => $newordernum,
':role' => $line,
]);
}
}
/* ── Advertising opt-in email ── */
if (isset($_POST['advertise']) && strtolower($_POST['advertise']) === 'on') {
// Note: email sending requires a mail library (PHPMailer, etc.)
// The original used <cfmail>. Placeholder for mail integration:
$stmtGetme = db_read()->prepare(
"SELECT email, fname, lname FROM bway_bww.starusers WHERE id = :uid"
);
$stmtGetme->execute([':uid' => $getuser['id']]);
$getme = $stmtGetme->fetch();
// TODO: implement mail sending with PHPMailer or similar
// Original sent to: $getme['email'], [email protected]
// Subject: "Stage Mag Partner Advertising Request"
}
/* ── Redirect to editor ── */
header('Location: https://stagemag.broadwayworld.com/programedit.php?programid=' . $editsaveclient);
exit;
endif; // editsaveclient
?>
<div style="clear: both;"></div>
<br>
<?php
/* ==================================================================
No programid and no fill → create a new blank production, redirect
================================================================== */
if (!isset($_GET['programid']) && !isset($_GET['fill'])):
$stmtNew = db_write()->prepare(
"INSERT INTO stagemag.productions (userid) VALUES (:uid)"
);
$stmtNew->execute([':uid' => $getuser['id']]);
$newId = db_write()->lastInsertId();
$partnerParam = !empty($partner) ? '&partner=' . urlencode($partner) : '';
header('Location: /programeditfill.php?fill=' . $newId . $partnerParam, true, 301);
exit;
endif;
?>
<center>
<?php if ($partner === 'Playscripts'): ?>
<img src="https://cloudimages.broadwayworld.com/stagemag/Playscripts.png" style='max-width:600px;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with Playscripts to offer exclusive Digital Marketing packages to suit your needs, along with Stage Mag. Get started below and set up your production!</div></p>
<?php elseif ($partner === 'BroadwayLicensing'): ?>
<img src="https://cloudimages.broadwayworld.com/stagemag/BroadwayLicensing.png" style='max-width:600px;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with Playscripts to offer exclusive Digital Marketing packages to suit your needs, along with Stage Mag. Get started below and set up your production!</div></p>
<?php elseif ($partner === 'BoD'): ?>
<img src="https://cloudimages.broadwayworld.com/stagemag/BoD.png" style='max-width:600px;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with Broadway on Demand to offer exclusive Digital Marketing packages to suit your needs, along with Stage Mag. Get started below and set up your production!</div></p>
<?php elseif ($partner === 'Concord'): ?>
<img src="https://cloudimages.broadwayworld.com/ConcordTheatricals-Lockup-Aubergine.jpg" style='max-width:600px;border-width:1px;border-style:solid;border-color:black;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with Concord Theatricals to offer pre-filled Stage Mag's. Get started below and set up your production!</div></p>
<?php elseif ($partner === 'ConcordNew'): ?>
<img src="https://cloudimages.broadwayworld.com/ConcordTheatricals-Lockup-Aubergine.jpg" style='max-width:600px;border-width:1px;border-style:solid;border-color:black;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with Concord Theatricals to offer pre-filled Stage Mag's. Get started below and set up your production!</div></p>
<?php elseif ($partner === 'MTI'): ?>
<img src="https://cloudimages.broadwayworld.com/MTI_Logo_Horizontal.png" style='max-width:600px;'>
<p><div style="font-weight:bold;max-width:600px">BroadwayWorld is proud to partner with MTI to offer pre-filled Stage Mag's. Get started below and set up your production!</div></p>
<?php endif; ?>
<br>
<?php if ($partner === 'BoD'): ?>
<a href="https://stagemag.broadwayworld.com/programedit.php?programid=<?= (int)($_GET['fill'] ?? 0) ?>">Click Here to Get Started</a>
<br><br>
<?php else: ?>
<?php
$fill = (int)($_GET['fill'] ?? $_GET['programid'] ?? 0);
$actionUrl = 'programeditfill.php?editsaveclient=' . $fill;
if (!empty($partner)) $actionUrl .= '&partner=' . urlencode($partner);
?>
<form action="<?= htmlspecialchars($actionUrl) ?>" method="post" enctype="multipart/form-data">
<table style="max-width:600px;"><tr><td style="width: 50%;vertical-align: top;">
<div class="form-group">
<label class="col-md-12" style="margin-top: 10px;">To Get Started, Select a Production </label>
<div class="col-md-12">
<select name="showname" class="js-example-basic-single" onchange="showField(this.value)" style="max-width:350px;">
<?php
/* ── Build prefill dropdown filtered by partner ── */
$whereClauses = ['title <> :empty'];
$params = [':empty' => ''];
$partnerMap = [
'Playscripts' => 'Playscripts',
'BroadwayLicensing' => 'Broadway Licensing',
'Concord' => 'Concord',
'Concordnew' => 'Concordnew',
'MTI' => 'MTI',
'DPS' => 'Dramatists Play Service',
'TRW' => 'TRW',
];
if (isset($partnerMap[$partner])) {
$whereClauses[] = 'licensing = :lic';
$params[':lic'] = $partnerMap[$partner];
}
if ($partner === 'TRW') {
$whereClauses[] = 'id > 1141';
}
$sql = "SELECT * FROM stagemag.prefill WHERE " . implode(' AND ', $whereClauses) . " ORDER BY title";
$stmtProds = db_read()->prepare($sql);
$stmtProds->execute($params);
$getprods = $stmtProds->fetchAll();
foreach ($getprods as $prod): ?>
<option value="<?= (int)$prod['id'] ?>"><?= htmlspecialchars($prod['Title'] ?? '') ?></option>
<?php endforeach; ?>
</select>
<div id="additional-field" style="display:none">
<?php if ($partner === 'MTI'): ?>
<br><br>
Did you purchase a video license?
<select name="videolicense">
<option value="None">None</option>
<option value="Yes">Yes</option>
</select>
<?php endif; ?>
</div>
</div>
<br>
<span style="font-size:12pt;"><input style="opacity:100;position:relative;left:0px;" name="advertise" type="checkbox" <?php if (!isset($getuser['id']) || (int)$getuser['id'] !== 26): ?>checked<?php endif; ?>> Please send me advertising options for this production.</span><br>
<?php if ($partner === 'MTI' || $partner === 'Concord'): ?>
<br>
<label>Is anyone in the show under the age of 18?</label>
<select id="under18" name="under18" required onchange="showSecondQuestion()">
<option value="" disabled selected>Select an option</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<br><br>
<div id="secondQuestion" style="display:none;">
<input id="under182" style="opacity:100;position:relative;left:0px;" name="under182" type="checkbox"> I agree that all necessary permissions and waivers have been acquired for any information or photos showing anyone under 18.
<br><br>
</div>
<input style="opacity:100;position:relative;left:0px;" required name="license" type="checkbox"> Our producing organization has obtained a valid performance license from <?= htmlspecialchars($partner) ?>.
<?php if ($partner === 'Concord'): ?>
<p></p>Please remember: Your organization is responsible for ensuring that your program meets the requirements outlined in your licensing agreement. Be sure to consult your contract to confirm you are in compliance.
<?php endif; ?>
<br>
<script>
function showSecondQuestion() {
var under18Value = document.getElementById("under18").value;
var under182Checkbox = document.getElementById("under182");
if (under18Value === "yes") {
document.getElementById("secondQuestion").style.display = "block";
under182Checkbox.required = true;
} else {
document.getElementById("secondQuestion").style.display = "none";
under182Checkbox.required = false;
}
}
</script>
<?php endif; ?>
<br>
<?php if (isset($_SESSION['email']) && $_SESSION['email'] !== '-1'): ?>
<input type="submit" value="Make My Stage Mag" class="btn btn-success" style="font: bold 18px;color:white;background-color:black;" name="buttarticleman" id="cdh_update_article">
<?php else: ?>
If you need a BroadwayWorld account, it's free and takes 30 seconds to register. <a href="https://stagemag.broadwayworld.com/register.php">Click Here</a> to signup.
<?php endif; ?>
</center>
<br>
</form>
<?php endif; /* end BoD else */ ?>
<br>
To get started on your marketing plan, <a href="mailto:[email protected]?Subject=Partner Advertising <?= htmlspecialchars($getuser['email']) ?>">email Alex</a> today!
<?php if ($partner === 'BroadwayLicensing'): ?>
<iframe src="https://cloudimages.broadwayworld.com/stagemag/BroadwayLicensing2.pdf" style='width:800px;height:800px'></iframe>
<?php elseif (strtolower($partner) === 'bod'): ?>
<iframe src="https://cloudimages.broadwayworld.com/stagemag/BoD2.pdf" style='width:800px;height:800px'></iframe>
<?php elseif ($partner === 'Playscripts'): ?>
<iframe src="https://cloudimages.broadwayworld.com/stagemag/Playscripts2.pdf" style='width:800px;height:800px'></iframe>
<?php endif; ?>
</div>
<!--Footer-part-->
<br><br><br><br>
<script type="text/javascript">
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
</script>
<?php include __DIR__ . '/footer.php'; ?>