<?php
// load the error handling module
//require_once('error_handler.php');
// make sure the user's browser doesn't cache the result
header('Expires: Wed, 23 Dec 1980 00:30:00 GMT'); // time in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Type: text/html; charset=iso-8859-1');

// hier gaan we de antiquaar gegevens inzetten: owner_id en searchform
$antid = 'coll';
$searchform = urlencode("http://www.picasoft.nl/demo");
/*
print "<pre>";
print_r($_REQUEST);
print "</pre>";
//*/

$aut = $_REQUEST['auteur'];
$tit = $_REQUEST['titel'];
$key = $_REQUEST['key'];


$aut = urlencode($_REQUEST['auteur']);
$tit = urlencode($_REQUEST['titel']);
$bes = urlencode($_REQUEST['descr']);
$yer = $_REQUEST['year'];
$eew = $_REQUEST['eeuw'];
$key = urlencode($_REQUEST['key']);
$frs = $_REQUEST['first'];
$sig = $_REQUEST['signed'];
$bnd = $_REQUEST['band1'];
$bn2 = $_REQUEST['band2'];
$jck = $_REQUEST['jacket'];
$snc = $_REQUEST['since'];

$pag = $_REQUEST['page'];	// huidige pagina
$cur = $_REQUEST['cursor'];	// << < > >>
$len = $_REQUEST['length'];	// aantal gevonden boeken
//$antid = $_REQUEST['antid'];

$max = ceil ($len / 10);  // aantal resultaatpagina's
if (!$pag) {
	$pag = 1;
	}
if ($pag > $max) {
	$pag = $max;
	}

if ($cur && $cur != '') {
	if ($cur == '<<<') {
		$pag = 1;
		}
	if ($cur == '>>>') {
		$pag = $max;
		}
	if ($cur == '<' && $pag > '1') {
		$pag--;
		}
	if ($cur == '>' && $pag < $max) {
		$pag++;
		}
	}
$data="antid=$antid&auteur=$aut&titel=$tit&descr=$bes&year=$yer&eeuw=$eew&key=$key&first=$frs&signed=$sig&band1=$bnd&band2=$bn2&jacket=$jck&since=$snc&page=$pag&length=$len&zoekform=$searchform";
//print $data;
//print "<br>zoekfull.php";

print "<br />";
$open = fopen("http://www.antiqbook.com/picasearchfull.php?$data", "r"); 

while (!feof($open)) {
	$data = fgets($open, 2000);
	print $data;
	}

fclose($open);

exit();


?>
