<?php
global $search;

$search = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_STRING);

require_once("include/pageLayout.inc");
require_once("include/bdmo.inc");
require_once("include/searchcatalog.inc");
require_once("include/search.inc");

$majmax = lastupdate();
$message = "";

$getMessage = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_STRING);
$getMoteur = filter_input(INPUT_GET, 'moteur', FILTER_SANITIZE_STRING);
$key = filter_input(INPUT_COOKIE, 'key', FILTER_SANITIZE_STRING);
$page = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
	$search = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_STRING);
	$val = filter_input(INPUT_GET, 'val', FILTER_DEFAULT);
	$type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING);

if ($getMessage == "sent") {
    $message = $captMessageSent;
}


$and = " AND (disque.enstock = 1 OR (disque.enstock = 0 AND disque.epuise = 0))";

if ($page == null) {
    $page = 1;
}

entete();

if (strlen($val)>0) {

	findcatalog($search, $val, $support, $page, $and);
} elseif (isset($key)) {

?>
<BR><BR>
</TD>
<TD VALIGN="top">
	<p><BR><BR><?= $captCatalogFormText ?></p>
	<?= $captCatalogForm ?>
	<strong><?= $message ?></strong>
	</TD>
</TR>
</TABLE>
<BR>
<BR>
<BR>
<?php

} else  {
    echo $captWarningNeedLogin;
}

footer();
