| Server IP : 172.67.201.108 / 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/tgnewdev/admin/mod/ |
Upload File : |
<?php require('_mod_security.php'); ?>
<?php
form_prep('', 'basic_info', 'frm_show');
if (($_POST['form_submitted'] ?? '') === '1') :
$_POST['html'] = purify_html($_POST['html']);
if (empty($_POST['slug']) && !empty($_POST['name'])) :
$_POST['slug'] = generate_unique_slug($_POST['name'], 'obw_shows', 'slug');
endif;
form_prep_submit();
form_validate_all();
if (!$err_flag) :
try {
$db->beginTransaction();
$set = sql_set_update() . form_generate_set(true);
if ($action == 'Edit') :
$sql = "UPDATE obw_shows set ".$set.
"WHERE id = ".nz(trim($_REQUEST['id']), '0')." ";
save_db_revision('obw_shows', $sql);
post_set_update();
elseif ($action == 'Add New') :
$sql = "INSERT INTO obw_shows SET ".
sql_set_create() .
$set;
$db->query($sql);
$_REQUEST['id'] = last_id();
$_POST['id'] = $_REQUEST['id'];
$_POST['id'] = $_REQUEST['id'];
post_set_create_update();
endif;
$db->commit();
} catch(Exception $e) {
db_err_rollback($e);
}
form_success();
else :
$active_tab = $err_tab;
$form_message = "Errors found!";
endif;
else:
if ($action == 'Edit') :
$sql = "SELECT * FROM obw_shows WHERE id = ".nz(trim($_REQUEST['id']), '0')." ";
if (!get_row_to_post($sql)) :
echo form_fatal_error('Invalid Operation!');
return;
endif;
elseif ($action == 'Add New') :
$_POST['obw_location_id'] = $_GET['obw_location_id'] ?? '';
endif;
endif;
?>
<script>
var active_page = '<?php echo $_REQUEST['IX']; ?>';
var active_tab = '';
function update_header() {
if ($("#name").val() > "" ) {
$("#header_repeater").text(" - " + $("#name").val());
}
}
function check_if_saved(e) {
if (sheet_dirty) {
e.preventDefault();
alert('Please save your changes before previewing.');
}
}
$(document).ready(function() {
switch_tab('<?php echo $active_tab; ?>');
update_header();
init_html_editor('html');
set_dirty_event();
});
</script>
<h1>Off Broadway Show - <?php echo $action; ?><span id="header_repeater"></span></h1>
<?php echo form_message($form_message); ?>
<form name="frm_show" id="frm_show" method="post" action="">
<input name="form_submitted" type="hidden" value="1" />
<input name="id" type="hidden" value="<?php echo $_REQUEST['id']; ?>" />
<input name="active_tab" id="active_tab" type="hidden" value="basic_info" />
<?php
form_button_strip('top');
form_tab_strip_start();
form_tab_header('basic_info', 'Basic Info', '');
form_tab_header('media', 'Media Library', '');
if (!empty($_REQUEST['id'])) :
form_tab_header('revisions', 'Revisions', 'admin,dataentry');
endif;
form_tab_strip_end();
//******************************************************************************************
form_tab_start('basic_info', 'Off Broadway Show - Basic Info');
form_column_start();
form_field(['fname'=>'name', 'ftype'=>'textarea', 'fsize'=>250, 'frows'=>2, 'maxlength'=>'250', 'frequired'=>true, 'fdbname'=>'name', 'flabel'=>'Show Name', 'onblur'=>'update_header();']);
form_field(['fname'=>'slug', 'ftype'=>'textarea', 'fsize'=>250, 'frows'=>2, 'maxlength'=>'250', 'frequired'=>true, 'readonly'=>false, 'fdbname'=>'slug', 'flabel'=>'Slug']);
form_field(['fname'=>'status', 'ftype'=>'radiogroup', 'frequired'=>true, 'fdbname'=>'status', 'flabel'=>'Show Status','ar_group'=>APP_EVENT_STATUSES]);
form_field(['fname'=>'start_date', 'ftype'=>'date', 'fsize'=>20, 'frequired'=>true, 'readonly'=>true, 'fclass'=>'date-pick dp-applied required', 'fdbname'=>'start_date', 'flabel'=>'Start Date']);
form_field(['fname'=>'end_date', 'ftype'=>'date', 'fsize'=>20, 'frequired'=>true, 'readonly'=>true, 'fclass'=>'date-pick dp-applied required', 'fdbname'=>'end_date', 'flabel'=>'End Date']);
$ar_timezones = DateTimeZone::listIdentifiers();
form_column_end();
form_column_start();
$sql = "SELECT id, name FROM obw_locations WHERE status = 1 ORDER by name";
$result_locations = $db->query($sql) or die('Database Error!');
$ar_locations = $result_locations->fetchAll(PDO::FETCH_KEY_PAIR);
form_field(['fname'=>'obw_location_id', 'ftype'=>'select', 'fsize'=>25, 'frequired'=>true, 'readonly'=>false, 'fdbname'=>'obw_location_id', 'flabel'=>'Location', 'ar_group'=>$ar_locations, 'onchange'=>'']);
form_field(['fname'=>'show_url', 'ftype'=>'text', 'fsize'=>250, 'frequired'=>true, 'fdbname'=>'show_url', 'flabel'=>'Show URL']);
form_field(['fname'=>'price', 'ftype'=>'text', 'fsize'=>250, 'frequired'=>false, 'fdbname'=>'price', 'flabel'=>'Price']);
form_field(['fname'=>'featured_image', 'ftype'=>'text', 'fsize'=>250, 'frequired'=>false, 'fdbname'=>'featured_image', 'flabel'=>'Featured Image - <a href="javascript:switch_tab(\'media\')">Pick from media...</a> - <a href="index.php?IX=media_form&cat=content&type=img">Add new...</a>']);
if (!empty($_POST['featured_image'])) :
echo '<img src="' . APP_BASE_USER_SITE_SECURE . image_cache('img/content/' . $_POST['featured_image'], 85, 200, 200) . '" />';
endif;
form_field(['fname'=>'show_in_slider', 'ftype'=>'checkbox', 'fdbname'=>'show_in_slider', 'flabel'=>'Show In Slider']);
form_column_end();
form_column_start();
form_field(['fname'=>'seo_enabled', 'ftype'=>'checkbox', 'fdbname'=>'seo_enabled', 'flabel'=>'SEO Enabled']);
form_field(['fname'=>'seo_sitemap_include', 'ftype'=>'checkbox', 'fdbname'=>'seo_sitemap_include', 'flabel'=>'SEO Sitemap Include']);
form_field(['fname'=>'seo_title', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_title', 'flabel'=>'SEO Title', 'qtip'=>'Limit to 70 characters.']);
form_field(['fname'=>'seo_keywords', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_keywords', 'flabel'=>'SEO Keywords', 'qtip'=>'Limit to 10 keyword phrases.']);
form_field(['fname'=>'seo_description', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_description', 'flabel'=>'SEO Description', 'qtip'=>'Limit to 160 characters total, 100 characters per line, 2 lines maximum.']);
form_column_end();
form_column_start('max-width:1000px;');
form_field(['fname'=>'shortcode', 'ftype'=>'select', 'fsize'=>25, 'frequired'=>false, 'fdbname'=>'', 'flabel'=>'Shortcode - select to insert into HTML below', 'ar_group'=>APP_SHORTCODES, 'onchange'=>'insert_text_into_html(\'[\' + $(this).val() + \']\'); $(this).val(\'\'); return false;']);
form_field(['fname'=>'html', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>8, 'fdbname'=>'html', 'flabel'=>'Text']);
echo '<p><a target="_blank" href="../off-broadway/'.$_POST['slug'].'/?preview=true" onclick="check_if_saved(event);">Preview Show...</a></p>';
form_column_end();
form_tab_end();
//*****************************************************************
form_tab_start('media', 'Media Library');
echo '<div id="ajax_update_media" style="width:1px; height:1px; display:none;">';
echo '</div>';
$ix_form = 'media_form&type=img&cat=content';
db_navigator_bar(['table_id'=>'db_grid_media', 'form'=>$ix_form, 'print_section'=>'db_grid_media', 'call'=>'media_ajax', 'sort_col'=>'1', 'sort_order'=>'1', 'subtab'=>'true', 'parm1'=>" AND media_cat = 'content' ", 'parm2'=>'insert_js,insert_featured', 'func'=>'grid' ]);
form_tab_end();
//*****************************************************************
form_tab_revisions('obw_shows', $_REQUEST['id']);
form_button_strip('bottom');
?>
</form>
<?php require_once('_html_editor.php'); ?>