| Server IP : 104.21.21.239 / 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/mitzvahm/wwwdevplanner/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
// *** venue ***
$sql = "SELECT * FROM events WHERE user_id = ".$_SESSION['user_id']." AND id = ".$_SESSION['active_event']." ";
$result_event = mysqli_query($GLOBALS['con'], $sql);
$num_venues = 0;
if (mysqli_num_rows($result_event) > 0) :
$row_event = mysqli_fetch_object($result_event);
if (!empty($row_event->temple_name)) :
$ar_venue['temple'] = venue_decode('temple');
endif;
if (!empty($row_event->av_name)) :
$ar_venue['av'] = venue_decode('av');
endif;
if (!empty($row_event->kv_name)) :
$ar_venue['kv'] = venue_decode('kv');
endif;
if (!empty($row_event->bv_name)) :
$ar_venue['bv'] = venue_decode('bv');
endif;
if (!empty($row_event->dv_name)) :
$ar_venue['dv'] = venue_decode('dv');
endif;
$current_venue_name = reset($ar_venue);
$current_venue = key($ar_venue);
if (!empty($_GET['venue'])) :
$current_venue = $_GET['venue'];
endif;
$current_venue = mysqli_real_escape_string($GLOBALS['con'], trim($current_venue));
endif;
// *** Guests ***
$sql = "SELECT g.*, t.table_no, t.table_desc, IF(g.guest_type = 'P',0,1) AS sort_type, IF(g.guest_type = 'P',g.id,g.primary_guest_id) AS sort_id FROM guests g INNER JOIN tables t ON (g.table_".$current_venue." = t.id) WHERE g.guest_type <> 'G' AND g.invite_".$current_venue." = 1 AND g.rsvp_".$current_venue." = 1 AND g.user_id = ".$_SESSION['user_id']." AND g.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'],'last_name,first_name')." ";
endif;
$sql = $sql." ORDER BY t.table_no ASC, sort_id ASC, sort_type ASC, g.last_name ASC";
$result = mysqli_query($GLOBALS['con'], $sql);
$xls_sql = "SELECT g.first_name, g.last_name, g.placecard_".$current_venue."_text AS formatted_text, g.placecard_".$current_venue."_text2 AS formatted_text2, t.table_no, t.table_desc, ".$current_venue."_rename AS event ".
", IF(placecard_".$current_venue." = 1, 'Y', 'N') AS print_placecard ".
"FROM (events e INNER JOIN guests g ON (e.id = g.event_id AND e.user_id = g.user_id)) INNER JOIN tables t ON (g.table_".$current_venue." = t.id) WHERE g.guest_type <> 'G' AND g.invite_".$current_venue." = 1 AND g.rsvp_".$current_venue." = 1 AND g.user_id = ".$_SESSION['user_id']." AND g.event_id = ".$_SESSION['active_event']." ".
"GROUP BY g.last_name, g.first_name, g.id, g.placecard_".$current_venue."_text, t.table_no, t.table_desc ".
"ORDER BY t.table_no ASC, g.last_name ASC, g.first_name ASC";
$ix_list = "placecards&venue=".$current_venue;
$ix_form = "guest_form&ref=placecards";
$vert_text_size = 10;
?>
<script>
var second_line_id = 0;
var format_line = '';
check_print = function(gid)
{
if ($('input[id="placecard_print_' + gid + '"]').attr('checked') == 'checked')
{
$('input[id="placecard_format_10_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_format_15_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_format_20_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_format_30_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_format_35_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_format_40_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_text_' + gid + '"]').attr('disabled', null);
$('input[id="placecard_text2_' + gid + '"]').attr('disabled', null);
}
else
{
$('input[id="placecard_format_10_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_10_' + gid + '"]').attr('checked', null);
$('input[id="placecard_format_15_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_15_' + gid + '"]').attr('checked', null);
$('input[id="placecard_format_20_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_20_' + gid + '"]').attr('checked', null);
$('input[id="placecard_format_30_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_30_' + gid + '"]').attr('checked', null);
$('input[id="placecard_format_35_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_35_' + gid + '"]').attr('checked', null);
$('input[id="placecard_format_40_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_format_40_' + gid + '"]').attr('checked', null);
$('input[id="placecard_text_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_text_' + gid + '"]').val('');
$('input[id="placecard_text2_' + gid + '"]').attr('disabled', 'disabled');
$('input[id="placecard_text2_' + gid + '"]').val('');
}
}
invite_all = function(gid)
{
if ($('#invite_all_'+ gid).attr('checked') == 'checked')
{
$('input[id="invite_temple_' + gid + '"]').attr('checked', 'checked').change();
$('input[id="invite_av_' + gid + '"]').attr('checked', 'checked').change();
$('input[id="invite_kv_' + gid + '"]').attr('checked', 'checked').change();
$('input[id="invite_bv_' + gid + '"]').attr('checked', 'checked').change();
$('input[id="invite_dv_' + gid + '"]').attr('checked', 'checked').change();
}
else
{
$('#column_invite_all').attr('checked',null);
}
}
invite_copy = function(gid)
{
//alert($('input[id="invite_av_' + gid + '"]').attr('checked') || null);
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_temple_"]').attr('checked', $('input[id="invite_temple_' + gid + '"]').attr('checked') || null).change();
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_av_"]').attr('checked', $('input[id="invite_av_' + gid + '"]').attr('checked') || null).change();
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_kv_"]').attr('checked', $('input[id="invite_kv_' + gid + '"]').attr('checked') || null).change();
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_bv_"]').attr('checked', $('input[id="invite_bv_' + gid + '"]').attr('checked') || null).change();
$('input[guest_group="guest_group_' + gid + '"]').filter('input[id^="invite_dv_"]').attr('checked', $('input[id="invite_dv_' + gid + '"]').attr('checked') || null).change();
}
propagate_column = function(column)
{
if ($('#column_invite_'+ column).attr('checked') == 'checked')
{
if (confirm('Are you sure?'))
{
$('input[id^="invite_' + column + '_"]:enabled').attr('checked', 'checked').change();
}
else
{
$('#column_invite_'+ column).attr('checked',null);
}
}
}
propagate_column_print = function()
{
if ($('#column_print_all').attr('checked') == 'checked')
{
if (confirm('Are you sure?'))
{
$('input[id^="placecard_print_"]:enabled:not(:checked)').attr('checked', 'checked').change();
}
else
{
//alert('here');
$('#column_print_all').attr('checked',null);
}
}
}
switch_placecard_print = function(gid, venue)
{
$('#ajax_update').load('ajax.php?call=placecards_update&func=print&venue=' + venue + '&gid=' + gid +
'&send=' + val_checkbox($('input[name=placecard_print_' + gid + ']:checked').val()),
function()
{
check_print(gid);
live_field('placecard_print_' + gid);
total_stats_print(venue);
} );
if (document.getElementById('placecard_print_' + gid).checked)
{
//alert('switch_invited');
}
else
{
document.getElementById('column_print_all').checked = false;
}
}
switch_format = function(format, gid, venue)
{
switch (format)
{
case 10,15,20,30,35:
$('#placecard_text_' + gid).attr('readonly', 'readonly');
$('#placecard_text2_' + gid).attr('readonly', 'readonly');
if( $('#div_placecard_text2_' + gid).is(':visible') )
{
//$('#placecard_text2_' + gid).val('').change();
$('#placecard_text2_' + gid).val('');
$('#div_placecard_text2_' + gid).hide();
}
break;
case 40:
$('#placecard_text_' + gid).attr('readonly', null);
$('#placecard_text2_' + gid).attr('readonly', null);
break;
}
$('#ajax_update').load('ajax.php?call=placecards_update&func=format&venue=' + venue + '&gid=' + gid + '&format=' + format +
'&text=' + encodeURIComponent($('#placecard_text_' + gid).val()) +
'&text2=' + encodeURIComponent($('#placecard_text2_' + gid).val()),
function()
{
var json = $('#ajax_update').text();
obj = JSON && JSON.parse(json) || $.parseJSON(json);
$('#placecard_text_' + gid).val($('#ajax_update').text());
$('#placecard_text_' + gid).val(obj.text);
$('#placecard_text2_' + gid).val(obj.text2);
live_field('placecard_text_' + gid);
live_field('placecard_text2_' + gid);
live_field('placecard_format_' + format + '_' + gid);
//live_field('placecard_format_' + gid);
} );
}
total_stats_print = function(venue)
{
$.ajax({
url: "ajax.php?call=placecards_stats&func=print&venue=" + venue,
cache: false,
dataType: "json",
success: function(json) {
$('#total_placecard_print').text(json.total_count);
}
,error: function (request, status, error) { /* alert(status + ", " + error); */ }
})
}
open_format_menu = function(fdiv, iid, line)
{
if ($(fdiv).attr('readonly'))
return;
setTimeout( function() {
var position = $(fdiv).position();
//alert( "left: " + position.left + ", top: " + position.top );
//alert($('#format_menu').height());
$('#format_menu').css({'left' : (position.left + $(fdiv).width() - $('#format_menu').width()) + 'px', 'top' : (position.top - $(fdiv).height() - $('#format_menu').height() - 6) + 'px'});
$('#format_menu').show();
second_line_id = iid;
format_line = line;
}, 400);
}
close_format_menu = function(iid)
{
setTimeout( function() {
$('#format_menu').hide();
second_line_id = 0;
format_line = '';
}, 200);
}
toggle_second_line = function()
{
//alert('second line id: ' + second_line_id);
if( $('#div_placecardtext2_' + second_line_id).is(':visible') )
{
$('#placecard_text2_' + second_line_id).val('').change();
}
$('#div_placecard_text2_' + second_line_id).toggle();
}
insert_shortcut = function(shortcut)
{
switch (shortcut)
{
case 'family' :
$('#placecard_text' + format_line + '_' + second_line_id).val( $('#placecard_text' + format_line + '_' + second_line_id).val() + ' & Family' ).change();
break;
case 'children' :
var iid = second_line_id;
var iid_line = format_line;
$.ajax({
url: "ajax.php?call=placecards_stats&func=shortcut_children&iid=" + iid + "&venue=<?php echo $current_venue; ?>",
cache: false,
dataType: "json",
success: function(json) {
//$('#total_insert_' + iid).text(json.total_count);
$('#placecard_text' + iid_line + '_' + iid).val( $('#placecard_text' + iid_line + '_' + iid).val() + json.shortcut ).change();
}
,error: function (request, status, error) { alert(status + ", " + error);/* */ }
})
break;
}
}
$(document).ready(function()
{
total_stats_print('<?php echo $current_venue; ?>');
})
// ****** 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>Place Cards 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('placecards_by_venue,placecard_labels'); ?>
<?php get_notes(); ?>
<?php get_help_guide('help_placecards'); ?>
<div class="form_message">
<?php
$i = 0;
foreach($ar_venue as $key=>$value) :
$i = $i + 1;
$checked = '';
if ($key == $current_venue) :
$checked = 'checked="checked"';
endif;
?>
<span style="color:#000000;">
<input type="radio" name="venue" id="venue_<?php echo $key; ?>" <?php echo $checked; ?> onclick="window.location.href = 'index.php?IX=placecards&venue=<?php echo $key; ?>'" /><?php echo $value; ?>
</span>
<?php
endforeach;
if ($i <= 0) :
?>
No venues currently defined. Please define at least one venue for the party <a href="index.php?IX=event_form&id=<?php echo $_SESSION['active_event']; ?>">here</a>.
<?php
return;
endif;
?>
</div>
<?php include('mod/_db_navigator_bar.php'); ?>
<div id="ajax_update" style="width:300px; height:300px; 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 colspan="4" align="center" class="data-grid-label">
</td>
<td colspan="6" align="center" class="data-grid-label">
Format Type
</td>
<td align="center" class="data-grid-label">
</td>
</tr>
<tr>
<td align="center" class="data-grid-label vert_cell" width="175">
Name
</td>
<td align="center" class="data-grid-label vert_cell">
Table No
</td>
<td align="center" class="data-grid-label vert_cell" width="175">
Table Description
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Print Place Card?',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Mr. Joe X',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Mr. & Mrs. Joe X',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Mr. Joe X & Mrs. Ann Y',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Joe X',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Joe X & Ann Y',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell">
<?php echo vert_text('Custom',$vert_text_size,array(0x0C, 0x0C, 0x0C)); ?>
</td>
<td align="center" class="data-grid-label vert_cell" width="225">
Format Preview
</td>
</tr>
<tr>
<td align="left" class="data-grid-label">
Totals
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td id="total_placecard_print" align="right" class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="data-grid-var">
Mark all »
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var" align="center">
<input name="column_print_all" id="column_print_all" type="checkbox" value="1" onchange="propagate_column_print();" />
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
<td class="data-grid-var">
</td>
</tr>
<?php
$primary_guest_id = 0;
while($row = mysqli_fetch_object($result)) :
?>
<tr>
<td class="data-grid-var" style="min-width:140px;" >
<?php
$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;
endif;
*/
if ($row->guest_type == 'C') :
$italic = 'italic';
else :
$italic = '';
endif;
?>
<a href="index.php?IX=guest_form&id=<?php echo $row->id; ?>&ref=placecards" class="<?php echo $italic; ?>" >
<?php echo format_guest_name_string($row->salutation, $row->first_name, $row->last_name, $row->suffix); ?>
</a>
</td>
<td class="data-grid-var" align="right">
<?php echo $row->table_no; ?>
</td>
<td class="data-grid-var" align="left" >
<div style="max-width:175px; white-space:nowrap; overflow:hidden; text-overflow:clip;">
<?php echo $row->table_desc; ?>
</div>
</td>
<td class="data-grid-var" align="center">
<input name="placecard_print_<?php echo $row->id; ?>" id="placecard_print_<?php echo $row->id; ?>" type="checkbox" value="1" onchange="switch_placecard_print(<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue} == '1') : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_10_<?php echo $row->id; ?>" type="radio" value="10" onchange="switch_format(10,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 10) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_20_<?php echo $row->id; ?>" type="radio" value="20" onchange="switch_format(20,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 20) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_30_<?php echo $row->id; ?>" type="radio" value="30" onchange="switch_format(30,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 30) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_15_<?php echo $row->id; ?>" type="radio" value="15" onchange="switch_format(15,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 15) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_35_<?php echo $row->id; ?>" type="radio" value="35" onchange="switch_format(35,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 35) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_format_<?php echo $row->id; ?>" id="placecard_format_40_<?php echo $row->id; ?>" type="radio" value="40" onchange="switch_format(40,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" <?php if ($row->{'placecard_'.$current_venue.'_format'} == 40) : echo 'checked="checked"'; endif; ?> />
</td>
<td class="data-grid-var" align="center">
<input name="placecard_text_<?php echo $row->id; ?>" id="placecard_text_<?php echo $row->id; ?>" type="text" value="<?php echo $row->{'placecard_'.$current_venue.'_text'}; ?>" maxlength="50" style="width:225px; font-size:12px;" onchange="switch_format(40,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" onfocus="open_format_menu(this, <?php echo $row->id; ?>, '');" onblur="close_format_menu();" <?php if ($row->{'placecard_'.$current_venue.'_format'} != 40) : echo 'readonly="readonly"'; endif; ?> />
<div id="div_placecard_text2_<?php echo $row->id; ?>" <?php if ($row->{'placecard_'.$current_venue} != '1' || empty($row->{'placecard_'.$current_venue.'_text2'})) : echo 'style="display:none;"'; endif; ?> >
<input name="placecard_text2_<?php echo $row->id; ?>" id="placecard_text2_<?php echo $row->id; ?>" type="text" value="<?php if ($row->{'placecard_'.$current_venue} == '1') : echo $row->{'placecard_'.$current_venue.'_text2'}; endif; ?>" maxlength="50" style="width:225px; font-size:12px;" onchange="switch_format(40,<?php echo $row->id; ?>, '<?php echo $current_venue; ?>');" onfocus="open_format_menu(this, <?php echo $row->id; ?>, '2');" onblur="close_format_menu();" <?php if ($row->{'placecard_'.$current_venue.'_format'} != 40) : echo ' readonly="readonly" '; endif; if ($row->{'placecard_'.$current_venue} != '1') : echo ' disabled="disabled" '; endif; ?> />
</div>
</td>
</tr>
<script>
check_print(<?php echo $row->id; ?>);
</script>
<?php
endwhile;
?>
</tbody>
</table>
<div id="format_menu" class="report_select" style="display:none;">
<div style="float:right; width:20%; text-align:right; cursor:pointer; font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;" onclick="close_format_menu();">
X
</div>
<div style="float:none; width:80%; text-align:left; font-style:italic;">
Format options:
</div>
<ul>
<a href="javascript:toggle_second_line();"><li>Toggle 2nd line</li></a>
<a href="javascript:insert_shortcut('family');"><li>Insert " & Family"</li></a>
<a href="javascript:insert_shortcut('children');"><li>Insert children's names</li></a>
</ul>
</div>
</div>