| 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/hotel-prod/public_html/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
form_prep('associations', 'basic_info');
if ($_POST['ajax_event_submitted'] == '1') :
form_reload_check();
if (isset($_POST['active_tab'])) :
$active_tab = $_POST['active_tab'];
else :
$active_tab = 'basic_info';
endif;
$ar_err = array();
if (empty($_POST['name'])) :
$ar_err['name'] = 'Association name is required!';
$err_flag = true;
$err_tab = 'basic_info';
endif;
if (!$err_flag) :
$set = "name = ".$db->quote(trim($_POST['name'])).", ".
"description = ".$db->quote(trim($_POST['description'])).", ".
"active = ".nz(trim($_POST['active']),'0').", ".
sql_set_update();
if ($action == 'Edit') :
$sql = "UPDATE associations set ".$set.
"WHERE association_id = ".nz(trim($_REQUEST['id']), '0')." ";
$db->query($sql) or die('Database Error!');
//echo '==='.$sql.'===';
post_set_update();
else :
if ($action == 'Add New') :
$sql = "INSERT INTO associations SET ".
sql_set_create().
$set;
//echo '==='.$sql.'===';
$db->query($sql) or die('Database Error!');
$_REQUEST['id'] = last_id();
$_POST['association_id'] = $_REQUEST['id'];
post_set_create_update();
endif;
endif;
$form_message = "Saved sucessfully!";
form_uid_reset();
if ($_POST['xsubmit'] == 'Save & Close') :
echo "<SCRIPT>";
echo "appstack_pop()";
echo "</SCRIPT>";
endif;
if ($_POST['xsubmit'] == 'Save & New') :
echo "<SCRIPT>";
echo "window.location.href = 'index.php?IX=association_form&ref=".urlencode($_REQUEST['ref'])."'";
echo "</SCRIPT>";
endif;
else :
$active_tab = $err_tab;
$form_message = "Errors found!";
endif;
else:
if ($action == 'Edit') :
$sql = "SELECT * FROM associations WHERE association_id = ".nz(trim($_REQUEST['id']), '0')." ";
$result = $db->query($sql) or die('Database Error!');
if ($result->rowCount() > 0) :
$row = $result->fetch(PDO::FETCH_OBJ);
$_POST['association_id'] = $row->association_id;
$_POST['name'] = $row->name;
$_POST['description'] = $row->description;
$_POST['active'] = $row->active;
post_set_load_create_update();
else :
echo form_fatal_error('Invalid Operation!');
return;
endif;
else :
$_POST['active'] = 1;
endif;
endif;
?>
<script>
var active_page = '<?php echo $_REQUEST['IX']; ?>';
var active_tab = '';
update_header = function()
{
if ($("#name").val() > "" ) {
$("#header_repeater").text(" - " + $("#name").val());
}
}
$(document).ready(function() {
switch_tab('<?php echo $active_tab; ?>');
update_header();
$(':input:not(.search)').change(function() {sheet_dirty = true; } );
});
</script>
<h1>Association - <?php echo $action; ?><span id="header_repeater"></span></h1>
<?php echo form_message($form_message); ?>
<form name="frm_association" id="frm_association" 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="basic_info" />
<?php form_button_strip('top'); ?>
<div class="tab_strip">
<?php
form_tab_header('basic_info', 'Basic Info', 'admin,eventmgr');
if (!empty($_REQUEST['id'])) :
form_tab_header('guests', 'Guests', 'admin,eventmgr');
endif;
?>
</div>
<div class="cleardiv">
</div>
<div class="tab_content" id="tab_content_basic_info">
<div class="form_header">
Basic Info
</div>
<div class="input_column">
<?php
form_field('association_id', 'text', 10, 0, false, false, true, '', '', 'association_id', 'Association ID');
form_field('name', 'text', 25, 0, true, false, false, '', '', 'name', 'Name', array(), '', 'update_header();');
form_field('description', 'text', 75, 0, false, false, false, '', '', 'description', 'Description', array(), '');
form_field('active', 'checkbox', 50, 0, false, false, false, '', '', 'active', 'Active');
?>
</div>
</div>
<!-- -------------------------------------------------------------------------------------------------------------- -->
<div class="tab_content" id="tab_content_guests">
<div class="form_header">
Guests
</div>
<?php
$ix_form = 'guest_form&association_id='.trim(nz($_REQUEST['id'], '-1'));
db_navigator_bar(array('table_id'=>'db_grid_guests', 'form'=>$ix_form, 'print_section'=>'db_grid_guests', 'call'=>'guests_ajax', 'sort_col'=>'1', 'sort_order'=>'0', 'subtab'=>'true', 'parm1'=>" AND g.association_id = ".nz($_REQUEST['id'], '0')." ", 'func'=>'grid' ));
?>
</div>
<!-- -------------------------------------------------------------------------------------------------------------- -->
<?php form_button_strip('bottom'); ?>
</form>