| Server IP : 104.21.21.239 / Your IP : 216.73.216.191 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
include 'header.php';
require_once __DIR__ . '/email.php';
set_time_limit(600);
$programid = resolve_programid();
require_program_access($programid, $getuser);
?>
<style>
.feature-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.feature-card-header { background: linear-gradient(135deg, #b20223 0%, #8a011a 100%); color: #fff; padding: 12px 20px; border-radius: 7px 7px 0 0; font-size: 18px; font-weight: 600; }
.feature-card-body { padding: 20px; }
.feature-card-body p { color: #555; margin-bottom: 15px; line-height: 1.5; }
.feature-card-body label { font-weight: 600; color: #333; display: block; margin-bottom: 5px; }
.feature-row { margin-bottom: 15px; }
.feature-row:last-child { margin-bottom: 0; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { background: #f5f5f5; padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid #e0e0e0; }
.user-table td { padding: 10px 12px; border-bottom: 1px solid #eee; }
.user-table tr:hover { background: #fafafa; }
.btn-delete { color: #c00; text-decoration: none; font-size: 13px; }
.btn-delete:hover { text-decoration: underline; }
.input-email { padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; width: 100%; max-width: 350px; }
.btn-add { background-color: #b20223; color: white; border: none; padding: 10px 20px; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn-add:hover { background-color: #8a011a; }
</style>
<div id="content" style="max-width: 800px;">
<div id="content-header">
<h2> Manage Users</h2>
</div>
<div class="container-fluid">
<?php
if (isset($_GET['delete'])) {
$stmt = db_write()->prepare("DELETE FROM stagemag.additionalusers WHERE id = ?");
$stmt->execute([intval($_GET['delete'])]);
}
if (isset($_GET['add'])) {
$email = $_POST['email'] ?? '';
$stmt = db_write()->prepare("INSERT INTO stagemag.additionalusers (programid, email) VALUES (?, ?)");
$stmt->execute([$programid, $email]);
$stmt = db_read()->prepare("SELECT * FROM stagemag.productions WHERE id = ?");
$stmt->execute([$programid]);
$getmag = $stmt->fetch();
$subject = 'Stage Mag Invitation - ' . $getmag['productionname'];
$body = "You've been invited to edit a BroadwayWorld Stage Mag for " . htmlspecialchars($getmag['productionname']) . ". "
. "<p></p>"
. 'If you have a BroadwayWorld account, <A href="https://stagemag.broadwayworld.com">Click Here</A> to login. '
. "<p></p>"
. '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. ';
send_email($email, $subject, $body, '[email protected]', true);
header('Location: /programedit-users.php?programid=' . urlencode($programid));
exit;
}
$stmt = db_write()->prepare("SELECT * FROM stagemag.additionalusers WHERE programid = ?");
$stmt->execute([$programid]);
$getcasta = $stmt->fetchAll();
?>
<?php if (count($getcasta) > 0): ?>
<div class="feature-card">
<div class="feature-card-header">Current Users</div>
<div class="feature-card-body">
<table class="user-table">
<tr><th>Email Address</th><th style="width: 80px;">Action</th></tr>
<?php foreach ($getcasta as $row): ?>
<tr id="section_id_<?= $row['id'] ?>">
<td><?= htmlspecialchars($row['email']) ?></td>
<td><a href="programedit-users.php?delete=<?= $row['id'] ?>&programid=<?= $programid ?>" class="btn-delete" onclick="return confirm('Remove this user?')">Remove</a></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>
<?php endif; ?>
<div class="feature-card">
<div class="feature-card-header">Add New User</div>
<div class="feature-card-body">
<p>Want to give access to others on your team to make edits to your Stage Mag? You can add as many users as you want.</p>
<p style="font-size: 13px; color: #666;">If they already have a BWW account, they'll be ready to go right away. If they need one, they'll be invited to register (free and takes under 30 seconds).</p>
<form id="frm-sort" action="/programedit-users.php?programid=<?= $programid ?>&add=on" method="post">
<div class="feature-row">
<label>Email Address:</label>
<input name="email" required type="email" class="input-email" placeholder="Enter email address">
</div>
<input type="hidden" name="sort_order" id="sort_order" value="" />
<button type="submit" name="save" class="btn-add">Add User</button>
</form>
</div>
</div>
</div>
<!--Footer-part-->
<br><br><br><br>
<?php include 'footer.php'; ?>