| Server IP : 172.67.201.108 / Your IP : 216.73.216.114 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
$sql = "SELECT * FROM guests g WHERE g.user_id = ".$_SESSION['user_id']." AND g.event_id = ".$_SESSION['active_event']." AND ".
"(((g.guest_type = 'P' OR (g.guest_type = 'C' AND g.primary_guest_id = 0)) AND (g.rsvp_temple = 1 OR g.rsvp_av = 1 OR g.rsvp_kv = 1 OR g.rsvp_bv = 1 OR g.rsvp_dv = 1)) ".
" OR (g.guest_type = 'P' AND (g.rsvp_temple <> 1 AND g.rsvp_av <> 1 AND g.rsvp_kv <> 1 AND g.rsvp_bv <> 1 AND g.rsvp_dv <> 1) AND (SELECT COUNT(*) FROM guests g3 WHERE g3.primary_guest_id = g.id AND (g3.rsvp_temple = 1 OR g3.rsvp_av = 1 OR g3.rsvp_kv = 1 OR g3.rsvp_bv = 1 OR g3.rsvp_dv = 1) ) > 0) ) ".
" ";
$search_parm = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['strSearch']));
if ($search_parm != '') :
$sql = $sql." AND ".search_sql($_POST['strSearch'],'g.last_name,g.first_name')." ";
endif;
$sql = $sql." ORDER BY g.last_name ASC";
//echo '==='.$sql.'===';
$result = mysqli_query($GLOBALS['con'], $sql);
$xls_sql = "SELECT g.guest_type, g.salutation, g.last_name, g.first_name, g.middle_name, g.suffix, g.hotel_stay, g.hotel, g.hotel_gift, g.hotel_comment FROM guests g WHERE g.user_id = ".$_SESSION['user_id']." AND g.event_id = ".$_SESSION['active_event']." AND ".
"(((g.guest_type = 'P' OR (g.guest_type = 'C' AND g.primary_guest_id = 0)) AND (g.rsvp_temple = 1 OR g.rsvp_av = 1 OR g.rsvp_kv = 1 OR g.rsvp_bv = 1 OR g.rsvp_dv = 1)) ".
" OR (g.guest_type = 'P' AND (g.rsvp_temple <> 1 AND g.rsvp_av <> 1 AND g.rsvp_kv <> 1 AND g.rsvp_bv <> 1 AND g.rsvp_dv <> 1) AND (SELECT COUNT(*) FROM guests g3 WHERE g3.primary_guest_id = g.id AND (g3.rsvp_temple = 1 OR g3.rsvp_av = 1 OR g3.rsvp_kv = 1 OR g3.rsvp_bv = 1 OR g3.rsvp_dv = 1) ) > 0) ) ".
"ORDER BY g.last_name ASC";
//echo '==='.$xls_sql.'===';
$ix_list = "hotel";
$ix_form = "guest_form&ref=hotel";
?>
<script>
switch_stay = function(gid)
{
if (document.getElementById('hotel_stay_' + gid).checked)
{
document.getElementById('hotel_gift_' + gid).disabled = false;
document.getElementById('hotel_comment_' + gid).disabled = false;
document.getElementById('hotel_' + gid + '_mask').disabled = false;
}
else
{
$('#hotel_gift_' + gid).attr('checked',null).change();
$('#hotel_comment_' + gid).val('').change();
$('#hotel_' + gid).val('').change();
$('#hotel_' + gid + '_mask').val('').blur();
document.getElementById('hotel_gift_' + gid).disabled = true;
document.getElementById('hotel_comment_' + gid).disabled = true;
document.getElementById('hotel_' + gid + '_mask').disabled = true;
}
}
hotel_update = function(gid)
{
setTimeout(function() {
$('#ajax_update').load('ajax.php?call=hotel_update&func=hotel&id=' + gid +
'&hotel=' + encodeURIComponent($('input[name=hotel_' + gid + ']').val()),
function()
{
//total_stats(type);
live_field('hotel_' + gid + '_mask');
var filter = $('input[name=hotel_' + gid + ']').val();
if (filter)
{
if ($('#hotel_' + gid + '_items_ul li:Contains(' + filter + ')').length <=0)
{
$('#div_ajax_reload_' + gid).attr('hotel_name', filter);
setTimeout(function()
{
$('div.ajax_reload').each(function()
{
$(this).load('ajax.php?call=hotel_reload&gid=' + encodeURIComponent($(this).attr('guest_id')) + '&hotel=' + encodeURIComponent($(this).attr('hotel_name')));
}
);
},200);
}
}
} );
},200);
}
hotel_stay_update = function(gid)
{
$('#ajax_update').load('ajax.php?call=hotel_update&func=stay&id=' + gid +
'&stay=' + val_checkbox($('input[name=hotel_stay_' + gid + ']:checked').val()),
function()
{
switch_stay(gid);
live_field('hotel_stay_' + gid);
total_stats('stay');
} );
}
hotel_gift_update = function(gid)
{
$('#ajax_update').load('ajax.php?call=hotel_update&func=gift&id=' + gid +
'&gift=' + val_checkbox($('input[name=hotel_gift_' + gid + ']:checked').val()),
function()
{
live_field('hotel_gift_' + gid);
total_stats('gift');
} );
}
hotel_comment_update = function(gid)
{
$('#ajax_update').load('ajax.php?call=hotel_update&func=comment&id=' + gid +
'&comment=' + encodeURIComponent($('input[name=hotel_comment_' + gid + ']').val()),
function()
{
live_field('hotel_comment_' + gid);
//total_stats(type);
} );
}
total_stats = function(type)
{
$.ajax({
url: "ajax.php?call=hotel_stats&type=" + type,
cache: false,
dataType: "json",
success: function(json) {
$('#total_hotel_' + type).text(json.hotel_count);
}
,error: function (request, status, error) { /* alert(status + ", " + error); */ }
})
}
$(document).ready(function()
{
total_stats('stay');
total_stats('gift');
})
// ****** Prepare popup form settings *****
var win_page = 'page_form.php';
var win_width = 600;
var win_height = 400;
var print_section = 'div_db_grid';
</script>
<h1>Guest Hotel Worksheet</h1>
<?php
if (empty($_SESSION['active_event'])) :
?>
<h3>No Bar/Bat Mitzvah defined - please create or activate a Bar/Bat Mitzvah!</h3>
<?php
endif;
?>
<?php get_reports('guests_by_hotel'); ?>
<?php get_notes(); ?>
<?php get_help_guide('help_hotel'); ?>
<?php include('mod/_db_navigator_bar.php'); ?>
<div id="ajax_update" style="width:1px; height:1px; display:none;">
</div>
<form style="" name="frm_hotel" id="frm_hotel" method="post" action="" >
<div class="db-grid" id="div_db_grid">
<table id="db_grid_main" class="dbgrid" align="center" cellpadding="0" cellspacing="1" border="0" >
<thead>
<tr>
<td width="200" align="center" class="data-grid-label">
Name
</td>
<td width="70" align="center" class="data-grid-label">
Hotel Stay
</td>
<td width="250" align="center" class="data-grid-label">
Hotel
</td>
<td width="70" align="center" class="data-grid-label">
Gift Bag
</td>
<td width="200" align="center" class="data-grid-label">
Comment
</td>
</tr>
<tr>
<td align="left" class="data-grid-label">
Totals
</td>
<td id="total_hotel_stay" align="right" class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td id="total_hotel_gift" align="right" class="data-grid-var">
</td>
<td align="center" class="data-grid-var">
</td>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_object($result)) :
?>
<tr>
<td class="data-grid-var" >
<a href="index.php?IX=guest_form&id=<?php echo $row->id; ?>&ref=hotel" >
<?php
echo format_guest_name_string($row->salutation, $row->first_name, $row->last_name, $row->suffix);
if ($row->rsvp_temple != 1 && $row->rsvp_av != 1 && $row->rsvp_kv != 1 && $row->rsvp_bv != 1 && $row->rsvp_dv != 1) :
echo "'s family";
endif;
?>
</a>
</td>
<td class="data-grid-var" align="center">
<input name="hotel_stay_<?php echo $row->id; ?>" id="hotel_stay_<?php echo $row->id; ?>" type="checkbox" value="1" <?php echo $guest_group; ?> onchange="hotel_stay_update(<?php echo $row->id; ?>);" <?php if ($row->hotel_stay == '1') : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" >
<div class="ajax_reload" guest_id="<?php echo $row->id; ?>" hotel_name="<?php echo $row->hotel; ?>" id="div_ajax_reload_<?php echo $row->id; ?>">
<?php
auto_complete('hotel_'.$row->id, $row->hotel, $row->hotel, "SELECT DISTINCT hotel, hotel FROM guests WHERE hotel > '' AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event']." ORDER BY hotel ", false, 250, null, null, "hotel_update(".$row->id.");");
?>
</div>
</td>
<td class="data-grid-var" align="center">
<input name="hotel_gift_<?php echo $row->id; ?>" id="hotel_gift_<?php echo $row->id; ?>" type="checkbox" value="1" <?php echo $guest_group; ?> onchange="hotel_gift_update(<?php echo $row->id; ?>);" <?php if ($row->hotel_gift == '1') : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var">
<input name="hotel_comment_<?php echo $row->id; ?>" id="hotel_comment_<?php echo $row->id; ?>" type="text" value="<?php echo $row->hotel_comment; ?>" maxlength="100" style="width:225px; font-size:12px;" onchange="hotel_comment_update(<?php echo $row->id; ?>);" />
</td>
<script>
switch_stay(<?php echo $row->id; ?>);
</script>
</tr>
<?php
endwhile;
?>
</tbody>
</table>
</div>
</form>