| 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/ |
Upload File : |
<?php
define('TIMEZONE', 'America/New_York');
date_default_timezone_set(TIMEZONE);
session_start();
require_once('mod/_sanitize.php');
include_once('db_conn.php');
$con = mysqli_connect($db_server,$db_user,$db_pwd, $GLOBALS["db_name"]);
if (!$con) :
die('Could not connect!');
else :
mysqli_set_charset($con, "UTF8");
$sql_tz = "SET time_zone = 'America/New_York'";
mysqli_query($GLOBALS['con'], $sql_tz);
endif;
include_once('mod/_functions.php');
$rpt = mysqli_real_escape_string($GLOBALS['con'], $_GET['rpt']);
$fmt = mysqli_real_escape_string($GLOBALS['con'], $_POST['output_format']);
//echo 'FMT '.$fmt;
if (!empty($_SESSION['logged_in']) && !empty($_SESSION['user_id']) && !empty($_SESSION['active_event']) && $_SESSION['logged_in'] == true) :
$authorized_call = 1;
$_SESSION['timeout'] = time() + $app_timeout;
if ($fmt == 'pdf' || $fmt == 'doc') :
ob_start();
endif;
?>
<html>
<head>
<title>Mitzvah Organizer Report</title>
<?php
if ($fmt == 'doc') :
/*
echo '<style>'."\r\n";
echo file_get_contents($app_base.'css/main.css?ver='.filemtime(__DIR__.'/css/main.css'))."\r\n";
echo file_get_contents($app_base.'css/report.css?ver='.filemtime(__DIR__.'/css/report.css'))."\r\n";
echo '</style>'."\r\n";
*/
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
else :
?>
<link rel="stylesheet" href="css/main.css?ver=<?php echo filemtime(__DIR__.'/css/main.css') ?>" type="text/css" >
<link rel="stylesheet" href="css/report.css?ver=<?php echo filemtime(__DIR__.'/css/report.css') ?>" type="text/css" >
<?php
endif;
?>
</head>
<body>
<?php
if ($fmt == 'html') :
?>
<center>
<input type="button" value="Print" onClick="window.print();" class="noprint" style="margin-bottom:10px;">
</center>
<?php
endif;
include_once('rpt/'.$rpt.'.php');
?>
</body>
</html>
<?php
if ($fmt == 'pdf') :
$html = ob_get_clean();
ini_set('display_errors', '0');
ini_set("pcre.backtrack_limit","10000000");
ini_set("memory_limit","1024M");
include("mpdf61/mpdf.php");
$mpdf=new mPDF('','Letter','','',12,12,25,15,10,10);
$mpdf->debug = false;
$mpdf->useOnlyCoreFonts = false; // false is default
//$mpdf->SetAutoFont(AUTOFONT_RTL);
$mpdf->keep_table_proportions = true;
//$mpdf->SetProtection(array('copy','print'));
$mpdf->SetProtection(array('copy','print','modify','annot-forms','fill-forms','extract','assemble','print-highres'), '', '');
$mpdf->SetTitle("MitzvahOrganizer.com - Report");
$mpdf->SetAuthor("MitzvahOrganizer.com");
//$mpdf->SetWatermarkText("MitzvahOrganizer.com");
//$mpdf->showWatermarkText = true;
//$mpdf->watermark_font = 'DejaVuSansCondensed';
//$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetHTMLHeader('<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 10pt; color: #000000; font-weight: bold; font-style: italic;"><tr>'.
'<td width="50%"><span style="font-weight: bold; font-style: italic;">'.get_event_field('event_name').'</span></td>'.
'<td width="50%" style="text-align: right; ">Bar/Bat Mitzvah Date: '.nzdate_display(get_event_field('event_date')).'</td>'.
'</tr><tr><td colspan="2" align="center" style="font-weight: bold; font-style: italic; font-size:20px;">'.htmlspecialchars(get_report_name($rpt)).'</td></tr></table>');
$mpdf->SetHTMLFooter('<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt; color: #000000; font-weight: bold; font-style: italic;"><tr>'.
'<td width="33%"><span style="font-weight: bold; font-style: italic;">{DATE m/j/Y}</span></td>'.
'<td width="33%" align="center" style="font-weight: bold; font-style: italic;">Page {PAGENO} of {nbpg}</td>'.
'<td width="33%" style="text-align: right; ">Registered to: '.$_SESSION['user_first_name'].' '.$_SESSION['user_last_name'].'</td>'.
'</tr></table>');
$mpdf->SetDisplayMode('fullpage');
//$html = $_REQUEST['pdf_html'];
//echo $html;
//echo strlen($html);
$mpdf->WriteHTML($html);
$mpdf->Output();
elseif ($fmt == 'doc') :
$filename = 'Mitzvah_Organizer_'.$rpt.'.doc';
$html = ob_get_clean();
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment; filename=".$filename);
echo $html;
endif;
else :
echo 'Not Authorized!';
endif;
session_write_close();
function report_fixed_footer()
{
global $fmt;
global $rpt;
if ($fmt == 'html') :
?>
<tr class="page_header">
<td colspan="99">
</td>
</tr>
<tr class="page_header">
<td colspan="99">
<div style="width:33%; float:left; font-size:12px; font-style:italic; text-align:left;" >
<?php echo date('m/d/Y'); ?>
</div>
<div style="width:33%; float:left; font-size:12px; font-style:italic; text-align:center;" >
</div>
<div style="width:33%; float:left; font-size:12px; font-style:italic; text-align:right;" >
<?php echo 'Registered to: '.$_SESSION['user_first_name'].' '.$_SESSION['user_last_name']; ?>
</div>
</td>
</tr>
<?php
endif;
}
function report_fixed_header()
{
global $fmt;
global $rpt;
if ($fmt == 'html') :
?>
<tr class="page_header">
<td colspan="99">
<div style="width:50%; float:left; font-size:12px; font-style:italic; text-align:left;" >
<?php echo get_event_field('event_name'); ?>
</div>
<div style="width:50%; float:left; font-size:12px; font-style:italic; text-align:right;" >
Bar/Bat Mitzvah Date: <?php echo nzdate_display(get_event_field('event_date')); ?>
</div>
</td>
</tr>
<tr class="page_header">
<td colspan="99">
</td>
</tr>
<tr class="page_header">
<td colspan="99" align="center" style="font-size:20px;">
<?php echo htmlspecialchars(get_report_name($rpt)); ?>
</td>
</tr>
<tr class="page_header">
<td colspan="99">
</td>
</tr>
<?php
endif;
}
?>