| 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/mitzvahm/planner/rpt/ |
Upload File : |
<?php include('mod/_mod_security.php'); ?>
<?php
if ($_POST['sort'] == "family") :
$sort = " sort_name, sort_id, sort_type ASC ";
$sort_name = 'Grouped by Family';
else :
$sort = " g1.last_name ASC, g1.first_name ASC ";
$sort_name = 'Alphabetical';
endif;
$sql = "SELECT g1.id, g1.last_name, g1.first_name, g1.rsvp_".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['venue']))." AS rsvp_type ".
",IF(g1.guest_type = 'P', g1.id, g1.primary_guest_id) AS sort_id ".
",(CASE g1.guest_type WHEN 'P' THEN 0 WHEN 'S' THEN 1 WHEN 'C' THEN 2 ELSE 3 END) 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 ".
"FROM guests g1 WHERE g1.rsvp_".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['venue']))." > 0 AND ".
"g1.user_id = ".$_SESSION['user_id']." AND g1.event_id = ".$_SESSION['active_event']." ORDER BY ".$sort;
$result = mysqli_query($GLOBALS['con'], $sql) or die('Database error!');
//$result = mysqli_query($GLOBALS['con'], $sql) or die(mysqli_error($GLOBALS['con']).' ==='.$sql.'===');
if (mysqli_num_rows($result) <= 0) :
echo 'No data for report!';
exit();
endif;
?>
<table align="center" cellpadding="0" cellspacing="2" border="0">
<thead>
<?php report_fixed_header(); ?>
<tr class="page_header">
<td colspan="5"style="font-size:18px;">
<?php echo venue_decode(mysqli_real_escape_string($GLOBALS['con'], trim($_POST['venue']))); ?>
</td>
</tr>
<tr>
<td width="150" align="center">
Last Name
</td>
<td width="150" align="center">
First Name
</td>
<td width="50" align="center">
RSVP Yes
</td>
<td width="50" align="center">
RSVP No
</td>
<td width="80" align="center">
Guest ID #
</td>
</tr>
</thead>
<tfoot>
<?php report_fixed_footer(); ?>
</tfoot>
<tbody>
<?php
$total_yes = 0;
$total_no = 0;
$sort_id_hold = 0;
$ix = 0;
while($row = mysqli_fetch_object($result)) :
$ix++;
if ($_POST['sort'] == "family" && $sort_id_hold != $row->sort_id) :
if ($ix > 1) :
echo '<tr><td colspan="5"><hr /></td></tr>';
endif;
$sort_id_hold = $row->sort_id;
endif;
switch ($row->rsvp_type) :
case 1 :
$total_yes = $total_yes + 1;
break;
case 2 :
$total_no = $total_no + 1;
break;
endswitch;
?>
<tr>
<td>
<?php echo $row->last_name; ?>
</td>
<td>
<?php echo $row->first_name; ?>
</td>
<td align="center">
<?php
if ($row->rsvp_type == 1) :
echo 'X';
endif;
?>
</td>
<td align="center">
<?php
if ($row->rsvp_type == 2) :
echo 'X';
endif;
?>
</td>
<td>
<?php echo $row->id; ?>
</td>
</tr>
<?php
endwhile;
?>
<tr>
<td>
Total:
</td>
<td align="right">
<?php echo mysqli_num_rows($result); ?>
</td>
<td align="right">
<?php echo $total_yes; ?>
</td>
<td align="right">
<?php echo $total_no; ?>
</td>
<td>
</td>
</tr>
</tbody>
</table>