| Current Path : /var/www/cesa.co.za/echasl23/ |
| Current File : /var/www/cesa.co.za/echasl23/AwardsEntriessrch.php |
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "AwardsEntriesinfo.php" ?>
<?php include "adminusersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Create page object
$AwardsEntries_search = new cAwardsEntries_search();
$Page =& $AwardsEntries_search;
// Page init
$AwardsEntries_search->Page_Init();
// Page main
$AwardsEntries_search->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var AwardsEntries_search = new ew_Page("AwardsEntries_search");
// page properties
AwardsEntries_search.PageID = "search"; // page ID
AwardsEntries_search.FormID = "fAwardsEntriessearch"; // form ID
var EW_PAGE_ID = AwardsEntries_search.PageID; // for backward compatibility
// extend page with validate function for search
AwardsEntries_search.ValidateSearch = function(fobj) {
ew_PostAutoSuggest(fobj);
if (this.ValidateRequired) {
var infix = "";
elm = fobj.elements["x" + infix + "_DateCreated"];
if (elm && !ew_CheckDate(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($AwardsEntries->DateCreated->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_AwardYear"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($AwardsEntries->AwardYear->FldErrMsg()) ?>");
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj))
return false;
}
for (var i=0; i<fobj.elements.length; i++) {
var elem = fobj.elements[i];
if (elem.name.substring(0,2) == "s_" || elem.name.substring(0,3) == "sv_")
elem.value = "";
}
return true;
}
// extend page with Form_CustomValidate function
AwardsEntries_search.Form_CustomValidate =
function(fobj) { // DO NOT CHANGE THIS LINE!
// Your custom validation code here, return false if invalid.
return true;
}
<?php if (EW_CLIENT_VALIDATE) { ?>
AwardsEntries_search.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
AwardsEntries_search.ValidateRequired = false; // no JavaScript validation
<?php } ?>
//-->
</script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js");
//-->
</script>
<p><span class="phpmaker"><?php echo $Language->Phrase("Search") ?> <?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $AwardsEntries->TableCaption() ?><br><br>
<a href="<?php echo $AwardsEntries->getReturnUrl() ?>"><?php echo $Language->Phrase("BackToList") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$AwardsEntries_search->ShowMessage();
?>
<form name="fAwardsEntriessearch" id="fAwardsEntriessearch" action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return AwardsEntries_search.ValidateSearch(this);">
<p>
<input type="hidden" name="t" id="t" value="AwardsEntries">
<input type="hidden" name="a_search" id="a_search" value="S">
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->DateCreated->FldCaption() ?></td>
<td<?php echo $AwardsEntries->DateCreated->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("BETWEEN") ?><input type="hidden" name="z_DateCreated" id="z_DateCreated" value="BETWEEN"></span></td>
<td<?php echo $AwardsEntries->DateCreated->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<input type="text" name="x_DateCreated" id="x_DateCreated" title="<?php echo $AwardsEntries->DateCreated->FldTitle() ?>" value="<?php echo $AwardsEntries->DateCreated->EditValue ?>"<?php echo $AwardsEntries->DateCreated->EditAttributes() ?>>
</span>
<span class="ewSearchOpr" id="btw1_DateCreated" name="btw1_DateCreated"> <?php echo $Language->Phrase("AND") ?> </span>
<span class="phpmaker" style="float: left;" id="btw1_DateCreated" name="btw1_DateCreated">
<input type="text" name="y_DateCreated" id="y_DateCreated" title="<?php echo $AwardsEntries->DateCreated->FldTitle() ?>" value="<?php echo $AwardsEntries->DateCreated->EditValue2 ?>"<?php echo $AwardsEntries->DateCreated->EditAttributes() ?>>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->AwardYear->FldCaption() ?></td>
<td<?php echo $AwardsEntries->AwardYear->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("=") ?><input type="hidden" name="z_AwardYear" id="z_AwardYear" value="="></span></td>
<td<?php echo $AwardsEntries->AwardYear->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<input type="text" name="x_AwardYear" id="x_AwardYear" title="<?php echo $AwardsEntries->AwardYear->FldTitle() ?>" size="30" value="<?php echo $AwardsEntries->AwardYear->EditValue ?>"<?php echo $AwardsEntries->AwardYear->EditAttributes() ?>>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->PreEntry->FldCaption() ?></td>
<td<?php echo $AwardsEntries->PreEntry->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("=") ?><input type="hidden" name="z_PreEntry" id="z_PreEntry" value="="></span></td>
<td<?php echo $AwardsEntries->PreEntry->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<div id="tp_x_PreEntry" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x_PreEntry" id="x_PreEntry" title="<?php echo $AwardsEntries->PreEntry->FldTitle() ?>" value="{value}"<?php echo $AwardsEntries->PreEntry->EditAttributes() ?>></label></div>
<div id="dsl_x_PreEntry" repeatcolumn="5">
<?php
$arwrk = $AwardsEntries->PreEntry->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($AwardsEntries->PreEntry->AdvancedSearch->SearchValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x_PreEntry" id="x_PreEntry" title="<?php echo $AwardsEntries->PreEntry->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $AwardsEntries->PreEntry->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->Firm_Name->FldCaption() ?></td>
<td<?php echo $AwardsEntries->Firm_Name->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_Firm_Name" id="z_Firm_Name" value="LIKE"></span></td>
<td<?php echo $AwardsEntries->Firm_Name->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<input type="text" name="x_Firm_Name" id="x_Firm_Name" title="<?php echo $AwardsEntries->Firm_Name->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $AwardsEntries->Firm_Name->EditValue ?>"<?php echo $AwardsEntries->Firm_Name->EditAttributes() ?>>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->Award_Category->FldCaption() ?></td>
<td<?php echo $AwardsEntries->Award_Category->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("=") ?><input type="hidden" name="z_Award_Category" id="z_Award_Category" value="="></span></td>
<td<?php echo $AwardsEntries->Award_Category->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<div id="as_x_Award_Category" style="z-index: 8940">
<input type="text" name="sv_x_Award_Category" id="sv_x_Award_Category" value="<?php echo $AwardsEntries->Award_Category->EditValue ?>" title="<?php echo $AwardsEntries->Award_Category->FldTitle() ?>" size="30"<?php echo $AwardsEntries->Award_Category->EditAttributes() ?>> <span id="em_x_Award_Category" class="ewMessage" style="display: none"><?php echo $Language->Phrase("UnmatchedValue") ?></span>
<div id="sc_x_Award_Category"></div>
</div>
<input type="hidden" name="x_Award_Category" id="x_Award_Category" value="<?php echo $AwardsEntries->Award_Category->AdvancedSearch->SearchValue ?>">
<?php
$sSqlWrk = "SELECT DISTINCT `Award_Category` FROM `AwardsEntries`";
$sWhereWrk = "`Award_Category` LIKE '{query_value}%'";
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `Award_Category` Asc";
$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x_Award_Category" id="s_x_Award_Category" value="<?php echo $sSqlWrk ?>">
<script type="text/javascript">
<!--
var oas_x_Award_Category = new ew_AutoSuggest("sv_x_Award_Category", "sc_x_Award_Category", "s_x_Award_Category", "em_x_Award_Category", "x_Award_Category", "", false);
//-->
</script>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->Start_Date->FldCaption() ?></td>
<td<?php echo $AwardsEntries->Start_Date->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("BETWEEN") ?><input type="hidden" name="z_Start_Date" id="z_Start_Date" value="BETWEEN"></span></td>
<td<?php echo $AwardsEntries->Start_Date->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<input type="text" name="x_Start_Date" id="x_Start_Date" title="<?php echo $AwardsEntries->Start_Date->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $AwardsEntries->Start_Date->EditValue ?>"<?php echo $AwardsEntries->Start_Date->EditAttributes() ?>>
</span>
<span class="ewSearchOpr" id="btw1_Start_Date" name="btw1_Start_Date"> <?php echo $Language->Phrase("AND") ?> </span>
<span class="phpmaker" style="float: left;" id="btw1_Start_Date" name="btw1_Start_Date">
<input type="text" name="y_Start_Date" id="y_Start_Date" title="<?php echo $AwardsEntries->Start_Date->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $AwardsEntries->Start_Date->EditValue2 ?>"<?php echo $AwardsEntries->Start_Date->EditAttributes() ?>>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->Project_Name->FldCaption() ?></td>
<td<?php echo $AwardsEntries->Project_Name->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_Project_Name" id="z_Project_Name" value="LIKE"></span></td>
<td<?php echo $AwardsEntries->Project_Name->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<input type="text" name="x_Project_Name" id="x_Project_Name" title="<?php echo $AwardsEntries->Project_Name->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $AwardsEntries->Project_Name->EditValue ?>"<?php echo $AwardsEntries->Project_Name->EditAttributes() ?>>
</span>
</div>
</td>
</tr>
<tr<?php echo $AwardsEntries->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $AwardsEntries->JV_Consent->FldCaption() ?></td>
<td<?php echo $AwardsEntries->JV_Consent->CellAttributes() ?>><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_JV_Consent" id="z_JV_Consent" value="LIKE"></span></td>
<td<?php echo $AwardsEntries->JV_Consent->CellAttributes() ?>>
<div style="white-space: nowrap;">
<span class="phpmaker" style="float: left;">
<textarea name="x_JV_Consent" id="x_JV_Consent" title="<?php echo $AwardsEntries->JV_Consent->FldTitle() ?>" cols="35" rows="4"<?php echo $AwardsEntries->JV_Consent->EditAttributes() ?>><?php echo $AwardsEntries->JV_Consent->EditValue ?></textarea>
</span>
</div>
</td>
</tr>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="Action" id="Action" value="<?php echo ew_BtnCaption($Language->Phrase("Search")) ?>">
<input type="button" name="Reset" id="Reset" value="<?php echo ew_BtnCaption($Language->Phrase("Reset")) ?>" onclick="ew_ClearForm(this.form);">
</form>
<script language="JavaScript" type="text/javascript">
<!--
// Write your table-specific startup script here
// document.write("page loaded");
//-->
</script>
<?php include "footer.php" ?>
<?php
$AwardsEntries_search->Page_Terminate();
?>
<?php
//
// Page class
//
class cAwardsEntries_search {
// Page ID
var $PageID = 'search';
// Table name
var $TableName = 'AwardsEntries';
// Page object name
var $PageObjName = 'AwardsEntries_search';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $AwardsEntries;
if ($AwardsEntries->UseTokenInUrl) $PageUrl .= "t=" . $AwardsEntries->TableVar . "&"; // Add page token
return $PageUrl;
}
// Page URLs
var $AddUrl;
var $EditUrl;
var $CopyUrl;
var $DeleteUrl;
var $ViewUrl;
var $ListUrl;
// Export URLs
var $ExportPrintUrl;
var $ExportHtmlUrl;
var $ExportExcelUrl;
var $ExportWordUrl;
var $ExportXmlUrl;
var $ExportCsvUrl;
// Update URLs
var $InlineAddUrl;
var $InlineCopyUrl;
var $InlineEditUrl;
var $GridAddUrl;
var $GridEditUrl;
var $MultiDeleteUrl;
var $MultiUpdateUrl;
// Message
function getMessage() {
return @$_SESSION[EW_SESSION_MESSAGE];
}
function setMessage($v) {
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
} else {
$_SESSION[EW_SESSION_MESSAGE] = $v;
}
}
// Show message
function ShowMessage() {
$sMessage = $this->getMessage();
$this->Message_Showing($sMessage);
if ($sMessage <> "") { // Message in Session, display
echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
}
}
// Validate page request
function IsPageRequest() {
global $objForm, $AwardsEntries;
if ($AwardsEntries->UseTokenInUrl) {
if ($objForm)
return ($AwardsEntries->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($AwardsEntries->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (AwardsEntries)
$GLOBALS["AwardsEntries"] = new cAwardsEntries();
// Table object (adminusers)
$GLOBALS['adminusers'] = new cadminusers();
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'search', TRUE);
// Table name (for backward compatibility)
if (!defined("EW_TABLE_NAME"))
define("EW_TABLE_NAME", 'AwardsEntries', TRUE);
// Start timer
$GLOBALS["gsTimer"] = new cTimer();
// Open connection
$conn = ew_Connect();
}
//
// Page_Init
//
function Page_Init() {
global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
global $AwardsEntries;
// User profile
$UserProfile = new cUserProfile();
$UserProfile->LoadProfile(@$_SESSION[EW_SESSION_USER_PROFILE]);
// Security
$Security = new cAdvancedSecurity();
if (IsPasswordExpired())
$this->Page_Terminate("changepwd.php");
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
$Security->TablePermission_Loading();
$Security->LoadCurrentUserLevel($this->TableName);
$Security->TablePermission_Loaded();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
if (!$Security->CanSearch()) {
$Security->SaveLastUrl();
$this->Page_Terminate("AwardsEntrieslist.php");
}
$Security->UserID_Loading();
if ($Security->IsLoggedIn()) $Security->LoadUserID();
$Security->UserID_Loaded();
// Create form object
$objForm = new cFormObj();
// Global Page Loading event (in userfn*.php)
Page_Loading();
// Page Load event
$this->Page_Load();
}
//
// Page_Terminate
//
function Page_Terminate($url = "") {
global $conn;
// Page Unload event
$this->Page_Unload();
// Global Page Unloaded event (in userfn*.php)
Page_Unloaded();
// Close connection
$conn->Close();
// Go to URL if specified
$this->Page_Redirecting($url);
if ($url <> "") {
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header("Location: " . $url);
}
exit();
}
//
// Page main
//
function Page_Main() {
global $objForm, $Language, $gsSearchError, $AwardsEntries;
if ($this->IsPageRequest()) { // Validate request
// Get action
$AwardsEntries->CurrentAction = $objForm->GetValue("a_search");
switch ($AwardsEntries->CurrentAction) {
case "S": // Get search criteria
// Build search string for advanced search, remove blank field
$this->LoadSearchValues(); // Get search values
if ($this->ValidateSearch()) {
$sSrchStr = $this->BuildAdvancedSearch();
} else {
$sSrchStr = "";
$this->setMessage($gsSearchError);
}
if ($sSrchStr <> "") {
$sSrchStr = $AwardsEntries->UrlParm($sSrchStr);
$this->Page_Terminate("AwardsEntrieslist.php" . "?" . $sSrchStr); // Go to list page
}
}
}
// Restore search settings from Session
if ($gsSearchError == "")
$this->LoadAdvancedSearch();
// Render row for search
$AwardsEntries->RowType = EW_ROWTYPE_SEARCH;
$this->RenderRow();
}
// Build advanced search
function BuildAdvancedSearch() {
global $AwardsEntries;
$sSrchUrl = "";
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->DateCreated); // DateCreated
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->AwardYear); // AwardYear
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->PreEntry); // PreEntry
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->Firm_Name); // Firm_Name
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->Award_Category); // Award_Category
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->Start_Date); // Start_Date
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->Project_Name); // Project_Name
$this->BuildSearchUrl($sSrchUrl, $AwardsEntries->JV_Consent); // JV_Consent
return $sSrchUrl;
}
// Build search URL
function BuildSearchUrl(&$Url, &$Fld) {
global $objForm;
$sWrk = "";
$FldParm = substr($Fld->FldVar, 2);
$FldVal = $objForm->GetValue("x_$FldParm");
$FldOpr = $objForm->GetValue("z_$FldParm");
$FldCond = $objForm->GetValue("v_$FldParm");
$FldVal2 = $objForm->GetValue("y_$FldParm");
$FldOpr2 = $objForm->GetValue("w_$FldParm");
$FldVal = ew_StripSlashes($FldVal);
if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
$FldVal2 = ew_StripSlashes($FldVal2);
if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
$FldOpr = strtoupper(trim($FldOpr));
$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;
if ($FldOpr == "BETWEEN") {
$IsValidValue = ($lFldDataType <> EW_DATATYPE_NUMBER) ||
($lFldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2));
if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
"&y_" . $FldParm . "=" . urlencode($FldVal2) .
"&z_" . $FldParm . "=" . urlencode($FldOpr);
}
} elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
"&z_" . $FldParm . "=" . urlencode($FldOpr);
} else {
$IsValidValue = ($lFldDataType <> EW_DATATYPE_NUMBER) ||
($lFldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal));
if ($FldVal <> "" && $IsValidValue && ew_IsValidOpr($FldOpr, $lFldDataType)) {
//$FldVal = $this->ConvertSearchValue($Fld, $FldVal);
$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
"&z_" . $FldParm . "=" . urlencode($FldOpr);
}
$IsValidValue = ($lFldDataType <> EW_DATATYPE_NUMBER) ||
($lFldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal2));
if ($FldVal2 <> "" && $IsValidValue && ew_IsValidOpr($FldOpr2, $lFldDataType)) {
//$FldVal2 = $this->ConvertSearchValue($Fld, $FldVal2);
if ($sWrk <> "") $sWrk .= "&v_" . $FldParm . "=" . urlencode($FldCond) . "&";
$sWrk .= "&y_" . $FldParm . "=" . urlencode($FldVal2) .
"&w_" . $FldParm . "=" . urlencode($FldOpr2);
}
}
if ($sWrk <> "") {
if ($Url <> "") $Url .= "&";
$Url .= $sWrk;
}
}
// Convert search value for date
function ConvertSearchValue(&$Fld, $FldVal) {
$Value = $FldVal;
if ($Fld->FldDataType == EW_DATATYPE_DATE && $FldVal <> "")
$Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat);
return $Value;
}
// Load search values for validation
function LoadSearchValues() {
global $objForm, $AwardsEntries;
// Load search values
// DateCreated
$AwardsEntries->DateCreated->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_DateCreated"));
$AwardsEntries->DateCreated->AdvancedSearch->SearchOperator = $objForm->GetValue("z_DateCreated");
$AwardsEntries->DateCreated->AdvancedSearch->SearchCondition = $objForm->GetValue("v_DateCreated");
$AwardsEntries->DateCreated->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue("y_DateCreated"));
$AwardsEntries->DateCreated->AdvancedSearch->SearchOperator2 = $objForm->GetValue("w_DateCreated");
// AwardYear
$AwardsEntries->AwardYear->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_AwardYear"));
$AwardsEntries->AwardYear->AdvancedSearch->SearchOperator = $objForm->GetValue("z_AwardYear");
// PreEntry
$AwardsEntries->PreEntry->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_PreEntry"));
$AwardsEntries->PreEntry->AdvancedSearch->SearchOperator = $objForm->GetValue("z_PreEntry");
// Firm_Name
$AwardsEntries->Firm_Name->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_Firm_Name"));
$AwardsEntries->Firm_Name->AdvancedSearch->SearchOperator = $objForm->GetValue("z_Firm_Name");
// Award_Category
$AwardsEntries->Award_Category->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_Award_Category"));
$AwardsEntries->Award_Category->AdvancedSearch->SearchOperator = $objForm->GetValue("z_Award_Category");
// Start_Date
$AwardsEntries->Start_Date->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_Start_Date"));
$AwardsEntries->Start_Date->AdvancedSearch->SearchOperator = $objForm->GetValue("z_Start_Date");
$AwardsEntries->Start_Date->AdvancedSearch->SearchCondition = $objForm->GetValue("v_Start_Date");
$AwardsEntries->Start_Date->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue("y_Start_Date"));
$AwardsEntries->Start_Date->AdvancedSearch->SearchOperator2 = $objForm->GetValue("w_Start_Date");
// Project_Name
$AwardsEntries->Project_Name->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_Project_Name"));
$AwardsEntries->Project_Name->AdvancedSearch->SearchOperator = $objForm->GetValue("z_Project_Name");
// JV_Consent
$AwardsEntries->JV_Consent->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue("x_JV_Consent"));
$AwardsEntries->JV_Consent->AdvancedSearch->SearchOperator = $objForm->GetValue("z_JV_Consent");
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $AwardsEntries;
// Initialize URLs
// Call Row_Rendering event
$AwardsEntries->Row_Rendering();
// Common render codes for all row types
// DateCreated
$AwardsEntries->DateCreated->CellCssStyle = ""; $AwardsEntries->DateCreated->CellCssClass = "";
$AwardsEntries->DateCreated->CellAttrs = array(); $AwardsEntries->DateCreated->ViewAttrs = array(); $AwardsEntries->DateCreated->EditAttrs = array();
// AwardYear
$AwardsEntries->AwardYear->CellCssStyle = ""; $AwardsEntries->AwardYear->CellCssClass = "";
$AwardsEntries->AwardYear->CellAttrs = array(); $AwardsEntries->AwardYear->ViewAttrs = array(); $AwardsEntries->AwardYear->EditAttrs = array();
// PreEntry
$AwardsEntries->PreEntry->CellCssStyle = ""; $AwardsEntries->PreEntry->CellCssClass = "";
$AwardsEntries->PreEntry->CellAttrs = array(); $AwardsEntries->PreEntry->ViewAttrs = array(); $AwardsEntries->PreEntry->EditAttrs = array();
// Firm_Name
$AwardsEntries->Firm_Name->CellCssStyle = ""; $AwardsEntries->Firm_Name->CellCssClass = "";
$AwardsEntries->Firm_Name->CellAttrs = array(); $AwardsEntries->Firm_Name->ViewAttrs = array(); $AwardsEntries->Firm_Name->EditAttrs = array();
// Award_Category
$AwardsEntries->Award_Category->CellCssStyle = ""; $AwardsEntries->Award_Category->CellCssClass = "";
$AwardsEntries->Award_Category->CellAttrs = array(); $AwardsEntries->Award_Category->ViewAttrs = array(); $AwardsEntries->Award_Category->EditAttrs = array();
// Start_Date
$AwardsEntries->Start_Date->CellCssStyle = ""; $AwardsEntries->Start_Date->CellCssClass = "";
$AwardsEntries->Start_Date->CellAttrs = array(); $AwardsEntries->Start_Date->ViewAttrs = array(); $AwardsEntries->Start_Date->EditAttrs = array();
// Project_Name
$AwardsEntries->Project_Name->CellCssStyle = ""; $AwardsEntries->Project_Name->CellCssClass = "";
$AwardsEntries->Project_Name->CellAttrs = array(); $AwardsEntries->Project_Name->ViewAttrs = array(); $AwardsEntries->Project_Name->EditAttrs = array();
// JV_Consent
$AwardsEntries->JV_Consent->CellCssStyle = ""; $AwardsEntries->JV_Consent->CellCssClass = "";
$AwardsEntries->JV_Consent->CellAttrs = array(); $AwardsEntries->JV_Consent->ViewAttrs = array(); $AwardsEntries->JV_Consent->EditAttrs = array();
if ($AwardsEntries->RowType == EW_ROWTYPE_VIEW) { // View row
// AwardsEntryID
$AwardsEntries->AwardsEntryID->ViewValue = $AwardsEntries->AwardsEntryID->CurrentValue;
$AwardsEntries->AwardsEntryID->CssStyle = "";
$AwardsEntries->AwardsEntryID->CssClass = "";
$AwardsEntries->AwardsEntryID->ViewCustomAttributes = "";
// DateCreated
$AwardsEntries->DateCreated->ViewValue = $AwardsEntries->DateCreated->CurrentValue;
$AwardsEntries->DateCreated->ViewValue = ew_FormatDateTime($AwardsEntries->DateCreated->ViewValue, 5);
$AwardsEntries->DateCreated->CssStyle = "";
$AwardsEntries->DateCreated->CssClass = "";
$AwardsEntries->DateCreated->ViewCustomAttributes = "";
// AwardYear
$AwardsEntries->AwardYear->ViewValue = $AwardsEntries->AwardYear->CurrentValue;
$AwardsEntries->AwardYear->CssStyle = "";
$AwardsEntries->AwardYear->CssClass = "";
$AwardsEntries->AwardYear->ViewCustomAttributes = "";
// PreEntry
if (strval($AwardsEntries->PreEntry->CurrentValue) <> "") {
switch ($AwardsEntries->PreEntry->CurrentValue) {
case "1":
$AwardsEntries->PreEntry->ViewValue = "Pre-Entry";
break;
case "0":
$AwardsEntries->PreEntry->ViewValue = "Full Entry";
break;
default:
$AwardsEntries->PreEntry->ViewValue = $AwardsEntries->PreEntry->CurrentValue;
}
} else {
$AwardsEntries->PreEntry->ViewValue = NULL;
}
$AwardsEntries->PreEntry->CssStyle = "";
$AwardsEntries->PreEntry->CssClass = "";
$AwardsEntries->PreEntry->ViewCustomAttributes = "";
// Firm_Name
$AwardsEntries->Firm_Name->ViewValue = $AwardsEntries->Firm_Name->CurrentValue;
$AwardsEntries->Firm_Name->CssStyle = "";
$AwardsEntries->Firm_Name->CssClass = "";
$AwardsEntries->Firm_Name->ViewCustomAttributes = "";
// Award_Category
$AwardsEntries->Award_Category->ViewValue = $AwardsEntries->Award_Category->CurrentValue;
if (strval($AwardsEntries->Award_Category->CurrentValue) <> "") {
$sFilterWrk = "`Award_Category` = '" . ew_AdjustSql($AwardsEntries->Award_Category->CurrentValue) . "'";
$sSqlWrk = "SELECT DISTINCT `Award_Category` FROM `AwardsEntries`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `Award_Category` Asc";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$AwardsEntries->Award_Category->ViewValue = $rswrk->fields('Award_Category');
$rswrk->Close();
} else {
$AwardsEntries->Award_Category->ViewValue = $AwardsEntries->Award_Category->CurrentValue;
}
} else {
$AwardsEntries->Award_Category->ViewValue = NULL;
}
$AwardsEntries->Award_Category->CssStyle = "";
$AwardsEntries->Award_Category->CssClass = "";
$AwardsEntries->Award_Category->ViewCustomAttributes = "";
// Start_Date
$AwardsEntries->Start_Date->ViewValue = $AwardsEntries->Start_Date->CurrentValue;
$AwardsEntries->Start_Date->CssStyle = "";
$AwardsEntries->Start_Date->CssClass = "";
$AwardsEntries->Start_Date->ViewCustomAttributes = "";
// Project_Name
$AwardsEntries->Project_Name->ViewValue = $AwardsEntries->Project_Name->CurrentValue;
$AwardsEntries->Project_Name->CssStyle = "";
$AwardsEntries->Project_Name->CssClass = "";
$AwardsEntries->Project_Name->ViewCustomAttributes = "";
// Completion_Date
$AwardsEntries->Completion_Date->ViewValue = $AwardsEntries->Completion_Date->CurrentValue;
$AwardsEntries->Completion_Date->CssStyle = "";
$AwardsEntries->Completion_Date->CssClass = "";
$AwardsEntries->Completion_Date->ViewCustomAttributes = "";
// Lead_Consultant_Name
$AwardsEntries->Lead_Consultant_Name->ViewValue = $AwardsEntries->Lead_Consultant_Name->CurrentValue;
$AwardsEntries->Lead_Consultant_Name->CssStyle = "";
$AwardsEntries->Lead_Consultant_Name->CssClass = "";
$AwardsEntries->Lead_Consultant_Name->ViewCustomAttributes = "";
// Lead_Consultant_Tel
$AwardsEntries->Lead_Consultant_Tel->ViewValue = $AwardsEntries->Lead_Consultant_Tel->CurrentValue;
$AwardsEntries->Lead_Consultant_Tel->CssStyle = "";
$AwardsEntries->Lead_Consultant_Tel->CssClass = "";
$AwardsEntries->Lead_Consultant_Tel->ViewCustomAttributes = "";
// Lead_Consultant_Mobile
$AwardsEntries->Lead_Consultant_Mobile->ViewValue = $AwardsEntries->Lead_Consultant_Mobile->CurrentValue;
$AwardsEntries->Lead_Consultant_Mobile->CssStyle = "";
$AwardsEntries->Lead_Consultant_Mobile->CssClass = "";
$AwardsEntries->Lead_Consultant_Mobile->ViewCustomAttributes = "";
// Lead_Consultant_Email
$AwardsEntries->Lead_Consultant_Email->ViewValue = $AwardsEntries->Lead_Consultant_Email->CurrentValue;
$AwardsEntries->Lead_Consultant_Email->CssStyle = "";
$AwardsEntries->Lead_Consultant_Email->CssClass = "";
$AwardsEntries->Lead_Consultant_Email->ViewCustomAttributes = "";
// Role_In_Project
$AwardsEntries->Role_In_Project->ViewValue = $AwardsEntries->Role_In_Project->CurrentValue;
$AwardsEntries->Role_In_Project->CssStyle = "";
$AwardsEntries->Role_In_Project->CssClass = "";
$AwardsEntries->Role_In_Project->ViewCustomAttributes = "";
// JV_Partners
$AwardsEntries->JV_Partners->ViewValue = $AwardsEntries->JV_Partners->CurrentValue;
$AwardsEntries->JV_Partners->CssStyle = "";
$AwardsEntries->JV_Partners->CssClass = "";
$AwardsEntries->JV_Partners->ViewCustomAttributes = "";
// JV_Consent
$AwardsEntries->JV_Consent->ViewValue = $AwardsEntries->JV_Consent->CurrentValue;
$AwardsEntries->JV_Consent->CssStyle = "";
$AwardsEntries->JV_Consent->CssClass = "";
$AwardsEntries->JV_Consent->ViewCustomAttributes = "";
// Nominee_Name
$AwardsEntries->Nominee_Name->ViewValue = $AwardsEntries->Nominee_Name->CurrentValue;
$AwardsEntries->Nominee_Name->CssStyle = "";
$AwardsEntries->Nominee_Name->CssClass = "";
$AwardsEntries->Nominee_Name->ViewCustomAttributes = "";
// Nominee_Consent
$AwardsEntries->Nominee_Consent->ViewValue = $AwardsEntries->Nominee_Consent->CurrentValue;
$AwardsEntries->Nominee_Consent->CssStyle = "";
$AwardsEntries->Nominee_Consent->CssClass = "";
$AwardsEntries->Nominee_Consent->ViewCustomAttributes = "";
// Description_Sent
$AwardsEntries->Description_Sent->ViewValue = $AwardsEntries->Description_Sent->CurrentValue;
$AwardsEntries->Description_Sent->CssStyle = "";
$AwardsEntries->Description_Sent->CssClass = "";
$AwardsEntries->Description_Sent->ViewCustomAttributes = "";
// Contact_Name
$AwardsEntries->Contact_Name->ViewValue = $AwardsEntries->Contact_Name->CurrentValue;
$AwardsEntries->Contact_Name->CssStyle = "";
$AwardsEntries->Contact_Name->CssClass = "";
$AwardsEntries->Contact_Name->ViewCustomAttributes = "";
// Contact_Job_Title
$AwardsEntries->Contact_Job_Title->ViewValue = $AwardsEntries->Contact_Job_Title->CurrentValue;
$AwardsEntries->Contact_Job_Title->CssStyle = "";
$AwardsEntries->Contact_Job_Title->CssClass = "";
$AwardsEntries->Contact_Job_Title->ViewCustomAttributes = "";
// Contact_Tel
$AwardsEntries->Contact_Tel->ViewValue = $AwardsEntries->Contact_Tel->CurrentValue;
$AwardsEntries->Contact_Tel->CssStyle = "";
$AwardsEntries->Contact_Tel->CssClass = "";
$AwardsEntries->Contact_Tel->ViewCustomAttributes = "";
// Contact_Email
$AwardsEntries->Contact_Email->ViewValue = $AwardsEntries->Contact_Email->CurrentValue;
$AwardsEntries->Contact_Email->CssStyle = "";
$AwardsEntries->Contact_Email->CssClass = "";
$AwardsEntries->Contact_Email->ViewCustomAttributes = "";
// A1_Poster_Required
$AwardsEntries->A1_Poster_Required->ViewValue = $AwardsEntries->A1_Poster_Required->CurrentValue;
$AwardsEntries->A1_Poster_Required->CssStyle = "";
$AwardsEntries->A1_Poster_Required->CssClass = "";
$AwardsEntries->A1_Poster_Required->ViewCustomAttributes = "";
// Quantity
$AwardsEntries->Quantity->ViewValue = $AwardsEntries->Quantity->CurrentValue;
$AwardsEntries->Quantity->CssStyle = "";
$AwardsEntries->Quantity->CssClass = "";
$AwardsEntries->Quantity->ViewCustomAttributes = "";
// ExternalFormID
$AwardsEntries->ExternalFormID->ViewValue = $AwardsEntries->ExternalFormID->CurrentValue;
$AwardsEntries->ExternalFormID->CssStyle = "";
$AwardsEntries->ExternalFormID->CssClass = "";
$AwardsEntries->ExternalFormID->ViewCustomAttributes = "";
// ExternalEntryID
$AwardsEntries->ExternalEntryID->ViewValue = $AwardsEntries->ExternalEntryID->CurrentValue;
$AwardsEntries->ExternalEntryID->CssStyle = "";
$AwardsEntries->ExternalEntryID->CssClass = "";
$AwardsEntries->ExternalEntryID->ViewCustomAttributes = "";
// PreEntryHTML
$AwardsEntries->PreEntryHTML->ViewValue = $AwardsEntries->PreEntryHTML->CurrentValue;
$AwardsEntries->PreEntryHTML->CssStyle = "";
$AwardsEntries->PreEntryHTML->CssClass = "";
$AwardsEntries->PreEntryHTML->ViewCustomAttributes = "";
// Contact_Mobile
$AwardsEntries->Contact_Mobile->ViewValue = $AwardsEntries->Contact_Mobile->CurrentValue;
$AwardsEntries->Contact_Mobile->CssStyle = "";
$AwardsEntries->Contact_Mobile->CssClass = "";
$AwardsEntries->Contact_Mobile->ViewCustomAttributes = "";
// FullEntryHTML
$AwardsEntries->FullEntryHTML->ViewValue = $AwardsEntries->FullEntryHTML->CurrentValue;
$AwardsEntries->FullEntryHTML->CssStyle = "";
$AwardsEntries->FullEntryHTML->CssClass = "";
$AwardsEntries->FullEntryHTML->ViewCustomAttributes = "";
// DateCreated
$AwardsEntries->DateCreated->HrefValue = "";
$AwardsEntries->DateCreated->TooltipValue = "";
// AwardYear
$AwardsEntries->AwardYear->HrefValue = "";
$AwardsEntries->AwardYear->TooltipValue = "";
// PreEntry
$AwardsEntries->PreEntry->HrefValue = "";
$AwardsEntries->PreEntry->TooltipValue = "";
// Firm_Name
$AwardsEntries->Firm_Name->HrefValue = "";
$AwardsEntries->Firm_Name->TooltipValue = "";
// Award_Category
$AwardsEntries->Award_Category->HrefValue = "";
$AwardsEntries->Award_Category->TooltipValue = "";
// Start_Date
$AwardsEntries->Start_Date->HrefValue = "";
$AwardsEntries->Start_Date->TooltipValue = "";
// Project_Name
$AwardsEntries->Project_Name->HrefValue = "";
$AwardsEntries->Project_Name->TooltipValue = "";
// JV_Consent
$AwardsEntries->JV_Consent->HrefValue = "";
$AwardsEntries->JV_Consent->TooltipValue = "";
} elseif ($AwardsEntries->RowType == EW_ROWTYPE_SEARCH) { // Search row
// DateCreated
$AwardsEntries->DateCreated->EditCustomAttributes = "";
$AwardsEntries->DateCreated->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($AwardsEntries->DateCreated->AdvancedSearch->SearchValue, 5), 5));
$AwardsEntries->DateCreated->EditCustomAttributes = "";
$AwardsEntries->DateCreated->EditValue2 = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($AwardsEntries->DateCreated->AdvancedSearch->SearchValue2, 5), 5));
// AwardYear
$AwardsEntries->AwardYear->EditCustomAttributes = "";
$AwardsEntries->AwardYear->EditValue = ew_HtmlEncode($AwardsEntries->AwardYear->AdvancedSearch->SearchValue);
// PreEntry
$AwardsEntries->PreEntry->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("1", "Pre-Entry");
$arwrk[] = array("0", "Full Entry");
$AwardsEntries->PreEntry->EditValue = $arwrk;
// Firm_Name
$AwardsEntries->Firm_Name->EditCustomAttributes = "";
$AwardsEntries->Firm_Name->EditValue = ew_HtmlEncode($AwardsEntries->Firm_Name->AdvancedSearch->SearchValue);
// Award_Category
$AwardsEntries->Award_Category->EditCustomAttributes = "";
$AwardsEntries->Award_Category->EditValue = ew_HtmlEncode($AwardsEntries->Award_Category->AdvancedSearch->SearchValue);
if (strval($AwardsEntries->Award_Category->AdvancedSearch->SearchValue) <> "") {
$sFilterWrk = "`Award_Category` = '" . ew_AdjustSql($AwardsEntries->Award_Category->AdvancedSearch->SearchValue) . "'";
$sSqlWrk = "SELECT DISTINCT `Award_Category` FROM `AwardsEntries`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `Award_Category` Asc";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$AwardsEntries->Award_Category->EditValue = $rswrk->fields('Award_Category');
$rswrk->Close();
} else {
$AwardsEntries->Award_Category->EditValue = $AwardsEntries->Award_Category->AdvancedSearch->SearchValue;
}
} else {
$AwardsEntries->Award_Category->EditValue = NULL;
}
// Start_Date
$AwardsEntries->Start_Date->EditCustomAttributes = "";
$AwardsEntries->Start_Date->EditValue = ew_HtmlEncode($AwardsEntries->Start_Date->AdvancedSearch->SearchValue);
$AwardsEntries->Start_Date->EditCustomAttributes = "";
$AwardsEntries->Start_Date->EditValue2 = ew_HtmlEncode($AwardsEntries->Start_Date->AdvancedSearch->SearchValue2);
// Project_Name
$AwardsEntries->Project_Name->EditCustomAttributes = "";
$AwardsEntries->Project_Name->EditValue = ew_HtmlEncode($AwardsEntries->Project_Name->AdvancedSearch->SearchValue);
// JV_Consent
$AwardsEntries->JV_Consent->EditCustomAttributes = "";
$AwardsEntries->JV_Consent->EditValue = ew_HtmlEncode($AwardsEntries->JV_Consent->AdvancedSearch->SearchValue);
}
// Call Row Rendered event
if ($AwardsEntries->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$AwardsEntries->Row_Rendered();
}
// Validate search
function ValidateSearch() {
global $gsSearchError, $AwardsEntries;
// Initialize
$gsSearchError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE)
return TRUE;
if (!ew_CheckDate($AwardsEntries->DateCreated->AdvancedSearch->SearchValue)) {
if ($gsSearchError <> "") $gsSearchError .= "<br>";
$gsSearchError .= $AwardsEntries->DateCreated->FldErrMsg();
}
if (!ew_CheckDate($AwardsEntries->DateCreated->AdvancedSearch->SearchValue2)) {
if ($gsSearchError <> "") $gsSearchError .= "<br>";
$gsSearchError .= $AwardsEntries->DateCreated->FldErrMsg();
}
if (!ew_CheckInteger($AwardsEntries->AwardYear->AdvancedSearch->SearchValue)) {
if ($gsSearchError <> "") $gsSearchError .= "<br>";
$gsSearchError .= $AwardsEntries->AwardYear->FldErrMsg();
}
// Return validate result
$ValidateSearch = ($gsSearchError == "");
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError <> "") {
if ($gsSearchError <> "") $gsSearchError .= "<br>";
$gsSearchError .= $sFormCustomError;
}
return $ValidateSearch;
}
// Load advanced search
function LoadAdvancedSearch() {
global $AwardsEntries;
$AwardsEntries->DateCreated->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_DateCreated");
$AwardsEntries->DateCreated->AdvancedSearch->SearchValue2 = $AwardsEntries->getAdvancedSearch("y_DateCreated");
$AwardsEntries->AwardYear->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_AwardYear");
$AwardsEntries->PreEntry->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_PreEntry");
$AwardsEntries->Firm_Name->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_Firm_Name");
$AwardsEntries->Award_Category->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_Award_Category");
$AwardsEntries->Start_Date->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_Start_Date");
$AwardsEntries->Start_Date->AdvancedSearch->SearchValue2 = $AwardsEntries->getAdvancedSearch("y_Start_Date");
$AwardsEntries->Project_Name->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_Project_Name");
$AwardsEntries->JV_Consent->AdvancedSearch->SearchValue = $AwardsEntries->getAdvancedSearch("x_JV_Consent");
}
// Page Load event
function Page_Load() {
//echo "Page Load";
}
// Page Unload event
function Page_Unload() {
//echo "Page Unload";
}
// Page Redirecting event
function Page_Redirecting(&$url) {
// Example:
//$url = "your URL";
}
// Message Showing event
function Message_Showing(&$msg) {
// Example:
//$msg = "your new message";
}
// Form Custom Validate event
function Form_CustomValidate(&$CustomError) {
// Return error message in CustomError
return TRUE;
}
}
?>