| Server IP : 172.67.201.108 / Your IP : 216.73.217.99 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 events WHERE user_id = ".$_SESSION['user_id']." AND id = ".$_SESSION['active_event']." ";
$result_event = mysqli_query($GLOBALS['con'], $sql);
if (mysqli_num_rows($result_event) > 0) :
$row_event = mysqli_fetch_object($result_event);
endif;
$sql = "SELECT *, IF(g1.guest_type = 'P',0,1) AS sort_type, IF(g1.guest_type = 'P' OR g1.primary_guest_id = 0,last_name,(SELECT g2.last_name from guests g2 WHERE g2.id = g1.primary_guest_id)) AS sort_name, ".
"IF(g1.guest_type = 'P' OR g1.primary_guest_id = 0, g1.id ,g1.primary_guest_id) AS sort_id FROM guests g1 WHERE g1.guest_type <> 'G' AND g1.user_id = ".$_SESSION['user_id']." AND g1.event_id = ".$_SESSION['active_event']." ";
$search_parm = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['strSearch']));
if ($search_parm != '') :
$sql = $sql." AND ".search_sql($_POST['strSearch'],'g1.last_name,g1.first_name')." ";
endif;
$sql = $sql." ORDER BY sort_name ASC, sort_id ASC, sort_type ASC, g1.last_name ASC";
//echo "===".$sql."===";
$result = mysqli_query($GLOBALS['con'], $sql);
$xls_sql = "SELECT id AS guest_id, guest_type, salutation, last_name, first_name, middle_name, suffix, ".
"IF(invite_temple = 1, 'Y', '') AS invite_event_1, CASE rsvp_temple WHEN 1 THEN 'Y' WHEN 2 THEN 'N' ELSE '' END AS rsvp_event_1, IF(att_temple = 1, 'Y', '') AS att_event_1, ".
"IF(invite_av = 1, 'Y', '') AS invite_event_2, CASE rsvp_av WHEN 1 THEN 'Y' WHEN 2 THEN 'N' ELSE '' END AS rsvp_event_2, IF(att_av = 1, 'Y', '') AS att_event_2, ".
"IF(invite_kv = 1, 'Y', '') AS invite_event_3, CASE rsvp_kv WHEN 1 THEN 'Y' WHEN 2 THEN 'N' ELSE '' END AS rsvp_event_3, IF(att_kv = 1, 'Y', '') AS att_event_3, ".
"IF(invite_bv = 1, 'Y', '') AS invite_event_4, CASE rsvp_bv WHEN 1 THEN 'Y' WHEN 2 THEN 'N' ELSE '' END AS rsvp_event_4, IF(att_bv = 1, 'Y', '') AS att_event_4, ".
"IF(invite_dv = 1, 'Y', '') AS invite_event_5, CASE rsvp_dv WHEN 1 THEN 'Y' WHEN 2 THEN 'N' ELSE '' END AS rsvp_event_5, IF(att_dv = 1, 'Y', '') AS att_event_5, ".
"street, street2, city, state, zip, country, phone, email ".
" FROM guests WHERE guest_type <> 'G' AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event']." ORDER BY last_name ASC";
$ix_list = "rsvp";
$ix_form = "guest_form&ref=rsvp";
?>
<script>
var xstats_on = 0;
switch_invited = function(type, gid)
{
if (document.getElementById('invite_' + type + '_' + gid).checked)
{
$('input[id=rsvp_' + type + '_y_' + gid + ']').attr('disabled', null);
$('input[id=rsvp_' + type + '_n_' + gid + ']').attr('disabled', null);
$('input[id=att_' + type + '_' + gid + ']').attr('disabled', null);
}
else
{
$('input[id=rsvp_' + type + '_y_' + gid + ']').attr('disabled', 'disabled');
$('input[id=rsvp_' + type + '_y_' + gid + ']').attr('checked', null);
$('input[id=rsvp_' + type + '_n_' + gid + ']').attr('disabled', 'disabled');
$('input[id=rsvp_' + type + '_n_' + gid + ']').attr('checked', null);
$('input[id=att_' + type + '_' + gid + ']').attr('disabled', 'disabled');
$('input[id=att_' + type + '_' + gid + ']').attr('checked', null);
}
}
rsvp_update = function(type, gid)
{
//alert(gid + ' ' + val_checkbox($('input[name=rsvp_' + type + '_' + gid + ']:checked').val()));
$('#ajax_update').load('ajax.php?call=rsvp_update&id=' + gid + '&type=' + type +
'&invited=' + val_checkbox($('input[name=invite_' + type + '_' + gid + ']:checked').val()) +
'&rsvp=' + val_checkbox($('input[name=rsvp_' + type + '_' + gid + ']:checked').val()) +
'&att=' + val_checkbox($('input[name=att_' + type + '_' + gid + ']:checked').val()),
function()
{
live_field('invite_' + type + '_' + gid);
live_field('att_' + type + '_' + gid);
live_field('rsvp_' + type + '_y_' + gid);
//live_field('rsvp_' + type + '_n_' + gid);
rsvp_stats(type);
} );
}
rsvp_copy = function(gid)
{
$('#ajax_update').load('ajax.php?call=rsvp_copy&id=' + gid,
function()
{
//window.location.reload(true);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_temple_"]').attr('checked', $('input[id="invite_temple_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_av_"]').attr('checked', $('input[id="invite_av_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_kv_"]').attr('checked', $('input[id="invite_kv_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_bv_"]').attr('checked', $('input[id="invite_bv_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_dv_"]').attr('checked', $('input[id="invite_dv_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[name^="rsvp_temple_"]').val([$('input:[name="rsvp_temple_' + gid + '"]:checked').val()]).attr('disabled', $('input:[name="rsvp_temple_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[name^="rsvp_av_"]').val([$('input:[name="rsvp_av_' + gid + '"]:checked').val()]).attr('disabled', $('input:[name="rsvp_av_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[name^="rsvp_kv_"]').val([$('input:[name="rsvp_kv_' + gid + '"]:checked').val()]).attr('disabled', $('input:[name="rsvp_kv_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[name^="rsvp_bv_"]').val([$('input:[name="rsvp_bv_' + gid + '"]:checked').val()]).attr('disabled', $('input:[name="rsvp_bv_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[name^="rsvp_dv_"]').val([$('input:[name="rsvp_dv_' + gid + '"]:checked').val()]).attr('disabled', $('input:[name="rsvp_dv_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="att_temple_"]').attr('checked', $('input[id="att_temple_' + gid + '"]').attr('checked') || null).attr('disabled', $('input:[id="att_temple_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="att_av_"]').attr('checked', $('input[id="att_av_' + gid + '"]').attr('checked') || null).attr('disabled', $('input:[id="att_av_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="att_kv_"]').attr('checked', $('input[id="att_kv_' + gid + '"]').attr('checked') || null).attr('disabled', $('input:[id="att_kv_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="att_bv_"]').attr('checked', $('input[id="att_bv_' + gid + '"]').attr('checked') || null).attr('disabled', $('input:[id="att_bv_' + gid + '"]').attr('disabled') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="att_dv_"]').attr('checked', $('input[id="att_dv_' + gid + '"]').attr('checked') || null).attr('disabled', $('input:[id="att_dv_' + gid + '"]').attr('disabled') || null);
rsvp_stats('temple');
rsvp_stats('av');
rsvp_stats('kv');
rsvp_stats('bv');
rsvp_stats('dv');
} );
}
rsvp_stats = function(type)
{
if (xstats_on != 1) return;
$.ajax({
url: "ajax.php?call=rsvp_stats&type=" + type,
cache: false,
dataType: "json",
success: function(json) {
//alert('got JSON');
$('#total_invite_' + type).text(json.invite_count);
$('#total_rsvp_y_' + type).text(json.rsvp_y_count);
$('#total_rsvp_n_' + type).text(json.rsvp_n_count);
$('#total_att_' + type).text(json.att_count);
}
,error: function (request, status, error) { /* alert(status + ", " + error); */ }
})
}
$(document).ready(function()
{
rsvp_stats('temple');
rsvp_stats('av');
rsvp_stats('kv');
rsvp_stats('bv');
rsvp_stats('dv');
})
// ****** 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 RSVP 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('rsvp_by_venue,rsvp_all,attended_by_venue,rsvp_yes_by_venue,rsvp_open'); ?>
<?php get_notes(); ?>
<?php get_help_guide('help_rsvp'); ?>
<?php include('mod/_db_navigator_bar.php'); ?>
<div id="ajax_update" style="width:1px; height:1px; display:none;">
</div>
<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 align="center" class="data-grid-label">
</td>
<?php
rsvp_header1_render('temple', $row_event);
rsvp_header1_render('av', $row_event);
rsvp_header1_render('kv', $row_event);
rsvp_header1_render('bv', $row_event);
rsvp_header1_render('dv', $row_event);
?>
</tr>
<tr>
<td align="center" class="data-grid-label">
</td>
<?php
rsvp_header2_render('temple', $row_event);
rsvp_header2_render('av', $row_event);
rsvp_header2_render('kv', $row_event);
rsvp_header2_render('bv', $row_event);
rsvp_header2_render('dv', $row_event);
?>
</tr>
<tr>
<td width="200" align="center" class="data-grid-label">
Name
</td>
<?php
rsvp_header3_render('temple', $row_event);
rsvp_header3_render('av', $row_event);
rsvp_header3_render('kv', $row_event);
rsvp_header3_render('bv', $row_event);
rsvp_header3_render('dv', $row_event);
?>
</tr>
<tr>
<td align="left" class="data-grid-label">
Totals
</td>
<?php
rsvp_header4_render('temple', $row_event);
rsvp_header4_render('av', $row_event);
rsvp_header4_render('kv', $row_event);
rsvp_header4_render('bv', $row_event);
rsvp_header4_render('dv', $row_event);
?>
</tr>
</thead>
<tbody>
<?php
$primary_guest_id = 0;
while($row = mysqli_fetch_object($result)) :
?>
<tr>
<td class="data-grid-var" >
<?php
//if ($row->guest_type != 'P') :
$guest_group = '';
if ($row->guest_type != 'P' && !($row->guest_type == 'C' && $row->primary_guest_id == 0 )) :
echo ' ';
$guest_group = 'guest_group="guest_group_'.$primary_guest_id.'"';
else :
$primary_guest_id = $row->id;
if ($row->guest_type != 'C') :
?>
<input type="button" style="width:40px; font-size:9px; float:right; padding-left:0px; padding-right:0px; margin-top:2px;" value="Copy ↓↓" onclick="rsvp_copy(<?php echo $row->id; ?>);" />
<?php
endif;
endif;
?>
<a href="index.php?IX=guest_form&id=<?php echo $row->id; ?>&ref=rsvp" >
<?php echo format_guest_name_string($row->salutation, $row->first_name, $row->last_name, $row->suffix); ?>
</a>
</td>
<?php
rsvp_render('temple', $row, $row_event, $guest_group);
rsvp_render('av', $row, $row_event, $guest_group);
rsvp_render('kv', $row, $row_event, $guest_group);
rsvp_render('bv', $row, $row_event, $guest_group);
rsvp_render('dv', $row, $row_event, $guest_group);
?>
</tr>
<?php
endwhile;
?>
<script>
xstats_on = 1;
</script>
</tbody>
</table>
</div>
<?php
function rsvp_render($venue, $row, $row_event, $guest_group)
{
if (!empty($row_event->{$venue.'_name'})) :
?>
<td class="data-grid-var" align="center">
<input name="invite_<?php echo $venue.'_'.$row->id; ?>" id="invite_<?php echo $venue.'_'.$row->id; ?>" type="checkbox" value="1" <?php echo $guest_group; ?> onchange="switch_invited('<?php echo $venue; ?>',<?php echo $row->id; ?>);rsvp_update('<?php echo $venue; ?>',<?php echo $row->id; ?>);" <?php if ($row->{'invite_'.$venue} == '1') : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="rsvp_<?php echo $venue.'_'.$row->id; ?>" id="rsvp_<?php echo $venue; ?>_y_<?php echo $row->id; ?>" type="radio" value="1" <?php echo $guest_group; ?> onchange="rsvp_update('<?php echo $venue; ?>',<?php echo $row->id; ?>);" <?php if ($row->{'rsvp_'.$venue} == '1' && $row->{'invite_'.$venue} == '1') : echo 'checked="checked"'; endif; if ($row->{'invite_'.$venue} != '1') : echo 'disabled="disabled"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="rsvp_<?php echo $venue.'_'.$row->id; ?>" id="rsvp_<?php echo $venue; ?>_n_<?php echo $row->id; ?>" type="radio" value="2" <?php echo $guest_group; ?> onchange="rsvp_update('<?php echo $venue; ?>',<?php echo $row->id; ?>);" <?php if ($row->{'rsvp_'.$venue} == '2' && $row->{'invite_'.$venue} == '1') : echo 'checked="checked"'; endif; if ($row->{'invite_'.$venue} != '1') : echo 'disabled="disabled"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="att_<?php echo $venue.'_'.$row->id; ?>" id="att_<?php echo $venue.'_'.$row->id; ?>" type="checkbox" value="1" <?php echo $guest_group; ?> onchange="rsvp_update('<?php echo $venue; ?>',<?php echo $row->id; ?>);" <?php if ($row->{'att_'.$venue} == '1' && $row->{'invite_'.$venue} == '1') : echo 'checked="checked"'; endif; if ($row->{'invite_'.$venue} != '1') : echo 'disabled="disabled"'; endif; ?> />
</td>
<?php
endif;
}
function rsvp_header1_render($venue, $row_event)
{
if (!empty($row_event->{$venue.'_name'})) :
?>
<td colspan="4" align="center" class="data-grid-label">
<?php echo venue_decode($venue); ?>
</td>
<?php
endif;
}
function rsvp_header2_render($venue, $row_event)
{
if (!empty($row_event->{$venue.'_name'})) :
?>
<td align="center" class="data-grid-label">
</td>
<td colspan="2" align="center" class="data-grid-label">
RSVP
</td>
<td align="center" class="data-grid-label">
</td>
<?php
endif;
}
function rsvp_header3_render($venue, $row_event)
{
if (!empty($row_event->{$venue.'_name'})) :
?>
<td width="35" align="center" class="data-grid-label">
Invited
</td>
<td width="25" align="center" class="data-grid-label">
Yes
</td>
<td width="25" align="center" class="data-grid-label">
No
</td>
<td width="25" align="center" class="data-grid-label">
Att.
</td>
<?php
endif;
}
function rsvp_header4_render($venue, $row_event)
{
if (!empty($row_event->{$venue.'_name'})) :
?>
<td id="total_invite_<?php echo $venue; ?>" align="right" class="data-grid-var">
</td>
<td id="total_rsvp_y_<?php echo $venue; ?>" align="right" class="data-grid-var">
</td>
<td id="total_rsvp_n_<?php echo $venue; ?>" align="right" class="data-grid-var">
</td>
<td id="total_att_<?php echo $venue; ?>" align="right" class="data-grid-var">
</td>
<?php
endif;
}
?>