Example #1
0
{
    $token = maketoken($sqldate, $id);
    $list = explode(",", $_COOKIE["myevents"]);
    for ($i = 0; $list[$i]; $i++) {
        if ($list[$i] == $token) {
            return TRUE;
        }
    }
    return FALSE;
}
# Connect to MySQL
$conn = mysql_connect(DBHOST, DBUSER, DBPASSWORD) or die(mysql_error());
mysql_select_db(DBDATABASE, $conn);
# Start the PDF output
$args = array('folds' => 1, 'borders' => 0);
$pdf = new pmPDF($args);
$pdf->SetFont('Helvetica');
$pdf->SetFontSize($_REQUEST["micro"] == "" ? 8 : 6);
if ($_REQUEST["image"] == "") {
    $firstpage = 1;
} else {
    $pdf->add_image("images/pp08logo.jpg", 1);
    $firstpage = 2;
}
# Fetch a list of all events, including the ones we won't print
$sql = "SELECT * FROM calevent, caldaily WHERE calevent.id = caldaily.id AND eventdate >= '{$startdate}' AND eventdate <= '{$enddate}' AND eventstatus<>'E' AND eventstatus<>'S' AND eventstatus<>'C' ORDER BY eventdate, eventtime";
$result = mysql_query($sql, $conn) or die(mysql_error());
# for each event...
$thisdate = "";
while ($record = mysql_fetch_array($result)) {
    # If we care about this event...