<?php require_once('Connections/connNids.php'); ?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAReport;
//Searchpage: HBCCSearch.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_GET["Search"]) && $_GET["Search"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromEdit("id","S_id","AND","=",1);
$WADbSearch1->addComparisonFromEdit("submittedDate","S_submittedDate","AND","=",2);
$WADbSearch1->addComparisonFromEdit("event_date","S_event_date","AND","=",2);
$WADbSearch1->addComparisonFromEdit("event_country","S_event_country","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("event_state_us","S_event_state_us","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("event_province_ca","S_event_province_ca","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("short_description","S_short_description","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("long_description","S_long_description","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload1","S_upload1","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload2","S_upload2","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload3","S_upload3","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("_fivehundfeet","S__fivehundfeet","AND","Includes",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_HBCCResults"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_HBCCResults"]) && $_SESSION["WADbSearch1_HBCCResults"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_HBCCResults"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAReport;
//Searchpage: HBCCSearch.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_GET["Search"]) && $_GET["Search"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromEdit("id","S_id","AND","=",1);
$WADbSearch1->addComparisonFromEdit("submittedDate","S_submittedDate","AND","=",2);
$WADbSearch1->addComparisonFromEdit("event_date","S_event_date","AND","=",2);
$WADbSearch1->addComparisonFromEdit("event_country","S_event_country","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("event_state_us","S_event_state_us","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("event_province_ca","S_event_province_ca","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("short_description","S_short_description","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("long_description","S_long_description","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload1","S_upload1","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload2","S_upload2","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("upload3","S_upload3","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("_fivehundfeet","S__fivehundfeet","AND","Includes",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_HBCCResults"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_HBCCResults"]) && $_SESSION["WADbSearch1_HBCCResults"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_HBCCResults"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
?>
<?php
$maxRows_WADAReport = 1000;
$pageNum_WADAReport = 0;
if (isset($_GET['pageNum_WADAReport'])) {
$pageNum_WADAReport = $_GET['pageNum_WADAReport'];
}
$startRow_WADAReport = $pageNum_WADAReport * $maxRows_WADAReport;
mysql_select_db($database_connNids, $connNids);
$query_WADAReport = "SELECT id, submittedDate, event_date, event_country, event_state_us, event_province_ca, short_description, upload1, upload2, upload3, _fivehundfeet FROM Report ORDER BY id ASC";
setQueryBuilderSource($query_WADAReport,$WADbSearch1,false);
$query_limit_WADAReport = sprintf("%s LIMIT %d, %d", $query_WADAReport, $startRow_WADAReport, $maxRows_WADAReport);
$WADAReport = mysql_query($query_limit_WADAReport, $connNids) or die(mysql_error());
$row_WADAReport = mysql_fetch_assoc($WADAReport);
if (isset($_GET['totalRows_WADAReport'])) {
$totalRows_WADAReport = $_GET['totalRows_WADAReport'];
} else {
$all_WADAReport = mysql_query($query_WADAReport);
$totalRows_WADAReport = mysql_num_rows($all_WADAReport);
}
$totalPages_WADAReport = ceil($totalRows_WADAReport/$maxRows_WADAReport)-1;
?>
<?php
$maxRows_WADAReport = 1000;
$pageNum_WADAReport = 0;
if (isset($_GET['pageNum_WADAReport'])) {
$pageNum_WADAReport = $_GET['pageNum_WADAReport'];
}
$startRow_WADAReport = $pageNum_WADAReport * $maxRows_WADAReport;
mysql_select_db($database_connNids, $connNids);
$query_WADAReport = "SELECT id, submittedDate, event_date, event_country, event_state_us, event_province_ca, short_description, upload1, upload2, upload3, _fivehundfeet FROM Report ORDER BY id ASC";
setQueryBuilderSource($query_WADAReport,$WADbSearch1,false);
$query_limit_WADAReport = sprintf("%s LIMIT %d, %d", $query_WADAReport, $startRow_WADAReport, $maxRows_WADAReport);
$WADAReport = mysql_query($query_limit_WADAReport, $connNids) or die(mysql_error());
$row_WADAReport = mysql_fetch_assoc($WADAReport);
if (isset($_GET['totalRows_WADAReport'])) {
$totalRows_WADAReport = $_GET['totalRows_WADAReport'];
} else {
$all_WADAReport = mysql_query($query_WADAReport);
$totalRows_WADAReport = mysql_num_rows($all_WADAReport);
}
$totalPages_WADAReport = ceil($totalRows_WADAReport/$maxRows_WADAReport)-1;
?>
<?php
$queryString_WADAReport = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAReport") == false &&
stristr($param, "totalRows_WADAReport") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAReport = "&" . htmlentities(implode("&", $newParams));
}
}