amon key
[contractdashboard.git] / search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
 
/*
  search ABNs
  search agency name
  search categories
  search supplier names
  --search supplier postcodes/suburbs/cities--
  search CN number
  search description full text
 */
include('./lib/common.inc.php');
if ($_REQUEST['searchID']) {
    $searchIDParts = explode("-", $_REQUEST['searchID']);
    $type = array_shift($searchIDParts);
    $host = $_SERVER['HTTP_HOST'];
    $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
 
    if ($type == "agency") {
        header("Location: http://$host$uri/displayAgency.php?agency=" . implode("-", $searchIDParts));
    }
    if ($type == "supplier") {
        header("Location: http://$host$uri/displaySupplier.php?supplier=" . implode("-", $searchIDParts));
    }
        if ($type == "cnid") {
        header("Location: http://$host$uri/displayContract.php?CNID=" . implode("-", $searchIDParts));
    }
    exit;
} else {
    include_header("Search Results");
    print_r($_REQUEST);
    include_footer();
}
?>