Ejemplo n.º 1
0
function print_response($status, $headers, $content)
{
    $strheaders = encode_data($headers);
    $content_type = $headers['content-type'];
    if ($content_type && substr($content_type, 0, 4) == 'text') {
        $data = '1' . gzcompress(pack('NNN', $status, strlen($strheaders), strlen($content)) . $strheaders . $content);
    } else {
        $data = '0' . pack('NNN', $status, strlen($strheaders), strlen($content)) . $strheaders . $content;
    }
    header('Content-Type: image/gif');
    header('Content-Length: ' . strlen($data));
    print $data;
}
Ejemplo n.º 2
0
function print_response($status, $headers, $content)
{
    $strheaders = encode_data($headers);
    $content_type = isset($headers['content-type']) ? $headers['content-type'] : '';
    if ($content_type && (substr($content_type, 0, 5) == 'text/' || substr($content_type, 0, 16) == 'application/json' || substr($content_type, 0, 22) == 'application/javascript')) {
        $data = '1' . gzcompress(pack('NNN', $status, strlen($strheaders), strlen($content)) . $strheaders . $content);
    } else {
        $data = '0' . pack('NNN', $status, strlen($strheaders), strlen($content)) . $strheaders . $content;
    }
    header('Content-Type: text/html');
    header('Content-Length: ' . strlen($data));
    print $data;
}
Ejemplo n.º 3
0
 protected function sendResponse($code, $headers, $content = '')
 {
     header('Content-Type: application/octet-stream');
     $headers = encode_data($headers);
     $raw_data = pack('N3', $code, strlen($headers), strlen($content)) . $headers . $content;
     if ($code == 206) {
         $data = '0' . $raw_data;
     } else {
         $data = gzcompress($raw_data, 9);
         $data = strlen($raw_data) > strlen($data) ? '1' . $data : '0' . $raw_data;
     }
     echo xor_data($data, $this->siteKey);
     header('Content-Length: ' . ob_get_length());
 }
Ejemplo n.º 4
0
			We oefenen in kleine groepjes in ons groot leslokaal.<br />
			De workshopdata voor dit trimester zijn: check
		    </p>
		    <table border="0" cellspacing="0" cellpadding="0" class="workshops-list">
			<?php 
        function encode_data($data)
        {
            return utf8_encode($data);
        }
        $db = new DB($DATABASE_NAME, $DATABASE_HOST, $DATABASE_USER, $DATABASE_PASSWORD);
        $result = $db->query("SELECT short_description, long_description, DATE_FORMAT(`date`, '%W') as `day`, DATE_FORMAT(`date`, '%d-%m-%Y') AS `date_sorted`, DATE_FORMAT(time_start, '%H:%i') AS time_start, DATE_FORMAT(time_end, '%H:%i') AS time_end FROM workshopdata LEFT JOIN workshoptype ON workshopdata.type_id = workshoptype.id WHERE workshoptype.id = 1 ORDER BY `date` DESC, time_start DESC");
        while ($line = $db->fetchNextObject($result)) {
            if (!$onlyDate) {
                print '<tr>';
                print '<td class="td-short-description"><div class="short-description">' . encode_data($line->short_description) . '</div></td>';
                print '<td><div class="long-description">' . encode_data($line->long_description) . '</div></td>';
                print '</tr>';
            }
            print '<tr>';
            if (!$onlyDate) {
                print '<td></td>';
            }
            print '<td><div class="datetime">' . getDutchDay($line->day) . ' ' . $line->date_sorted . ' van ' . $line->time_start . ' tot ' . $line->time_end . '</div></td>';
            print '</tr>';
        }
        $db->close();
        ?>
		    </table>
		</div>
		<div id="praktijk-uitspraakvolwassenen">
		    <h1>Uitspraak volwassenen</h1>