| Server IP : 172.67.201.108 / Your IP : 216.73.217.39 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/mitzvahm/wwwdevplanner/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
if (isset($_SESSION['user_id'])) :
if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) :
$action = "Edit";
else :
$action = "Add New";
endif;
else :
exit();
endif;
//var_dump($_POST);
$active_tab = 'general';
if ($_POST['ajax_event_submitted'] == '1') :
if (isset($_POST['active_tab'])) :
$active_tab = $_POST['active_tab'];
else :
$active_tab = 'general';
endif;
$ar_err = array();
if (empty($_POST['insert_desc'])) :
$ar_err['insert_desc'] = 'Insert description is required!';
$err_flag = true;
$err_tab = 'general';
endif;
$_REQUEST['insert_text'] = str_ireplace('<script', '<--script', $_REQUEST['insert_text']);
if (!$err_flag) :
$set = "insert_desc = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['insert_desc']))."', ".
"insert_text = '".mysqli_real_escape_string($GLOBALS['con'], trim($_REQUEST['insert_text']))."' ";
if ($action == 'Edit') :
$sql = "UPDATE invitation_inserts set ".$set.
" WHERE id = ".mysqli_real_escape_string($GLOBALS['con'], trim($_REQUEST['id']))." AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event'];
mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
else :
if ($action == 'Add New') :
$sql = "INSERT INTO invitation_inserts SET ".
"user_id = ".$_SESSION['user_id'].", ".
"event_id = ".$_SESSION['active_event'].", ".
$set;
mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
$_REQUEST['id'] = last_id();
endif;
endif;
$form_message = "Saved sucessfully!";
$action = 'Edit';
if ($_POST['xsubmit'] == 'Save & Close') :
echo "<SCRIPT>";
echo "window.location.href = 'index.php?IX=invitation_inserts'";
echo "</SCRIPT>";
endif;
if ($_POST['xsubmit'] == 'Save & New') :
echo "<SCRIPT>";
echo "window.location.href = 'index.php?IX=invitation_insert_form'";
echo "</SCRIPT>";
endif;
else :
$active_tab = $err_tab;
$form_message = "Errors found!";
endif;
else:
if ($action == 'Edit') :
$sql = "SELECT * FROM invitation_inserts WHERE id = ".mysqli_real_escape_string($GLOBALS['con'], trim($_REQUEST['id']))." AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event'];
$result = mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
if (mysqli_num_rows($result) > 0) :
$row = mysqli_fetch_object($result);
$_POST['insert_desc'] = $row->insert_desc;
$_REQUEST['insert_text'] = $row->insert_text;
else :
echo form_fatal_error('Invalid Operation!');
return;
endif;
endif;
endif;
?>
<script type="text/javascript" src="admin/ckeditor/ckeditor.js"></script>
<script>
var active_page = '<?php echo $_REQUEST['IX']; ?>';
var active_tab = '';
check_other = function(value, other_id)
{
if (value == 'Other...')
{
$('#' + other_id).show();
$('#' + other_id).val('');
}
else
{
$('#' + other_id).hide();
$('#' + other_id).val(value);
}
}
update_header = function()
{
if ($("#insert_desc").val() > "")
{
$("#header_repeater").text(" - " + $("#insert_desc").val() );
}
}
print_insert = function()
{
var data = CKEDITOR.instances.insert_text.getData();
$('#print_section').html('<div style="border: 1px solid black; padding:15px;">' + data + '</div>');
printSection('print_section');
}
$(document).ready(function()
{
switch_tab('<?php echo $active_tab; ?>');
//switch_type();
update_header();
$(':input').change(function() {sheet_dirty = true;} );
}
)
</script>
<h1>Invitation Insert - <?php echo $action; ?><span id="header_repeater"></span></h1>
<?php get_notes(); ?>
<?php get_help_guide('help_invitation_insert_form_'.$active_tab); ?>
<?php echo form_message($form_message); ?>
<form style="" name="frm_table" id="frm_table" method="post" action="">
<input name="ajax_event_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="general" />
<!-- -------------------------------------------------------------------------------------------------------------- -->
<div class="form_strip">
<input type="button" value="Save" onclick="sheet_dirty = false; this.form.submit();" />
<input type="button" value="Save & Close" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
<input type="button" value="Save & New" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
<input type="button" value="Cancel" onclick="sheet_dirty = false; window.location.href = 'index.php?IX=invitation_inserts'" />
</div>
<!-- -------------------------------------------------------------------------------------------------------------- -->
<div class="tab_strip">
<div class="tab_header" id="tab_general" onclick="switch_tab('general');">
General Information
</div>
</div>
<div class="cleardiv">
</div>
<div class="tab_content" id="tab_content_general">
<div class="form_header">
Invitation Insert Details
</div>
<table class="input_block">
<tr>
<td>
Insert Description
</td>
<td>
<?php
if ($action == 'Add New') :
auto_complete('insert_desc', $_POST['insert_desc'], $_POST['insert_desc'], "SELECT insert_desc, insert_desc FROM invitation_inserts_template ORDER BY seq ", false, null, null, null);
else :
?>
<input name="insert_desc" id="insert_desc" type="text" maxlength="100" value="<?php echo $_POST['insert_desc']; ?>" />
<?php
endif;
show_form_error($ar_err['insert_desc']);
?>
<input style="float:right;" type="button" value="Print" onclick="print_insert();" />
</td>
</tr>
<tr>
<td>
Insert Text
</td>
<td style="width:725px;">
<div id="print_section" style="display:none;">
</div>
<textarea id="insert_text" name="insert_text" class="input-box" style="width:700px;" rows="30" cols="80"><?php echo $_REQUEST['insert_text']; ?></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'insert_text' );
</script>
</td>
</tr>
</table>
</div>
<!-- -------------------------------------------------------------------------------------------------------------- -->
<div class="form_strip">
<input type="button" value="Save" onclick="sheet_dirty = false; this.form.submit();" />
<input type="button" value="Save & Close" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
<input type="button" value="Save & New" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
<input type="button" value="Cancel" onclick="sheet_dirty = false; window.location.href = 'index.php?IX=invitation_inserts'" />
<input type="hidden" name="xsubmit" id="xsubmit" />
</div>
</form>