| 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/connectionsdev/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
//$encrypted = sys_encrypt_string('201');
//echo "<h1>$encrypted</h1>";
$contact_id = sys_decrypt_string($_GET['key'] ?? '');
if (empty($contact_id)) :
echo form_fatal_error('Invalid Operation!');
return;
endif;
$venue_id = lookup_db_field('contacts', 'id', nz($contact_id, '0'), 'venue_id');
if (empty($venue_id)) :
echo form_fatal_error('Invalid Operation!');
return;
endif;
form_prep('venues', 'basic_info', 'frm_venue_submit', false);
$form_success = false;
if ($_POST['ajax_event_submitted'] == '1') :
form_prep_submit();
form_validate_all();
if (empty($_POST['captcha']) || $_SESSION['lcs_captcha_key_contactform'] != md5($_POST['captcha'])) :
$ar_err['captcha'] = 'Invalid verification!';
$err_flag = true;
$err_tab = 'basic_info';
endif;
if (!$err_flag) :
if (spam_count_exceeded(APP_SPAM_SUBMISSION_LIMIT, 'venues')) :
echo '<h1>Number of submissions has exceeded allowable threshold.</h1>';
return;
endif;
try {
$db->beginTransaction();
$submitter_info =
"submitted_by = " . $db->quote($_POST['submitted_by']) . ", " .
"submitted_ip = " . $db->quote(get_client_ip()) . ", " .
"status = 2, ";
$set = sql_set_update() . $submitter_info . form_generate_set();
$sql = "UPDATE venues SET " . $set . " WHERE id = " . nz($venue_id, '0');
save_db_revision('venues', $venue_id);
$db->query($sql);
//*********** First contact ***********
$set = sql_set_update() . $submitter_info .
"contact_type = " . $db->quote($_POST['contact_type']) . ", " .
"title = " . $db->quote($_POST['title']) . ", " .
"first_name = " . $db->quote($_POST['first_name']) . ", " .
"last_name = " . $db->quote($_POST['last_name']) . ", " .
"email = " . $db->quote($_POST['email']) . ", " .
"office_phone = " . $db->quote($_POST['office_phone']) . ", " .
"cell_phone = " . $db->quote($_POST['cell_phone']) . ", " .
"other_phone = " . $db->quote($_POST['other_phone']) . ", " .
"preferred_phone = " . $db->quote($_POST['preferred_phone']) . ", " .
"accepts_texts = " . nz($_POST['accepts_texts'], 0) . " ";
$sql = "UPDATE contacts SET " . $set . " WHERE id = " . nz($contact_id, '0');
save_db_revision('contacts', $contact_id);
$db->query($sql);
$db->commit();
} catch(Exception $e) {
db_err_rollback($e);
}
form_success();
$form_success = true;
$mail_body = "
<p><b>{$_POST['submitted_by']}</b> has updated venue and contact information for <b>{$_POST['name']}</b>.</p>
<p>The following contacts have also been updated:</p>
<p><b>{$_POST['contact_type']} - {$_POST['first_name']} {$_POST['last_name']}</b></p>
<p>Please review at <a href=\"" . APP_BASE_SECURE . "admin\">" . APP_BASE_SECURE . "admin</a>, then TOP MENU - VENUES - PENDING VENUES and either mark ACTIVE or delete the venue and all contacts for this venue.</p>
<p>This is an auto-generated email, replies will be ignored.</p?
";
send_mail('Online Venue Update', APP_MAIL_ADMIN, '', APP_MAIL_BCC, $mail_body);
else :
$active_tab = $err_tab;
$form_message = "Errors found!";
endif;
else :
$sql = "SELECT c.*, v.* FROM contacts c JOIN venues v ON (v.id = c.venue_id) WHERE c.id = " . nz(trim($contact_id), '0') . "
AND c.status IN (1, 2) AND v.status IN (1, 2)
";
if (!get_row_to_post($sql, true)) :
echo form_fatal_error('Invalid Operation!');
return;
endif;
$lock_venue = false;
if ($_POST['status_0'] === 2 && $_POST['status_1'] === 2) :
echo form_fatal_error('This entry has already been updated!');
return;
endif;
if ($_POST['status_1'] === 2) :
$lock_venue = true;
endif;
endif;
$ar_phone_types = [
'office_phone' => 'Special Reservation Phone Number',
'cell_phone' => 'Contact\'s Direct Phone (cell)',
'other_phone' => 'Other',
];
?>
<script>
var active_page = '<?php echo $_REQUEST['IX']; ?>';
var active_tab = '';
$(document).ready(function() {
switch_tab('<?php echo $active_tab; ?>');
$(':input:not(.search)').change(function() {
sheet_dirty = true;
});
})
</script>
<?php
if ($form_success) :
?>
<div class="form_instructions">
<p>
Your information has been received and will be reviewed for Concierge Connections. Thank you
</p>
</div>
<?php
return;
endif;
?>
<div class="form_instructions">
<p>
Concierges requested direct contacts to make special reservations for their VIPs and groups. This <strong><em>Concierge Connections</em></strong> database will be available at their desks.
</p>
<p>
Submit your UPDATES using the form below.
<p>
</div>
<?php echo form_message($form_message); ?>
<form name="frm_venue_submit" id="frm_venue_submit" method="post" action="">
<input name="ajax_event_submitted" type="hidden" value="1" />
<input name="key" type="hidden" value="<?php echo ($_GET['key'] ?? ''); ?>" />
<input name="active_tab" id="active_tab" type="hidden" value="basic_info" />
<div class="cleardiv">
</div>
<?php form_tab_start('basic_info', 'Please fill out the form below'); ?>
<div class="input_column">
<div class="form_header">
Venue Information
</div>
<?php
//form_field('id', 'text', 10, 0, false, false, true, '', '', 'id', 'Venue ID');
form_field('name', 'text', 100, 0, false, false, true, '', '', 'name', 'Venue Name');
$sql = "SELECT id, description FROM categories WHERE active = 1 ORDER BY description ";
$result = $db->query($sql) or die('Database Error!');
$ar_categories = $result->fetchAll(PDO::FETCH_KEY_PAIR);
form_field('category_id', 'select', 50, 0, false, false, true, '', '', 'category_id', 'Category', $ar_categories);
form_field('street', 'text', 75, 0, false, false, true, '', '', 'street', 'Street');
form_field('city', 'text', 50, 0, false, false, true, '', '', 'city', 'City');
$sql = "SELECT state, CONCAT((CASE country_sort_code WHEN 1 THEN '' WHEN 2 THEN 'Canada - ' END), state_name) AS country_state FROM states WHERE country_sort_code IN (1) ORDER BY country_sort_code, state_name ";
$result = $db->query($sql) or die('Database Error!');
$ar_states = $result->fetchAll(PDO::FETCH_KEY_PAIR);
form_field('state', 'select', 50, 0, false, false, true, '', '', 'state', 'State', $ar_states);
form_field('zip', 'text', 15, 0, false, false, true, '', '', 'zip', 'Zip Code');
form_field('main_phone', 'text', 100, 0, false, false, $lock_venue, '', '', 'main_phone', 'Main Phone');
form_field('website', 'text', 100, 0, false, false, $lock_venue, '', '', 'website', 'Website');
form_field('reservation_link', 'text', 200, 0, false, false, $lock_venue, '', '', 'reservation_link', 'Direct Reservation Link (Resy, OpenTable, etc.)');
form_field('comments', 'textarea', 60, 5, false, false, false, '', '', 'comments', 'Special Instructions');
?>
</div>
<div class="input_column">
<div class="form_header">
Contact Person
</div>
<?php
form_field('first_name', 'text', 100, 0, true, false, false, '', '', '', 'First Name');
form_field('last_name', 'text', 100, 0, true, false, false, '', '', '', 'Last Name');
form_field('title', 'text', 50, 0, true, false, false, '', '', '', 'Title');
form_field('contact_type', 'select', 50, 0, true, false, false, '', '', '', 'Contact Type', APP_CONTACT_TYPES);
form_field('email', 'text', 50, 0, true, false, false, '', '', '', 'Email', [], '', '', '', 'email');
form_field('office_phone', 'text', 50, 0, true, false, false, '', '', '', 'Special Reservation Phone Number');
form_field('cell_phone', 'text', 50, 0, true, false, false, '', '', '', 'Contact\'s Direct Phone (cell)');
form_field('accepts_texts', 'checkbox', 50, 0, false, false, false, '', '', '', 'Accepts Texts');
form_field('other_phone', 'text', 50, 0, false, false, false, '', '', '', 'Other Phone');
form_field('preferred_phone', 'select', 50, 0, false, false, false, '', '', '', 'Preferred Phone', $ar_phone_types);
?>
</div>
<div class="cleardiv">
</div>
<hr/>
<div class="input_column">
<?php
form_field('submitted_by', 'text', 50, 0, true, false, false, '', '', '', 'Submitter Name');
echo '<div style="width:45%; min-width:140px; display:inline-block; margin-right:5px;">';
form_field('captcha', 'text', 15, 0, true, false, false, '', '', '', 'Verification Code', null, '', '', 'If you can\'t read the verification code, click the <b>Reload</b> icon.');
echo '</div>';
echo '<div style="width:48%; min-width:140px; display:inline-block; vertical-align:top; margin-top:22px;">';
echo '<img id="contact_captcha" class="captcha" style="vertical-align:middle;" align="middle" src="ajax.php?call=_captcha&captcha_type=contactform" />';
echo '<img style="vertical-align:middle; cursor:pointer;" align="middle" src="img/reload_icon_gray.png" onclick="reload_captcha(\'contact_captcha\', \'contactform\');" />';
echo '</div>';
?>
</div>
<?php form_tab_end(); ?>
<!-- -------------------------------------------------------------------------------------------------------------- -->
<?php form_button_strip('bottom',[
'save' => ['show' => true, 'caption' => 'Submit', 'js' => "sheet_dirty = false; this.form.submit();"],
'save_close' => ['show' => false, 'caption' => 'Save & Close', 'js' => "sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();"],
'save_new' => ['show' => false, 'caption' => 'Save & New', 'js' => "sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();"],
'cancel' => ['show' => false, 'caption' => 'Cancel', 'js' => "sheet_dirty = false; appstack_pop();"],
] , false, 'center'); ?>
</form>