| Server IP : 172.67.201.108 / 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
include 'header.php';
set_time_limit(600);
$programid = resolve_programid();
require_program_access($programid, $getuser);
$submit = $_GET['submit'] ?? '';
?>
<div id="content" style="max-width: 800px;">
<div id="content-header">
<h2> Bulk Add Creative Team Members</h2>
</div>
<div class="container-fluid">
<br>
<?php if (isset($_SESSION['email']) && $_SESSION['email'] !== '-1'): ?>
<?php
// Query to get the last ordernum for this program
$stmt = db_write()->prepare("SELECT ordernum FROM stagemag.cast WHERE programid = ? AND typer = 2 ORDER BY ordernum DESC LIMIT 1");
$stmt->execute([$programid]);
$getordernum = $stmt->fetch();
// If form submitted
if ($submit === 'on') {
$newordernum = (!$getordernum) ? 1 : $getordernum['ordernum'] + 1;
for ($i = 1; $i <= 20; $i++) {
$name = trim($_POST['name' . $i] ?? '');
$role = trim($_POST['role' . $i] ?? '');
$bio = $_POST['bio' . $i] ?? '';
if (strlen($name) && strlen($role)) {
$ins = db_write()->prepare("INSERT INTO stagemag.cast (programid, ordernum, typer, name, role, bio) VALUES (?, ?, 2, ?, ?, ?)");
$ins->execute([$programid, $newordernum, $name, $role, $bio]);
$newordernum++;
}
}
header('Location: /programedit-cast.php?programid=' . urlencode($programid) . '&typer=2');
exit;
}
?>
<style>
.cast-form div { margin-bottom: 10px; }
.cast-form input[type="text"] { width: 100%; margin-right: 10px; }
.cast-form textarea { width: 100%; vertical-align: top; }
</style>
<center>
<form class="cast-form" action="programedit-creative-bulk.php?programid=<?= urlencode($programid) ?>&submit=on" method="post">
<table style="width:100%">
<?php for ($i = 1; $i <= 20; $i++): ?>
<tr<?= ($i % 2 === 1) ? ' style="background-color:#efefef;"' : '' ?>>
<td style="padding:4px;width:25%;<?= ($i % 2 === 1) ? 'background-color:#efefef;' : '' ?>">
<input type="text" name="name<?= $i ?>" id="name<?= $i ?>" placeholder="Name" class="form-control">
</td>
<td style="padding:4px;width:25%;<?= ($i % 2 === 1) ? 'background-color:#efefef;' : '' ?>">
<input type="text" name="role<?= $i ?>" id="role<?= $i ?>" placeholder="Position" class="form-control">
</td>
<td style="padding:10px;width:50%;<?= ($i % 2 === 1) ? 'background-color:#efefef;' : '' ?>">
<textarea name="bio<?= $i ?>" class="form-control" id="bio<?= $i ?>" placeholder="Bio (Optional)"></textarea>
</td>
</tr>
<?php endfor; ?>
</table>
<input type="submit" value="Add Creative Team Members">
</form></center><br><br>
<?php endif; ?>
<br>
</div>
<!-- Right Sidebar Start -->
<?php include 'footer.php'; ?>