403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.11
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/banners/domains/stagemag/programedit-titlepage.php
<?php
include 'header.php';
set_time_limit(600);

$programid = resolve_programid();
require_program_access($programid, $getuser);
$imagepath = '/home/banners/domains/stagemag/temp';
?>

<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-card-body select, .feature-card-body input[type="text"] { padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.feature-row { margin-bottom: 20px; }
.feature-row:last-child { margin-bottom: 0; }
.btn-save { background-color: #b20223; color: white; border: none; padding: 12px 30px; border-radius: 4px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-save:hover { background-color: #8a011a; }
.current-image { border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px; background: #f9f9f9; display: inline-block; }
.current-image img { max-height: 150px; border-radius: 4px; }
.color-picker-row { display: flex; gap: 30px; flex-wrap: wrap; }
.color-picker-row > div { flex: 1; min-width: 200px; }
</style>

<div id="content" style="max-width: 800px;">
  <div id="content-header">
    <h2>&nbsp;Edit Title Page</h2>
  </div>
  <div class="container-fluid">

<?php
// Handle crop callback
if (isset($_GET['crop'])) {
    $crop     = $_GET['crop'];
    $filename = $_GET['filename'] ?? $crop;
    $srcFile  = $imagepath . '/1000-' . strtolower($filename);

    $stmt = db_read()->prepare("SELECT id FROM stagemag.productions WHERE image = ?");
    $stmt->execute([$crop]);
    $getprogram = $stmt->fetch();

    if (file_exists($srcFile)) {
        copy($srcFile, $imagepath . '/' . $crop);
        copy($srcFile, $imagepath . '/nd' . $crop);

        $r1 = s3_upload($imagepath . '/' . $crop, 'stagemag/' . $crop);
        $r2 = s3_upload($imagepath . '/nd' . $crop, 'stagemag/nd' . $crop);
        @unlink($imagepath . '/' . $crop);
        @unlink($imagepath . '/nd' . $crop);
    } else {
        error_log("CROP CALLBACK: ERROR - source file not found: $srcFile");
    }

    header('Location: https://stagemag.broadwayworld.com/programedit-titlepage.php?programid=' . ($getprogram['id'] ?? $programid));
    exit;
}

// Copyright check
if (isset($_POST['copyright']) && $_POST['copyright'] !== 'On') {
    echo 'Error, you must agree to the copyright conditions to use this service. <A HREF="javascript:history.back()">Go back</A>';
    echo '</div><br><br><br><br>';
    include 'footer.php';
    exit;
}

// Save title page settings
if (isset($_GET['editsaveclient'])) {
    $editsaveclient = intval($_GET['editsaveclient']);
    $logotype  = $_POST['logotype'] ?? 'Regular - White';
    $titlepage = $_POST['titlepage'] ?? '';
    $bghex     = $_POST['bghex'] ?? '';
    $headerhex = $_POST['headerhex'] ?? '';

    $stmt = db_write()->prepare("UPDATE stagemag.productions SET logotype = ?, titlepage = ?, bghex = ?, headerhex = ? WHERE id = ?");
    $stmt->execute([$logotype, $titlepage, $bghex, $headerhex, $editsaveclient]);

    // Photo upload
    $uploadExt = isset($_FILES['photo']) ? validate_image_upload($_FILES['photo']) : null;
    if (isset($_FILES['photo']) && $_FILES['photo']['error'] === UPLOAD_ERR_OK && $_FILES['photo']['name'] !== '' && $uploadExt === null) {
        echo '<h3>Invalid image file type. Only JPEG, PNG, or WEBP are accepted.<br><a href="javascript:history.back()">Go back</a></h3>';
        exit;
    }
    if ($uploadExt !== null) {
        $ext = $uploadExt;

        $finalName = 'a' . uniqid() . '-' . bin2hex(random_bytes(4)) . '.' . $ext;
        move_uploaded_file($_FILES['photo']['tmp_name'], $imagepath . '/' . $finalName);
        $photo = $finalName;

        // Convert PNG to JPG
        if (strpos($photo, '.png') !== false) {
            $anphoto = preg_replace('/\.png$/i', '.jpg', $photo);
            $img = imagecreatefrompng($imagepath . '/' . $photo);
            imagejpeg($img, $imagepath . '/b' . $anphoto, 100);
            imagedestroy($img);
            rename($imagepath . '/b' . $anphoto, $imagepath . '/' . $anphoto);
            $photo = $anphoto;
        }

        $imgSize = getimagesize($imagepath . '/' . $photo);
        $width  = $imgSize[0];
        $height = $imgSize[1];

        // Resize thumbnail
        try {
            graphicsmagick('ResizeWidth', $imagepath . '/' . $photo, $imagepath . '/nda' . $photo, ['width' => 300, 'quality' => 100]);
        } catch (Exception $e) {
            copy($imagepath . '/' . $photo, $imagepath . '/nda' . $photo);
        }

        // Resize if too small
        if (($height < 1000 || $width < 1000) && strpos($photo, 'gif') === false) {
            graphicsmagick('ResizeHeight', $imagepath . '/' . $photo, $imagepath . '/' . $photo, ['height' => 1000, 'filter' => 'Catrom', 'quality' => 100]);
            $imgSize = getimagesize($imagepath . '/' . $photo);
            $height = $imgSize[1];
            $width  = $imgSize[0];
        }

        // Resize if too big
        if (($height > 5000 || $width > 5000) && strpos($photo, 'gif') === false) {
            graphicsmagick('ResizeHeight', $imagepath . '/' . $photo, $imagepath . '/' . $photo, ['height' => 1000, 'filter' => 'Catrom', 'quality' => 100]);
            $imgSize = getimagesize($imagepath . '/' . $photo);
            $height = $imgSize[1];
            $width  = $imgSize[0];
        }

        $stmt = db_write()->prepare("UPDATE stagemag.productions SET image = ?, imageheight = ?, imagewidth = ? WHERE id = ?");
        $stmt->execute([$photo, $height, $width, $editsaveclient]);

        if (strpos($photo, '.gif') !== false) {
            copy($imagepath . '/' . $photo, $imagepath . '/1000-' . $photo);
            header('Location: https://stagemag.broadwayworld.com/programedit-titlepage.php?crop=' . urlencode($photo) . '&programid=' . $editsaveclient . '&filename=' . urlencode($photo));
            exit;
        } else {
            header('Location: https://stagemag.broadwayworld.com/newcrop-cover/cropper.php?img=' . urlencode('https://stagemag.broadwayworld.com/temp/' . $photo) . '&url=' . urlencode('https://stagemag.broadwayworld.com/programedit-titlepage.php?crop=' . $photo . '&programid=' . $editsaveclient));
            exit;
        }
    }

    header('Location: /programedit.php?programid=' . urlencode($editsaveclient));
    exit;
}

// Delete
if (isset($_GET['deleteclient'])) {
    $stmt = db_write()->prepare("DELETE FROM stagemag.productions WHERE id = ?");
    $stmt->execute([intval($_GET['deleteclient'])]);
    header('Location: /index.php');
    exit;
}

// Load production data
$stmt = db_write()->prepare("SELECT * FROM stagemag.productions WHERE id = ?");
$stmt->execute([$programid]);
$geter = $stmt->fetch();

if (!$geter) { echo 'Production not found.'; exit; }
?>

<div style="clear: both;"></div>

<FORM action="programedit-titlepage.php?editsaveclient=<?= urlencode($programid) ?>" method="post" enctype="multipart/form-data">

<div class="feature-card">
    <div class="feature-card-header">Cover Image</div>
    <div class="feature-card-body">
        <?php if ($geter['image'] !== ''): ?>
            <div class="feature-row">
                <label>Current Cover:</label>
                <div class="current-image">
                    <img src="https://cloudimages.broadwayworld.com/stagemag/<?= htmlspecialchars($geter['image']) ?>">
                </div>
            </div>
        <?php endif; ?>

        <div class="feature-row">
            <label>Upload New Cover Image</label>
            <p style="margin: 0 0 10px 0; font-size: 13px; color: #666;">Recommended: 1000 pixels wide by 1275 pixels high</p>
            <input type="file" name="photo" style="padding: 8px 0;">
        </div>

        <div class="feature-row">
            <label>Stage Mag Logo Overlay</label>
            <select name="logotype" style="width: 100%; max-width: 250px;">
                <option value="<?= htmlspecialchars($geter['logotype']) ?>"><?= htmlspecialchars($geter['logotype']) ?></option>
                <option value="Regular - White">Regular - White</option>
                <option value="Reverse - Black">Reverse - Black</option>
                <option value="Transparent - Black">Transparent - Black</option>
                <option value="Transparent - White">Transparent - White</option>
            </select>
        </div>
    </div>
</div>

<div class="feature-card">
    <div class="feature-card-header">Color Settings</div>
    <div class="feature-card-body">
        <script src="/jscolor/jscolor.js"></script>
        <script>jscolor.presets.default = { format:'hex' };</script>
        <div class="color-picker-row">
            <div class="feature-row">
                <label>Cover Background Color</label>
                <p style="margin: 0 0 10px 0; font-size: 13px; color: #666;">Appears behind your cover image</p>
                <input data-jscolor="{value:'<?= htmlspecialchars($geter['bghex']) ?>'}" name="bghex">
            </div>
            <div class="feature-row">
                <label>Header Color</label>
                <p style="margin: 0 0 10px 0; font-size: 13px; color: #666;">Used for page headers throughout</p>
                <input data-jscolor="{value:'<?= htmlspecialchars($geter['headerhex']) ?>'}" name="headerhex">
            </div>
        </div>
    </div>
</div>

<div class="feature-card">
    <div class="feature-card-header">Title Page Content</div>
    <div class="feature-card-body">
        <p>Fill out your title page below, add additional theatre logos if needed & more!</p>
        <div class="feature-row">
    <textarea id="myarea12" name="titlepage" style="width:600px;height:300px;" required><?php if ($geter['titlepage'] === ''): ?>
        <Table style="max-width:600px;width:100%" width="100%">
            <Tr><Td colspan="3"><center><h1>Your Show</center></h1></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr><Td colspan="3"><center>at <?= htmlspecialchars($geter['theatre']) ?></center></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr>
                <Td width="33%" style="width:33%"><center>by<br>Credit1</center></Td>
                <Td width="33%" style="width:33%"><center>by<br>Credit2</center></Td>
                <Td width="33%" style="width:33%"><center>by<br>Credit3</center></Td>
            </Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr><Td colspan="3"><center>Starring</center></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr>
                <Td width="33%" style="width:33%"><center>Actors<br>Actors<br>Actors</center></Td>
                <Td width="33%" style="width:33%"><center>Actors<br>Actors<br>Actors</center></Td>
                <Td width="33%" style="width:33%"><center>Actors<br>Actors<br>Actors</center></Td>
            </Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
            <Tr><Td colspan="3"></Td></Tr>
        </Table>
<?php else: ?><?= $geter['titlepage'] ?><?php endif; ?></textarea>

<script src="/ckeditor0512z3/ckeditor.js" charset="utf-8"></script>
<script type="text/javascript" src="/ckfinder2025/ckfinder.js" charset="utf-8"></script>
<?php setcookie('folderme2', '/upload13/' . $programid . '/', 0, '/', 'stagemag.broadwayworld.com'); ?>

<script type="text/javascript">
CKEDITOR.on( 'dialogDefinition', function( ev ) {
    var dialogName = ev.data.name, dialogDefinition = ev.data.definition;
    if ( dialogName == 'link' ){ dialogDefinition.getContents('target').get('linkTargetType').default = '_blank'; }
});
CKFinder.setupCKEditor( editor, '/ckfinder34/' ) ;
var editor = CKEDITOR.replace( 'myarea12',{ height: '500px', width: '100%' });
var editor2 = CKEDITOR.replace( 'myarea13',{ height: '200px', width: '100%' });
var editor3 = CKEDITOR.replace( 'myarea14',{ height: '200px', width: '100%' });
editor.on( 'instanceReady', function() { console.log( editor.filter.allowedContent ); } );
</script>

        </div>
    </div>
</div>

<div style="text-align: center; margin-bottom: 30px;">
    <button type="submit" name="buttarticleman" id="cdh_update_article" class="btn-save">Save Title Page</button>
</div>

</form>

   </div>
<!--Footer-part-->
<br><br><br><br>

<?php include 'footer.php'; ?>

Youez - 2016 - github.com/yon3zu
LinuXploit