Example #1
0
function pegaItens($id)
{
    $Conexao = Conn();
    $sql = "Select m.* from menu m, acessousu a \n             where m.codpaimenu = {$id} and\n                   m.codmenu = a.codmenu and a.codusuario = " . $_SESSION['codusuarioadm'] . " order by m.desmenu asc";
    $rs = mysql_query($sql, $Conexao) or die(mysql_error());
    $menu = "";
    while ($a = mysql_fetch_array($rs)) {
        if ($a['desmenu'] != "") {
            $menu .= 'menu_' . $id . '.addMenuItem("' . $a['desmenu'] . '","location=\'' . $a['desurl'] . '\'");' . chr(10);
        }
    }
    return array($menu);
    //return $menu.chr(10);
}
Example #2
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // cat_id
     // rid
     // cat_name
     // cat_desc
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // cat_id
         $this->cat_id->ViewValue = $this->cat_id->CurrentValue;
         $this->cat_id->ViewCustomAttributes = "";
         // rid
         if (strval($this->rid->CurrentValue) != "") {
             $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `restaurants`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rid, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->rid->ViewValue = $this->rid->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->rid->ViewValue = $this->rid->CurrentValue;
             }
         } else {
             $this->rid->ViewValue = NULL;
         }
         $this->rid->ViewCustomAttributes = "";
         // cat_name
         $this->cat_name->ViewValue = $this->cat_name->CurrentValue;
         $this->cat_name->ViewCustomAttributes = "";
         // rid
         $this->rid->LinkCustomAttributes = "";
         $this->rid->HrefValue = "";
         $this->rid->TooltipValue = "";
         // cat_name
         $this->cat_name->LinkCustomAttributes = "";
         $this->cat_name->HrefValue = "";
         $this->cat_name->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // rid
         $this->rid->EditAttrs["class"] = "form-control";
         $this->rid->EditCustomAttributes = "";
         if ($this->rid->getSessionValue() != "") {
             $this->rid->CurrentValue = $this->rid->getSessionValue();
             $this->rid->OldValue = $this->rid->CurrentValue;
             if (strval($this->rid->CurrentValue) != "") {
                 $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `restaurants`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->rid, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->rid->ViewValue = $this->rid->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->rid->ViewValue = $this->rid->CurrentValue;
                 }
             } else {
                 $this->rid->ViewValue = NULL;
             }
             $this->rid->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->rid->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
             }
             $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `restaurants`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rid, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->rid->EditValue = $arwrk;
         }
         // cat_name
         $this->cat_name->EditAttrs["class"] = "form-control";
         $this->cat_name->EditCustomAttributes = "";
         $this->cat_name->EditValue = ew_HtmlEncode($this->cat_name->CurrentValue);
         $this->cat_name->PlaceHolder = ew_RemoveHtml($this->cat_name->FldCaption());
         // Edit refer script
         // rid
         $this->rid->HrefValue = "";
         // cat_name
         $this->cat_name->HrefValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // rid
         $this->rid->EditAttrs["class"] = "form-control";
         $this->rid->EditCustomAttributes = "";
         if ($this->rid->getSessionValue() != "") {
             $this->rid->CurrentValue = $this->rid->getSessionValue();
             $this->rid->OldValue = $this->rid->CurrentValue;
             if (strval($this->rid->CurrentValue) != "") {
                 $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `restaurants`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->rid, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->rid->ViewValue = $this->rid->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->rid->ViewValue = $this->rid->CurrentValue;
                 }
             } else {
                 $this->rid->ViewValue = NULL;
             }
             $this->rid->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->rid->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
             }
             $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `restaurants`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rid, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->rid->EditValue = $arwrk;
         }
         // cat_name
         $this->cat_name->EditAttrs["class"] = "form-control";
         $this->cat_name->EditCustomAttributes = "";
         $this->cat_name->EditValue = ew_HtmlEncode($this->cat_name->CurrentValue);
         $this->cat_name->PlaceHolder = ew_RemoveHtml($this->cat_name->FldCaption());
         // Edit refer script
         // rid
         $this->rid->HrefValue = "";
         // cat_name
         $this->cat_name->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #3
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // scat_id
     // category_id
     // scat_name
     // scat_description
     // scat_picture
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // scat_id
         $this->scat_id->ViewValue = $this->scat_id->CurrentValue;
         $this->scat_id->ViewCustomAttributes = "";
         // category_id
         if (strval($this->category_id->CurrentValue) != "") {
             $sFilterWrk = "`category_id`" . ew_SearchString("=", $this->category_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `category_id`, `category_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->category_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->category_id->ViewValue = $this->category_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->category_id->ViewValue = $this->category_id->CurrentValue;
             }
         } else {
             $this->category_id->ViewValue = NULL;
         }
         $this->category_id->ViewCustomAttributes = "";
         // scat_name
         $this->scat_name->ViewValue = $this->scat_name->CurrentValue;
         $this->scat_name->ViewCustomAttributes = "";
         // scat_description
         $this->scat_description->ViewValue = $this->scat_description->CurrentValue;
         $this->scat_description->ViewCustomAttributes = "";
         // scat_picture
         if (!ew_Empty($this->scat_picture->Upload->DbValue)) {
             $this->scat_picture->ViewValue = $this->scat_picture->Upload->DbValue;
         } else {
             $this->scat_picture->ViewValue = "";
         }
         $this->scat_picture->ViewCustomAttributes = "";
         // scat_id
         $this->scat_id->LinkCustomAttributes = "";
         $this->scat_id->HrefValue = "";
         $this->scat_id->TooltipValue = "";
         // category_id
         $this->category_id->LinkCustomAttributes = "";
         $this->category_id->HrefValue = "";
         $this->category_id->TooltipValue = "";
         // scat_name
         $this->scat_name->LinkCustomAttributes = "";
         $this->scat_name->HrefValue = "";
         $this->scat_name->TooltipValue = "";
         // scat_description
         $this->scat_description->LinkCustomAttributes = "";
         $this->scat_description->HrefValue = "";
         $this->scat_description->TooltipValue = "";
         // scat_picture
         $this->scat_picture->LinkCustomAttributes = "";
         $this->scat_picture->HrefValue = "";
         $this->scat_picture->HrefValue2 = $this->scat_picture->UploadPath . $this->scat_picture->Upload->DbValue;
         $this->scat_picture->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->ACCOUNT_NUMBER->FormValue == $this->ACCOUNT_NUMBER->CurrentValue && is_numeric(ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue))) {
         $this->ACCOUNT_NUMBER->CurrentValue = ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // BANK_ACCOUNT_ID
     // CODE
     // DESCRIPTION
     // ACCOUNT_NUMBER
     // BANK_ID
     // ACTIVE
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // CODE
         $this->CODE->ViewValue = $this->CODE->CurrentValue;
         $this->CODE->ViewCustomAttributes = "";
         // DESCRIPTION
         $this->DESCRIPTION->ViewValue = $this->DESCRIPTION->CurrentValue;
         $this->DESCRIPTION->ViewCustomAttributes = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->ViewValue = $this->ACCOUNT_NUMBER->CurrentValue;
         $this->ACCOUNT_NUMBER->ViewCustomAttributes = "";
         // BANK_ID
         if (strval($this->BANK_ID->CurrentValue) != "") {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->BANK_ID->ViewValue = $this->BANK_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->BANK_ID->ViewValue = $this->BANK_ID->CurrentValue;
             }
         } else {
             $this->BANK_ID->ViewValue = NULL;
         }
         $this->BANK_ID->ViewCustomAttributes = "";
         // ACTIVE
         if (strval($this->ACTIVE->CurrentValue) != "") {
             $this->ACTIVE->ViewValue = $this->ACTIVE->OptionCaption($this->ACTIVE->CurrentValue);
         } else {
             $this->ACTIVE->ViewValue = NULL;
         }
         $this->ACTIVE->ViewCustomAttributes = "";
         // CODE
         $this->CODE->LinkCustomAttributes = "";
         $this->CODE->HrefValue = "";
         $this->CODE->TooltipValue = "";
         // DESCRIPTION
         $this->DESCRIPTION->LinkCustomAttributes = "";
         $this->DESCRIPTION->HrefValue = "";
         $this->DESCRIPTION->TooltipValue = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->LinkCustomAttributes = "";
         $this->ACCOUNT_NUMBER->HrefValue = "";
         $this->ACCOUNT_NUMBER->TooltipValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         $this->BANK_ID->TooltipValue = "";
         // ACTIVE
         $this->ACTIVE->LinkCustomAttributes = "";
         $this->ACTIVE->HrefValue = "";
         $this->ACTIVE->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // CODE
         $this->CODE->EditAttrs["class"] = "form-control";
         $this->CODE->EditCustomAttributes = "";
         $this->CODE->EditValue = ew_HtmlEncode($this->CODE->CurrentValue);
         $this->CODE->PlaceHolder = ew_RemoveHtml($this->CODE->FldCaption());
         // DESCRIPTION
         $this->DESCRIPTION->EditAttrs["class"] = "form-control";
         $this->DESCRIPTION->EditCustomAttributes = "";
         $this->DESCRIPTION->EditValue = ew_HtmlEncode($this->DESCRIPTION->CurrentValue);
         $this->DESCRIPTION->PlaceHolder = ew_RemoveHtml($this->DESCRIPTION->FldCaption());
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->EditAttrs["class"] = "form-control";
         $this->ACCOUNT_NUMBER->EditCustomAttributes = "";
         $this->ACCOUNT_NUMBER->EditValue = ew_HtmlEncode($this->ACCOUNT_NUMBER->CurrentValue);
         $this->ACCOUNT_NUMBER->PlaceHolder = ew_RemoveHtml($this->ACCOUNT_NUMBER->FldCaption());
         if (strval($this->ACCOUNT_NUMBER->EditValue) != "" && is_numeric($this->ACCOUNT_NUMBER->EditValue)) {
             $this->ACCOUNT_NUMBER->EditValue = ew_FormatNumber($this->ACCOUNT_NUMBER->EditValue, -2, -1, -2, 0);
         }
         // BANK_ID
         $this->BANK_ID->EditAttrs["class"] = "form-control";
         $this->BANK_ID->EditCustomAttributes = "";
         if (trim(strval($this->BANK_ID->CurrentValue)) == "") {
             $sFilterWrk = "0=1";
         } else {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
         }
         switch (@$gsLanguage) {
             case "es":
                 $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `bank`";
                 $sWhereWrk = "";
                 break;
             default:
                 $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `bank`";
                 $sWhereWrk = "";
                 break;
         }
         ew_AddFilter($sWhereWrk, $sFilterWrk);
         $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
         // Call Lookup selecting
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = Conn()->Execute($sSqlWrk);
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->BANK_ID->EditValue = $arwrk;
         // ACTIVE
         $this->ACTIVE->EditAttrs["class"] = "form-control";
         $this->ACTIVE->EditCustomAttributes = "";
         $this->ACTIVE->EditValue = $this->ACTIVE->Options(TRUE);
         // Edit refer script
         // CODE
         $this->CODE->LinkCustomAttributes = "";
         $this->CODE->HrefValue = "";
         // DESCRIPTION
         $this->DESCRIPTION->LinkCustomAttributes = "";
         $this->DESCRIPTION->HrefValue = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->LinkCustomAttributes = "";
         $this->ACCOUNT_NUMBER->HrefValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         // ACTIVE
         $this->ACTIVE->LinkCustomAttributes = "";
         $this->ACTIVE->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (airplane)
     if (!isset($GLOBALS["airplane"]) || get_class($GLOBALS["airplane"]) == "cairplane") {
         $GLOBALS["airplane"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["airplane"];
     }
     $KeyUrl = "";
     if (@$_GET["AIRPLANE_ID"] != "") {
         $this->RecKey["AIRPLANE_ID"] = $_GET["AIRPLANE_ID"];
         $KeyUrl .= "&AIRPLANE_ID=" . urlencode($this->RecKey["AIRPLANE_ID"]);
     }
     $this->ExportPrintUrl = $this->PageUrl() . "export=print" . $KeyUrl;
     $this->ExportHtmlUrl = $this->PageUrl() . "export=html" . $KeyUrl;
     $this->ExportExcelUrl = $this->PageUrl() . "export=excel" . $KeyUrl;
     $this->ExportWordUrl = $this->PageUrl() . "export=word" . $KeyUrl;
     $this->ExportXmlUrl = $this->PageUrl() . "export=xml" . $KeyUrl;
     $this->ExportCsvUrl = $this->PageUrl() . "export=csv" . $KeyUrl;
     $this->ExportPdfUrl = $this->PageUrl() . "export=pdf" . $KeyUrl;
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'view', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'airplane', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
     // Export options
     $this->ExportOptions = new cListOptions();
     $this->ExportOptions->Tag = "div";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Other options
     $this->OtherOptions['action'] = new cListOptions();
     $this->OtherOptions['action']->Tag = "div";
     $this->OtherOptions['action']->TagClassName = "ewActionOption";
     $this->OtherOptions['detail'] = new cListOptions();
     $this->OtherOptions['detail']->Tag = "div";
     $this->OtherOptions['detail']->TagClassName = "ewDetailOption";
 }
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Convert decimal values if posted back
     if ($this->ACCOUNT_NUMBER->FormValue == $this->ACCOUNT_NUMBER->CurrentValue && is_numeric(ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue))) {
         $this->ACCOUNT_NUMBER->CurrentValue = ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // BANK_ACCOUNT_ID
     // CODE
     // DESCRIPTION
     // ACCOUNT_NUMBER
     // BANK_ID
     // ACTIVE
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // CODE
         $this->CODE->ViewValue = $this->CODE->CurrentValue;
         $this->CODE->ViewCustomAttributes = "";
         // DESCRIPTION
         $this->DESCRIPTION->ViewValue = $this->DESCRIPTION->CurrentValue;
         $this->DESCRIPTION->ViewCustomAttributes = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->ViewValue = $this->ACCOUNT_NUMBER->CurrentValue;
         $this->ACCOUNT_NUMBER->ViewCustomAttributes = "";
         // BANK_ID
         if (strval($this->BANK_ID->CurrentValue) != "") {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->BANK_ID->ViewValue = $this->BANK_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->BANK_ID->ViewValue = $this->BANK_ID->CurrentValue;
             }
         } else {
             $this->BANK_ID->ViewValue = NULL;
         }
         $this->BANK_ID->ViewCustomAttributes = "";
         // ACTIVE
         if (strval($this->ACTIVE->CurrentValue) != "") {
             $this->ACTIVE->ViewValue = $this->ACTIVE->OptionCaption($this->ACTIVE->CurrentValue);
         } else {
             $this->ACTIVE->ViewValue = NULL;
         }
         $this->ACTIVE->ViewCustomAttributes = "";
         // CODE
         $this->CODE->LinkCustomAttributes = "";
         $this->CODE->HrefValue = "";
         $this->CODE->TooltipValue = "";
         // DESCRIPTION
         $this->DESCRIPTION->LinkCustomAttributes = "";
         $this->DESCRIPTION->HrefValue = "";
         $this->DESCRIPTION->TooltipValue = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->LinkCustomAttributes = "";
         $this->ACCOUNT_NUMBER->HrefValue = "";
         $this->ACCOUNT_NUMBER->TooltipValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         $this->BANK_ID->TooltipValue = "";
         // ACTIVE
         $this->ACTIVE->LinkCustomAttributes = "";
         $this->ACTIVE->HrefValue = "";
         $this->ACTIVE->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'custom', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'PrincipalDestinations.php', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect();
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
Example #8
0
 function RenderListRow()
 {
     global $Security, $gsLanguage, $Language;
     // Call Row Rendering event
     $this->Row_Rendering();
     // Common render codes
     // USER_ID
     $this->USER_ID->CellCssStyle = "white-space: nowrap;";
     // CODE
     $this->CODE->CellCssStyle = "white-space: nowrap;";
     // PASS
     $this->PASS->CellCssStyle = "white-space: nowrap;";
     // FIRSTNAME
     // SECONDNAME
     // LASTNAME
     // SURNAME
     // MAIL
     // USER_ACT
     $this->USER_ACT->CellCssStyle = "white-space: nowrap;";
     // USER_LEVEL_ID
     $this->USER_LEVEL_ID->CellCssStyle = "white-space: nowrap;";
     // USER_ID
     $this->USER_ID->ViewValue = $this->USER_ID->CurrentValue;
     $this->USER_ID->ViewCustomAttributes = "";
     // CODE
     $this->CODE->ViewValue = $this->CODE->CurrentValue;
     $this->CODE->ViewCustomAttributes = "";
     // PASS
     $this->PASS->ViewValue = $this->PASS->CurrentValue;
     $this->PASS->ViewCustomAttributes = "";
     // FIRSTNAME
     $this->FIRSTNAME->ViewValue = $this->FIRSTNAME->CurrentValue;
     $this->FIRSTNAME->ViewCustomAttributes = "";
     // SECONDNAME
     $this->SECONDNAME->ViewValue = $this->SECONDNAME->CurrentValue;
     $this->SECONDNAME->ViewCustomAttributes = "";
     // LASTNAME
     $this->LASTNAME->ViewValue = $this->LASTNAME->CurrentValue;
     $this->LASTNAME->ViewCustomAttributes = "";
     // SURNAME
     $this->SURNAME->ViewValue = $this->SURNAME->CurrentValue;
     $this->SURNAME->ViewCustomAttributes = "";
     // MAIL
     $this->MAIL->ViewValue = $this->MAIL->CurrentValue;
     $this->MAIL->ViewCustomAttributes = "";
     // USER_ACT
     $this->USER_ACT->ViewValue = $this->USER_ACT->CurrentValue;
     $this->USER_ACT->ViewCustomAttributes = "";
     // USER_LEVEL_ID
     if ($Security->CanAdmin()) {
         // System admin
         if (strval($this->USER_LEVEL_ID->CurrentValue) != "") {
             $sFilterWrk = "`USER_LEVEL_ID`" . ew_SearchString("=", $this->USER_LEVEL_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `USER_LEVEL_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `user_levels`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `USER_LEVEL_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `user_levels`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->USER_LEVEL_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->USER_LEVEL_ID->ViewValue = $this->USER_LEVEL_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->USER_LEVEL_ID->ViewValue = $this->USER_LEVEL_ID->CurrentValue;
             }
         } else {
             $this->USER_LEVEL_ID->ViewValue = NULL;
         }
     } else {
         $this->USER_LEVEL_ID->ViewValue = $Language->Phrase("PasswordMask");
     }
     $this->USER_LEVEL_ID->ViewCustomAttributes = "";
     // USER_ID
     $this->USER_ID->LinkCustomAttributes = "";
     $this->USER_ID->HrefValue = "";
     $this->USER_ID->TooltipValue = "";
     // CODE
     $this->CODE->LinkCustomAttributes = "";
     $this->CODE->HrefValue = "";
     $this->CODE->TooltipValue = "";
     // PASS
     $this->PASS->LinkCustomAttributes = "";
     $this->PASS->HrefValue = "";
     $this->PASS->TooltipValue = "";
     // FIRSTNAME
     $this->FIRSTNAME->LinkCustomAttributes = "";
     $this->FIRSTNAME->HrefValue = "";
     $this->FIRSTNAME->TooltipValue = "";
     // SECONDNAME
     $this->SECONDNAME->LinkCustomAttributes = "";
     $this->SECONDNAME->HrefValue = "";
     $this->SECONDNAME->TooltipValue = "";
     // LASTNAME
     $this->LASTNAME->LinkCustomAttributes = "";
     $this->LASTNAME->HrefValue = "";
     $this->LASTNAME->TooltipValue = "";
     // SURNAME
     $this->SURNAME->LinkCustomAttributes = "";
     $this->SURNAME->HrefValue = "";
     $this->SURNAME->TooltipValue = "";
     // MAIL
     $this->MAIL->LinkCustomAttributes = "";
     $this->MAIL->HrefValue = "";
     $this->MAIL->TooltipValue = "";
     // USER_ACT
     $this->USER_ACT->LinkCustomAttributes = "";
     $this->USER_ACT->HrefValue = "";
     $this->USER_ACT->TooltipValue = "";
     // USER_LEVEL_ID
     $this->USER_LEVEL_ID->LinkCustomAttributes = "";
     $this->USER_LEVEL_ID->HrefValue = "";
     $this->USER_LEVEL_ID->TooltipValue = "";
     // Call Row Rendered event
     $this->Row_Rendered();
 }
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // vl_media_id
     // vl_media_type
     // vl_media_name
     // vl_media_file
     // vl_media_file_custom
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // vl_media_id
         $this->vl_media_id->ViewValue = $this->vl_media_id->CurrentValue;
         $this->vl_media_id->ViewCustomAttributes = "";
         // vl_media_type
         if (strval($this->vl_media_type->CurrentValue) != "") {
             $sFilterWrk = "`vl_media_type_id`" . ew_SearchString("=", $this->vl_media_type->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `vl_media_type_id`, `vl_media_type_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `vl_media_type_list`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->vl_media_type, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `vl_media_type_name` ASC";
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->vl_media_type->ViewValue = $this->vl_media_type->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->vl_media_type->ViewValue = $this->vl_media_type->CurrentValue;
             }
         } else {
             $this->vl_media_type->ViewValue = NULL;
         }
         $this->vl_media_type->ViewCustomAttributes = "";
         // vl_media_name
         $this->vl_media_name->ViewValue = $this->vl_media_name->CurrentValue;
         $this->vl_media_name->ViewCustomAttributes = "";
         // vl_media_file
         if (!ew_Empty($this->vl_media_file->Upload->DbValue)) {
             $this->vl_media_file->ImageWidth = 200;
             $this->vl_media_file->ImageHeight = 200;
             $this->vl_media_file->ImageAlt = $this->vl_media_file->FldAlt();
             $this->vl_media_file->ViewValue = $this->vl_media_file->Upload->DbValue;
         } else {
             $this->vl_media_file->ViewValue = "";
         }
         $this->vl_media_file->ViewCustomAttributes = "";
         // vl_media_file_custom
         $this->vl_media_file_custom->UploadPath = "uploads_custom/";
         if (!ew_Empty($this->vl_media_file_custom->Upload->DbValue)) {
             $this->vl_media_file_custom->ImageWidth = 200;
             $this->vl_media_file_custom->ImageHeight = 200;
             $this->vl_media_file_custom->ImageAlt = $this->vl_media_file_custom->FldAlt();
             $this->vl_media_file_custom->ViewValue = $this->vl_media_file_custom->Upload->DbValue;
         } else {
             $this->vl_media_file_custom->ViewValue = "";
         }
         $this->vl_media_file_custom->ViewCustomAttributes = "";
         // vl_media_id
         $this->vl_media_id->LinkCustomAttributes = "";
         $this->vl_media_id->HrefValue = "";
         $this->vl_media_id->TooltipValue = "";
         // vl_media_type
         $this->vl_media_type->LinkCustomAttributes = "";
         $this->vl_media_type->HrefValue = "";
         $this->vl_media_type->TooltipValue = "";
         // vl_media_name
         $this->vl_media_name->LinkCustomAttributes = "";
         $this->vl_media_name->HrefValue = "";
         $this->vl_media_name->TooltipValue = "";
         // vl_media_file
         $this->vl_media_file->LinkCustomAttributes = "";
         if (!ew_Empty($this->vl_media_file->Upload->DbValue)) {
             $this->vl_media_file->HrefValue = ew_GetFileUploadUrl($this->vl_media_file, $this->vl_media_file->Upload->DbValue);
             // Add prefix/suffix
             $this->vl_media_file->LinkAttrs["target"] = "_blank";
             // Add target
             if ($this->Export != "") {
                 $this->vl_media_file->HrefValue = ew_ConvertFullUrl($this->vl_media_file->HrefValue);
             }
         } else {
             $this->vl_media_file->HrefValue = "";
         }
         $this->vl_media_file->HrefValue2 = $this->vl_media_file->UploadPath . $this->vl_media_file->Upload->DbValue;
         $this->vl_media_file->TooltipValue = "";
         if ($this->vl_media_file->UseColorbox) {
             if (ew_Empty($this->vl_media_file->TooltipValue)) {
                 $this->vl_media_file->LinkAttrs["title"] = $Language->Phrase("ViewImageGallery");
             }
             $this->vl_media_file->LinkAttrs["data-rel"] = "vl_media_list_x_vl_media_file";
             ew_AppendClass($this->vl_media_file->LinkAttrs["class"], "ewLightbox");
         }
         // vl_media_file_custom
         $this->vl_media_file_custom->LinkCustomAttributes = "";
         $this->vl_media_file_custom->UploadPath = "uploads_custom/";
         if (!ew_Empty($this->vl_media_file_custom->Upload->DbValue)) {
             $this->vl_media_file_custom->HrefValue = ew_GetFileUploadUrl($this->vl_media_file_custom, $this->vl_media_file_custom->Upload->DbValue);
             // Add prefix/suffix
             $this->vl_media_file_custom->LinkAttrs["target"] = "_blank";
             // Add target
             if ($this->Export != "") {
                 $this->vl_media_file_custom->HrefValue = ew_ConvertFullUrl($this->vl_media_file_custom->HrefValue);
             }
         } else {
             $this->vl_media_file_custom->HrefValue = "";
         }
         $this->vl_media_file_custom->HrefValue2 = $this->vl_media_file_custom->UploadPath . $this->vl_media_file_custom->Upload->DbValue;
         $this->vl_media_file_custom->TooltipValue = "";
         if ($this->vl_media_file_custom->UseColorbox) {
             if (ew_Empty($this->vl_media_file_custom->TooltipValue)) {
                 $this->vl_media_file_custom->LinkAttrs["title"] = $Language->Phrase("ViewImageGallery");
             }
             $this->vl_media_file_custom->LinkAttrs["data-rel"] = "vl_media_list_x_vl_media_file_custom";
             ew_AppendClass($this->vl_media_file_custom->LinkAttrs["class"], "ewLightbox");
         }
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #10
0
 function GetLookupValues($sql, $dbid)
 {
     $rsarr = array();
     $rowcnt = 0;
     if ($rs = Conn($dbid)->Execute($sql)) {
         $rowcnt = $rs->RecordCount();
         $fldcnt = $rs->FieldCount();
         $rsarr = $rs->GetRows();
         $rs->Close();
     }
     // Clean output buffer
     if (ob_get_length()) {
         ob_clean();
     }
     // Format date
     $ardt = array();
     for ($j = 0; $j < $fldcnt; $j++) {
         $ardt[$j] = @$_POST["df" . $j];
     }
     // Output
     if (is_array($rsarr) && $rowcnt > 0) {
         for ($i = 0; $i < $rowcnt; $i++) {
             for ($j = 0; $j < $fldcnt; $j++) {
                 $str = strval($rsarr[$i][$j]);
                 $str = ew_ConvertToUtf8($str);
                 if ($ardt[$j] != "" && intval($ardt[$j]) > 0) {
                     // Format date
                     $str = ew_FormatDateTime($str, $ardt[$j]);
                 }
                 if (isset($post["keepCRLF"])) {
                     $str = str_replace(array("\r", "\n", "\t"), array("\\r", "\\n", "\\t"), $str);
                 } else {
                     $str = str_replace(array("\r", "\n", "\t"), array(" ", " ", " "), $str);
                 }
                 $rsarr[$i][$j] = $str;
             }
         }
     }
     echo ew_ArrayToJson($rsarr);
 }
Example #11
0
 function RenderEditRow()
 {
     global $Security, $gsLanguage, $Language;
     // Call Row Rendering event
     $this->Row_Rendering();
     // cat_id
     $this->cat_id->EditAttrs["class"] = "form-control";
     $this->cat_id->EditCustomAttributes = "";
     $this->cat_id->EditValue = $this->cat_id->CurrentValue;
     $this->cat_id->ViewCustomAttributes = "";
     // rid
     $this->rid->EditAttrs["class"] = "form-control";
     $this->rid->EditCustomAttributes = "";
     if ($this->rid->getSessionValue() != "") {
         $this->rid->CurrentValue = $this->rid->getSessionValue();
         if (strval($this->rid->CurrentValue) != "") {
             $sFilterWrk = "`rid`" . ew_SearchString("=", $this->rid->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `rid`, `r_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `restaurants`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rid, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->rid->ViewValue = $this->rid->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->rid->ViewValue = $this->rid->CurrentValue;
             }
         } else {
             $this->rid->ViewValue = NULL;
         }
         $this->rid->ViewCustomAttributes = "";
     } else {
     }
     // cat_name
     $this->cat_name->EditAttrs["class"] = "form-control";
     $this->cat_name->EditCustomAttributes = "";
     $this->cat_name->EditValue = $this->cat_name->CurrentValue;
     $this->cat_name->PlaceHolder = ew_RemoveHtml($this->cat_name->FldCaption());
     // cat_desc
     $this->cat_desc->EditAttrs["class"] = "form-control";
     $this->cat_desc->EditCustomAttributes = "";
     $this->cat_desc->EditValue = $this->cat_desc->CurrentValue;
     $this->cat_desc->PlaceHolder = ew_RemoveHtml($this->cat_desc->FldCaption());
     // Call Row Rendered event
     $this->Row_Rendered();
 }
Example #12
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // product_id
     // category_id
     // scat_id
     // product_name
     // product_image
     // product_secimage
     // product_description
     // feature_ledtype
     // feature_power
     // feature_lumen
     // feature_viewangle
     // feature_cri
     // feature_iprating
     // feature_colortemp
     // feature_body
     // feature_cutoutsize
     // feature_colors
     // feature_dimmable
     // feature_warranty
     // feature_application
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // product_id
         $this->product_id->ViewValue = $this->product_id->CurrentValue;
         $this->product_id->ViewCustomAttributes = "";
         // category_id
         if (strval($this->category_id->CurrentValue) != "") {
             $sFilterWrk = "`category_id`" . ew_SearchString("=", $this->category_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `category_id`, `category_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->category_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->category_id->ViewValue = $this->category_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->category_id->ViewValue = $this->category_id->CurrentValue;
             }
         } else {
             $this->category_id->ViewValue = NULL;
         }
         $this->category_id->ViewCustomAttributes = "";
         // scat_id
         if (strval($this->scat_id->CurrentValue) != "") {
             $sFilterWrk = "`scat_id`" . ew_SearchString("=", $this->scat_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `scat_id`, `scat_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sub_category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->scat_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->scat_id->ViewValue = $this->scat_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->scat_id->ViewValue = $this->scat_id->CurrentValue;
             }
         } else {
             $this->scat_id->ViewValue = NULL;
         }
         $this->scat_id->ViewCustomAttributes = "";
         // product_name
         $this->product_name->ViewValue = $this->product_name->CurrentValue;
         $this->product_name->ViewCustomAttributes = "";
         // product_image
         if (!ew_Empty($this->product_image->Upload->DbValue)) {
             $this->product_image->ViewValue = $this->product_image->Upload->DbValue;
         } else {
             $this->product_image->ViewValue = "";
         }
         $this->product_image->ViewCustomAttributes = "";
         // product_secimage
         if (!ew_Empty($this->product_secimage->Upload->DbValue)) {
             $this->product_secimage->ViewValue = $this->product_secimage->Upload->DbValue;
         } else {
             $this->product_secimage->ViewValue = "";
         }
         $this->product_secimage->ViewCustomAttributes = "";
         // product_description
         $this->product_description->ViewValue = $this->product_description->CurrentValue;
         $this->product_description->ViewCustomAttributes = "";
         // feature_ledtype
         $this->feature_ledtype->ViewValue = $this->feature_ledtype->CurrentValue;
         $this->feature_ledtype->ViewCustomAttributes = "";
         // feature_power
         $this->feature_power->ViewValue = $this->feature_power->CurrentValue;
         $this->feature_power->ViewCustomAttributes = "";
         // feature_lumen
         $this->feature_lumen->ViewValue = $this->feature_lumen->CurrentValue;
         $this->feature_lumen->ViewCustomAttributes = "";
         // feature_viewangle
         $this->feature_viewangle->ViewValue = $this->feature_viewangle->CurrentValue;
         $this->feature_viewangle->ViewCustomAttributes = "";
         // feature_cri
         $this->feature_cri->ViewValue = $this->feature_cri->CurrentValue;
         $this->feature_cri->ViewCustomAttributes = "";
         // feature_iprating
         $this->feature_iprating->ViewValue = $this->feature_iprating->CurrentValue;
         $this->feature_iprating->ViewCustomAttributes = "";
         // feature_colortemp
         $this->feature_colortemp->ViewValue = $this->feature_colortemp->CurrentValue;
         $this->feature_colortemp->ViewCustomAttributes = "";
         // feature_body
         $this->feature_body->ViewValue = $this->feature_body->CurrentValue;
         $this->feature_body->ViewCustomAttributes = "";
         // feature_cutoutsize
         $this->feature_cutoutsize->ViewValue = $this->feature_cutoutsize->CurrentValue;
         $this->feature_cutoutsize->ViewCustomAttributes = "";
         // feature_colors
         $this->feature_colors->ViewValue = $this->feature_colors->CurrentValue;
         $this->feature_colors->ViewCustomAttributes = "";
         // feature_dimmable
         $this->feature_dimmable->ViewValue = $this->feature_dimmable->CurrentValue;
         $this->feature_dimmable->ViewCustomAttributes = "";
         // feature_warranty
         $this->feature_warranty->ViewValue = $this->feature_warranty->CurrentValue;
         $this->feature_warranty->ViewCustomAttributes = "";
         // feature_application
         $this->feature_application->ViewValue = $this->feature_application->CurrentValue;
         $this->feature_application->ViewCustomAttributes = "";
         // product_id
         $this->product_id->LinkCustomAttributes = "";
         $this->product_id->HrefValue = "";
         $this->product_id->TooltipValue = "";
         // category_id
         $this->category_id->LinkCustomAttributes = "";
         $this->category_id->HrefValue = "";
         $this->category_id->TooltipValue = "";
         // scat_id
         $this->scat_id->LinkCustomAttributes = "";
         $this->scat_id->HrefValue = "";
         $this->scat_id->TooltipValue = "";
         // product_name
         $this->product_name->LinkCustomAttributes = "";
         $this->product_name->HrefValue = "";
         $this->product_name->TooltipValue = "";
         // product_image
         $this->product_image->LinkCustomAttributes = "";
         $this->product_image->HrefValue = "";
         $this->product_image->HrefValue2 = $this->product_image->UploadPath . $this->product_image->Upload->DbValue;
         $this->product_image->TooltipValue = "";
         // product_secimage
         $this->product_secimage->LinkCustomAttributes = "";
         $this->product_secimage->HrefValue = "";
         $this->product_secimage->HrefValue2 = $this->product_secimage->UploadPath . $this->product_secimage->Upload->DbValue;
         $this->product_secimage->TooltipValue = "";
         // product_description
         $this->product_description->LinkCustomAttributes = "";
         $this->product_description->HrefValue = "";
         $this->product_description->TooltipValue = "";
         // feature_ledtype
         $this->feature_ledtype->LinkCustomAttributes = "";
         $this->feature_ledtype->HrefValue = "";
         $this->feature_ledtype->TooltipValue = "";
         // feature_power
         $this->feature_power->LinkCustomAttributes = "";
         $this->feature_power->HrefValue = "";
         $this->feature_power->TooltipValue = "";
         // feature_lumen
         $this->feature_lumen->LinkCustomAttributes = "";
         $this->feature_lumen->HrefValue = "";
         $this->feature_lumen->TooltipValue = "";
         // feature_viewangle
         $this->feature_viewangle->LinkCustomAttributes = "";
         $this->feature_viewangle->HrefValue = "";
         $this->feature_viewangle->TooltipValue = "";
         // feature_cri
         $this->feature_cri->LinkCustomAttributes = "";
         $this->feature_cri->HrefValue = "";
         $this->feature_cri->TooltipValue = "";
         // feature_iprating
         $this->feature_iprating->LinkCustomAttributes = "";
         $this->feature_iprating->HrefValue = "";
         $this->feature_iprating->TooltipValue = "";
         // feature_colortemp
         $this->feature_colortemp->LinkCustomAttributes = "";
         $this->feature_colortemp->HrefValue = "";
         $this->feature_colortemp->TooltipValue = "";
         // feature_body
         $this->feature_body->LinkCustomAttributes = "";
         $this->feature_body->HrefValue = "";
         $this->feature_body->TooltipValue = "";
         // feature_cutoutsize
         $this->feature_cutoutsize->LinkCustomAttributes = "";
         $this->feature_cutoutsize->HrefValue = "";
         $this->feature_cutoutsize->TooltipValue = "";
         // feature_colors
         $this->feature_colors->LinkCustomAttributes = "";
         $this->feature_colors->HrefValue = "";
         $this->feature_colors->TooltipValue = "";
         // feature_dimmable
         $this->feature_dimmable->LinkCustomAttributes = "";
         $this->feature_dimmable->HrefValue = "";
         $this->feature_dimmable->TooltipValue = "";
         // feature_warranty
         $this->feature_warranty->LinkCustomAttributes = "";
         $this->feature_warranty->HrefValue = "";
         $this->feature_warranty->TooltipValue = "";
         // feature_application
         $this->feature_application->LinkCustomAttributes = "";
         $this->feature_application->HrefValue = "";
         $this->feature_application->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // product_id
         $this->product_id->EditAttrs["class"] = "form-control";
         $this->product_id->EditCustomAttributes = "";
         $this->product_id->EditValue = $this->product_id->CurrentValue;
         $this->product_id->ViewCustomAttributes = "";
         // category_id
         $this->category_id->EditAttrs["class"] = "form-control";
         $this->category_id->EditCustomAttributes = "";
         if (trim(strval($this->category_id->CurrentValue)) == "") {
             $sFilterWrk = "0=1";
         } else {
             $sFilterWrk = "`category_id`" . ew_SearchString("=", $this->category_id->CurrentValue, EW_DATATYPE_NUMBER, "");
         }
         $sSqlWrk = "SELECT `category_id`, `category_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, `category_name` AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `category`";
         $sWhereWrk = "";
         ew_AddFilter($sWhereWrk, $sFilterWrk);
         $this->Lookup_Selecting($this->category_id, $sWhereWrk);
         // Call Lookup selecting
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = Conn()->Execute($sSqlWrk);
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->category_id->EditValue = $arwrk;
         // scat_id
         $this->scat_id->EditAttrs["class"] = "form-control";
         $this->scat_id->EditCustomAttributes = "";
         if ($this->scat_id->getSessionValue() != "") {
             $this->scat_id->CurrentValue = $this->scat_id->getSessionValue();
             if (strval($this->scat_id->CurrentValue) != "") {
                 $sFilterWrk = "`scat_id`" . ew_SearchString("=", $this->scat_id->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `scat_id`, `scat_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sub_category`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->scat_id, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->scat_id->ViewValue = $this->scat_id->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->scat_id->ViewValue = $this->scat_id->CurrentValue;
                 }
             } else {
                 $this->scat_id->ViewValue = NULL;
             }
             $this->scat_id->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->scat_id->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`scat_id`" . ew_SearchString("=", $this->scat_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             }
             $sSqlWrk = "SELECT `scat_id`, `scat_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, `category_id` AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `sub_category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->scat_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->scat_id->EditValue = $arwrk;
         }
         // product_name
         $this->product_name->EditAttrs["class"] = "form-control";
         $this->product_name->EditCustomAttributes = "";
         $this->product_name->EditValue = ew_HtmlEncode($this->product_name->CurrentValue);
         $this->product_name->PlaceHolder = ew_RemoveHtml($this->product_name->FldCaption());
         // product_image
         $this->product_image->EditAttrs["class"] = "form-control";
         $this->product_image->EditCustomAttributes = "";
         if (!ew_Empty($this->product_image->Upload->DbValue)) {
             $this->product_image->EditValue = $this->product_image->Upload->DbValue;
         } else {
             $this->product_image->EditValue = "";
         }
         if (!ew_Empty($this->product_image->CurrentValue)) {
             $this->product_image->Upload->FileName = $this->product_image->CurrentValue;
         }
         if ($this->CurrentAction == "I" && !$this->EventCancelled) {
             ew_RenderUploadField($this->product_image);
         }
         // product_secimage
         $this->product_secimage->EditAttrs["class"] = "form-control";
         $this->product_secimage->EditCustomAttributes = "";
         if (!ew_Empty($this->product_secimage->Upload->DbValue)) {
             $this->product_secimage->EditValue = $this->product_secimage->Upload->DbValue;
         } else {
             $this->product_secimage->EditValue = "";
         }
         if (!ew_Empty($this->product_secimage->CurrentValue)) {
             $this->product_secimage->Upload->FileName = $this->product_secimage->CurrentValue;
         }
         if ($this->CurrentAction == "I" && !$this->EventCancelled) {
             ew_RenderUploadField($this->product_secimage);
         }
         // product_description
         $this->product_description->EditAttrs["class"] = "form-control";
         $this->product_description->EditCustomAttributes = "";
         $this->product_description->EditValue = ew_HtmlEncode($this->product_description->CurrentValue);
         $this->product_description->PlaceHolder = ew_RemoveHtml($this->product_description->FldCaption());
         // feature_ledtype
         $this->feature_ledtype->EditAttrs["class"] = "form-control";
         $this->feature_ledtype->EditCustomAttributes = "";
         $this->feature_ledtype->EditValue = ew_HtmlEncode($this->feature_ledtype->CurrentValue);
         $this->feature_ledtype->PlaceHolder = ew_RemoveHtml($this->feature_ledtype->FldCaption());
         // feature_power
         $this->feature_power->EditAttrs["class"] = "form-control";
         $this->feature_power->EditCustomAttributes = "";
         $this->feature_power->EditValue = ew_HtmlEncode($this->feature_power->CurrentValue);
         $this->feature_power->PlaceHolder = ew_RemoveHtml($this->feature_power->FldCaption());
         // feature_lumen
         $this->feature_lumen->EditAttrs["class"] = "form-control";
         $this->feature_lumen->EditCustomAttributes = "";
         $this->feature_lumen->EditValue = ew_HtmlEncode($this->feature_lumen->CurrentValue);
         $this->feature_lumen->PlaceHolder = ew_RemoveHtml($this->feature_lumen->FldCaption());
         // feature_viewangle
         $this->feature_viewangle->EditAttrs["class"] = "form-control";
         $this->feature_viewangle->EditCustomAttributes = "";
         $this->feature_viewangle->EditValue = ew_HtmlEncode($this->feature_viewangle->CurrentValue);
         $this->feature_viewangle->PlaceHolder = ew_RemoveHtml($this->feature_viewangle->FldCaption());
         // feature_cri
         $this->feature_cri->EditAttrs["class"] = "form-control";
         $this->feature_cri->EditCustomAttributes = "";
         $this->feature_cri->EditValue = ew_HtmlEncode($this->feature_cri->CurrentValue);
         $this->feature_cri->PlaceHolder = ew_RemoveHtml($this->feature_cri->FldCaption());
         // feature_iprating
         $this->feature_iprating->EditAttrs["class"] = "form-control";
         $this->feature_iprating->EditCustomAttributes = "";
         $this->feature_iprating->EditValue = ew_HtmlEncode($this->feature_iprating->CurrentValue);
         $this->feature_iprating->PlaceHolder = ew_RemoveHtml($this->feature_iprating->FldCaption());
         // feature_colortemp
         $this->feature_colortemp->EditAttrs["class"] = "form-control";
         $this->feature_colortemp->EditCustomAttributes = "";
         $this->feature_colortemp->EditValue = ew_HtmlEncode($this->feature_colortemp->CurrentValue);
         $this->feature_colortemp->PlaceHolder = ew_RemoveHtml($this->feature_colortemp->FldCaption());
         // feature_body
         $this->feature_body->EditAttrs["class"] = "form-control";
         $this->feature_body->EditCustomAttributes = "";
         $this->feature_body->EditValue = ew_HtmlEncode($this->feature_body->CurrentValue);
         $this->feature_body->PlaceHolder = ew_RemoveHtml($this->feature_body->FldCaption());
         // feature_cutoutsize
         $this->feature_cutoutsize->EditAttrs["class"] = "form-control";
         $this->feature_cutoutsize->EditCustomAttributes = "";
         $this->feature_cutoutsize->EditValue = ew_HtmlEncode($this->feature_cutoutsize->CurrentValue);
         $this->feature_cutoutsize->PlaceHolder = ew_RemoveHtml($this->feature_cutoutsize->FldCaption());
         // feature_colors
         $this->feature_colors->EditAttrs["class"] = "form-control";
         $this->feature_colors->EditCustomAttributes = "";
         $this->feature_colors->EditValue = ew_HtmlEncode($this->feature_colors->CurrentValue);
         $this->feature_colors->PlaceHolder = ew_RemoveHtml($this->feature_colors->FldCaption());
         // feature_dimmable
         $this->feature_dimmable->EditAttrs["class"] = "form-control";
         $this->feature_dimmable->EditCustomAttributes = "";
         $this->feature_dimmable->EditValue = ew_HtmlEncode($this->feature_dimmable->CurrentValue);
         $this->feature_dimmable->PlaceHolder = ew_RemoveHtml($this->feature_dimmable->FldCaption());
         // feature_warranty
         $this->feature_warranty->EditAttrs["class"] = "form-control";
         $this->feature_warranty->EditCustomAttributes = "";
         $this->feature_warranty->EditValue = ew_HtmlEncode($this->feature_warranty->CurrentValue);
         $this->feature_warranty->PlaceHolder = ew_RemoveHtml($this->feature_warranty->FldCaption());
         // feature_application
         $this->feature_application->EditAttrs["class"] = "form-control";
         $this->feature_application->EditCustomAttributes = "";
         $this->feature_application->EditValue = ew_HtmlEncode($this->feature_application->CurrentValue);
         $this->feature_application->PlaceHolder = ew_RemoveHtml($this->feature_application->FldCaption());
         // Edit refer script
         // product_id
         $this->product_id->HrefValue = "";
         // category_id
         $this->category_id->HrefValue = "";
         // scat_id
         $this->scat_id->HrefValue = "";
         // product_name
         $this->product_name->HrefValue = "";
         // product_image
         $this->product_image->HrefValue = "";
         $this->product_image->HrefValue2 = $this->product_image->UploadPath . $this->product_image->Upload->DbValue;
         // product_secimage
         $this->product_secimage->HrefValue = "";
         $this->product_secimage->HrefValue2 = $this->product_secimage->UploadPath . $this->product_secimage->Upload->DbValue;
         // product_description
         $this->product_description->HrefValue = "";
         // feature_ledtype
         $this->feature_ledtype->HrefValue = "";
         // feature_power
         $this->feature_power->HrefValue = "";
         // feature_lumen
         $this->feature_lumen->HrefValue = "";
         // feature_viewangle
         $this->feature_viewangle->HrefValue = "";
         // feature_cri
         $this->feature_cri->HrefValue = "";
         // feature_iprating
         $this->feature_iprating->HrefValue = "";
         // feature_colortemp
         $this->feature_colortemp->HrefValue = "";
         // feature_body
         $this->feature_body->HrefValue = "";
         // feature_cutoutsize
         $this->feature_cutoutsize->HrefValue = "";
         // feature_colors
         $this->feature_colors->HrefValue = "";
         // feature_dimmable
         $this->feature_dimmable->HrefValue = "";
         // feature_warranty
         $this->feature_warranty->HrefValue = "";
         // feature_application
         $this->feature_application->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #13
0
<?php

include "migrate/mysql_connect.php";
session_start();
$ip = 'heroeverything.com';
if (!empty($_POST['email']) and !empty($_POST['pw'])) {
    $dbh = Conn();
    $sth = $dbh->prepare('select userid, passwd from User where email = ?');
    $sth->execute(array($_POST['email']));
    $result = $sth->fetch(PDO::FETCH_ASSOC);
    $count = $sth->rowCount();
    if ($count > 0) {
        if (!empty($result['passwd']) and md5($_POST['pw']) == $result['passwd']) {
            $_SESSION['userid'] = $result['userid'];
            header("Location: http://{$ip}/user.php");
        } else {
            echo "<script>alert(\"輸入密碼錯誤,請重新輸入\");location.href = 'http://heroeverything.com/index.php';</script>";
            //header("Location: http://$ip/index.php");
            //header('Location: http://10.0.0.79/index.php');
        }
    } else {
        $sql = "insert into User (`email`, `nickname`, `passwd`, `desc`, `orgname`, `bar_list`, `lastlog`, `ip`) values (?, 'test', ?, 'test', 'test', null, null, '127.0.0.1')";
        $sth = $dbh->prepare($sql);
        $sth->execute(array($_POST['email'], md5($_POST['pw'])));
        $userid = $dbh->lastInsertId();
        $_SESSION['userid'] = $userid;
        header("Location: http://{$ip}/user.php");
        //header('Location: http://10.0.0.188/user.php');
    }
    $dbh = null;
}
Example #14
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // expense_id
     // user_id
     // rider_id
     // expense_date
     // expense_month
     // expense_cat
     // expense_amount
     // expense_detail
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // expense_id
         $this->expense_id->ViewValue = $this->expense_id->CurrentValue;
         $this->expense_id->ViewCustomAttributes = "";
         // user_id
         if (strval($this->user_id->CurrentValue) != "") {
             $sFilterWrk = "`user_id`" . ew_SearchString("=", $this->user_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `user_id`, `username` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `user`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->user_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->user_id->ViewValue = $this->user_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->user_id->ViewValue = $this->user_id->CurrentValue;
             }
         } else {
             $this->user_id->ViewValue = NULL;
         }
         $this->user_id->ViewCustomAttributes = "";
         // rider_id
         if (strval($this->rider_id->CurrentValue) != "") {
             $sFilterWrk = "`rider_id`" . ew_SearchString("=", $this->rider_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `rider_id`, `rider_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `rider`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rider_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->rider_id->ViewValue = $this->rider_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->rider_id->ViewValue = $this->rider_id->CurrentValue;
             }
         } else {
             $this->rider_id->ViewValue = NULL;
         }
         $this->rider_id->ViewCustomAttributes = "";
         // expense_date
         $this->expense_date->ViewValue = $this->expense_date->CurrentValue;
         $this->expense_date->ViewValue = ew_FormatDateTime($this->expense_date->ViewValue, 5);
         $this->expense_date->ViewCustomAttributes = "";
         // expense_month
         if (strval($this->expense_month->CurrentValue) != "") {
             $this->expense_month->ViewValue = $this->expense_month->OptionCaption($this->expense_month->CurrentValue);
         } else {
             $this->expense_month->ViewValue = NULL;
         }
         $this->expense_month->ViewCustomAttributes = "";
         // expense_cat
         if (strval($this->expense_cat->CurrentValue) != "") {
             $this->expense_cat->ViewValue = $this->expense_cat->OptionCaption($this->expense_cat->CurrentValue);
         } else {
             $this->expense_cat->ViewValue = NULL;
         }
         $this->expense_cat->ViewCustomAttributes = "";
         // expense_amount
         $this->expense_amount->ViewValue = $this->expense_amount->CurrentValue;
         $this->expense_amount->ViewCustomAttributes = "";
         // expense_detail
         $this->expense_detail->ViewValue = $this->expense_detail->CurrentValue;
         $this->expense_detail->ViewCustomAttributes = "";
         // expense_id
         $this->expense_id->LinkCustomAttributes = "";
         $this->expense_id->HrefValue = "";
         $this->expense_id->TooltipValue = "";
         // user_id
         $this->user_id->LinkCustomAttributes = "";
         $this->user_id->HrefValue = "";
         $this->user_id->TooltipValue = "";
         // rider_id
         $this->rider_id->LinkCustomAttributes = "";
         $this->rider_id->HrefValue = "";
         $this->rider_id->TooltipValue = "";
         // expense_date
         $this->expense_date->LinkCustomAttributes = "";
         $this->expense_date->HrefValue = "";
         $this->expense_date->TooltipValue = "";
         // expense_month
         $this->expense_month->LinkCustomAttributes = "";
         $this->expense_month->HrefValue = "";
         $this->expense_month->TooltipValue = "";
         // expense_cat
         $this->expense_cat->LinkCustomAttributes = "";
         $this->expense_cat->HrefValue = "";
         $this->expense_cat->TooltipValue = "";
         // expense_amount
         $this->expense_amount->LinkCustomAttributes = "";
         $this->expense_amount->HrefValue = "";
         $this->expense_amount->TooltipValue = "";
         // expense_detail
         $this->expense_detail->LinkCustomAttributes = "";
         $this->expense_detail->HrefValue = "";
         $this->expense_detail->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #15
0
 function EditRow()
 {
     $c =& Conn(EW_USER_LEVEL_PRIV_DBID);
     for ($i = 0; $i < $this->TableNameCount; $i++) {
         $Sql = "SELECT * FROM " . EW_USER_LEVEL_PRIV_TABLE . " WHERE " . EW_USER_LEVEL_PRIV_TABLE_NAME_FIELD . " = '" . ew_AdjustSql($this->TableList[$i][4] . $this->TableList[$i][0], EW_USER_LEVEL_PRIV_DBID) . "' AND " . EW_USER_LEVEL_PRIV_USER_LEVEL_ID_FIELD . " = " . $this->USER_LEVEL_ID->CurrentValue;
         $rs = $c->Execute($Sql);
         if ($rs && !$rs->EOF) {
             $Sql = "UPDATE " . EW_USER_LEVEL_PRIV_TABLE . " SET " . EW_USER_LEVEL_PRIV_PRIV_FIELD . " = " . $this->Privileges[$i] . " WHERE " . EW_USER_LEVEL_PRIV_TABLE_NAME_FIELD . " = '" . ew_AdjustSql($this->TableList[$i][4] . $this->TableList[$i][0], EW_USER_LEVEL_PRIV_DBID) . "' AND " . EW_USER_LEVEL_PRIV_USER_LEVEL_ID_FIELD . " = " . $this->USER_LEVEL_ID->CurrentValue;
             $c->Execute($Sql);
         } else {
             $Sql = "INSERT INTO " . EW_USER_LEVEL_PRIV_TABLE . " (" . EW_USER_LEVEL_PRIV_TABLE_NAME_FIELD . ", " . EW_USER_LEVEL_PRIV_USER_LEVEL_ID_FIELD . ", " . EW_USER_LEVEL_PRIV_PRIV_FIELD . ") VALUES ('" . ew_AdjustSql($this->TableList[$i][4] . $this->TableList[$i][0], EW_USER_LEVEL_PRIV_DBID) . "', " . $this->USER_LEVEL_ID->CurrentValue . ", " . $this->Privileges[$i] . ")";
             $c->Execute($Sql);
         }
         if ($rs) {
             $rs->Close();
         }
     }
     return TRUE;
 }
Example #16
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // mid
     // rider_id
     // package_id
     // mcardnumber
     // missuedate
     // mexpirydate
     // mname
     // midcard
     // mcellno
     // maddress
     // marea
     // mnotes
     // mamount
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // rider_id
         if (strval($this->rider_id->CurrentValue) != "") {
             $sFilterWrk = "`rider_id`" . ew_SearchString("=", $this->rider_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `rider_id`, `rider_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `rider`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->rider_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->rider_id->ViewValue = $this->rider_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->rider_id->ViewValue = $this->rider_id->CurrentValue;
             }
         } else {
             $this->rider_id->ViewValue = NULL;
         }
         $this->rider_id->ViewCustomAttributes = "";
         // package_id
         if (strval($this->package_id->CurrentValue) != "") {
             $sFilterWrk = "`package_id`" . ew_SearchString("=", $this->package_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `package_id`, `package_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `package`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->package_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->package_id->ViewValue = $this->package_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->package_id->ViewValue = $this->package_id->CurrentValue;
             }
         } else {
             $this->package_id->ViewValue = NULL;
         }
         $this->package_id->ViewCustomAttributes = "";
         // mcardnumber
         $this->mcardnumber->ViewValue = $this->mcardnumber->CurrentValue;
         $this->mcardnumber->ViewCustomAttributes = "";
         // missuedate
         $this->missuedate->ViewValue = $this->missuedate->CurrentValue;
         $this->missuedate->ViewValue = ew_FormatDateTime($this->missuedate->ViewValue, 5);
         $this->missuedate->ViewCustomAttributes = "";
         // mexpirydate
         $this->mexpirydate->ViewValue = $this->mexpirydate->CurrentValue;
         $this->mexpirydate->ViewValue = ew_FormatDateTime($this->mexpirydate->ViewValue, 5);
         $this->mexpirydate->ViewCustomAttributes = "";
         // midcard
         $this->midcard->ViewValue = $this->midcard->CurrentValue;
         $this->midcard->ViewCustomAttributes = "";
         // marea
         if (strval($this->marea->CurrentValue) != "") {
             $this->marea->ViewValue = $this->marea->OptionCaption($this->marea->CurrentValue);
         } else {
             $this->marea->ViewValue = NULL;
         }
         $this->marea->ViewCustomAttributes = "";
         // mnotes
         $this->mnotes->ViewValue = $this->mnotes->CurrentValue;
         $this->mnotes->ViewCustomAttributes = "";
         // mamount
         $this->mamount->ViewValue = $this->mamount->CurrentValue;
         $this->mamount->ViewCustomAttributes = "";
         // rider_id
         $this->rider_id->LinkCustomAttributes = "";
         $this->rider_id->HrefValue = "";
         $this->rider_id->TooltipValue = "";
         // package_id
         $this->package_id->LinkCustomAttributes = "";
         $this->package_id->HrefValue = "";
         $this->package_id->TooltipValue = "";
         // mcardnumber
         $this->mcardnumber->LinkCustomAttributes = "";
         $this->mcardnumber->HrefValue = "";
         $this->mcardnumber->TooltipValue = "";
         // missuedate
         $this->missuedate->LinkCustomAttributes = "";
         $this->missuedate->HrefValue = "";
         $this->missuedate->TooltipValue = "";
         // mexpirydate
         $this->mexpirydate->LinkCustomAttributes = "";
         $this->mexpirydate->HrefValue = "";
         $this->mexpirydate->TooltipValue = "";
         // midcard
         $this->midcard->LinkCustomAttributes = "";
         $this->midcard->HrefValue = "";
         $this->midcard->TooltipValue = "";
         // marea
         $this->marea->LinkCustomAttributes = "";
         $this->marea->HrefValue = "";
         $this->marea->TooltipValue = "";
         // mnotes
         $this->mnotes->LinkCustomAttributes = "";
         $this->mnotes->HrefValue = "";
         $this->mnotes->TooltipValue = "";
         // mamount
         $this->mamount->LinkCustomAttributes = "";
         $this->mamount->HrefValue = "";
         $this->mamount->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #17
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->NUMBER->FormValue == $this->NUMBER->CurrentValue && is_numeric(ew_StrToFloat($this->NUMBER->CurrentValue))) {
         $this->NUMBER->CurrentValue = ew_StrToFloat($this->NUMBER->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // CARD_ID
     // NAME_IN_CARD
     // NUMBER
     // CARD_TYPE_ID
     // USER_ID
     $this->USER_ID->CellCssStyle = "white-space: nowrap;";
     // BANK_ID
     // VALID_THRU_MONTH
     // VALID_THRU_YEAR
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // NAME_IN_CARD
         $this->NAME_IN_CARD->ViewValue = $this->NAME_IN_CARD->CurrentValue;
         $this->NAME_IN_CARD->ViewCustomAttributes = "";
         // NUMBER
         $this->NUMBER->ViewValue = $this->NUMBER->CurrentValue;
         $this->NUMBER->ViewCustomAttributes = "";
         // CARD_TYPE_ID
         if (strval($this->CARD_TYPE_ID->CurrentValue) != "") {
             $sFilterWrk = "`CARD_TYPE_ID`" . ew_SearchString("=", $this->CARD_TYPE_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `CARD_TYPE_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `card_type`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `CARD_TYPE_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `card_type`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->CARD_TYPE_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->CARD_TYPE_ID->ViewValue = $this->CARD_TYPE_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->CARD_TYPE_ID->ViewValue = $this->CARD_TYPE_ID->CurrentValue;
             }
         } else {
             $this->CARD_TYPE_ID->ViewValue = NULL;
         }
         $this->CARD_TYPE_ID->ViewCustomAttributes = "";
         // BANK_ID
         if (strval($this->BANK_ID->CurrentValue) != "") {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->BANK_ID->ViewValue = $this->BANK_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->BANK_ID->ViewValue = $this->BANK_ID->CurrentValue;
             }
         } else {
             $this->BANK_ID->ViewValue = NULL;
         }
         $this->BANK_ID->ViewCustomAttributes = "";
         // VALID_THRU_MONTH
         $this->VALID_THRU_MONTH->ViewValue = $this->VALID_THRU_MONTH->CurrentValue;
         $this->VALID_THRU_MONTH->ViewCustomAttributes = "";
         // VALID_THRU_YEAR
         $this->VALID_THRU_YEAR->ViewValue = $this->VALID_THRU_YEAR->CurrentValue;
         $this->VALID_THRU_YEAR->ViewCustomAttributes = "";
         // NAME_IN_CARD
         $this->NAME_IN_CARD->LinkCustomAttributes = "";
         $this->NAME_IN_CARD->HrefValue = "";
         $this->NAME_IN_CARD->TooltipValue = "";
         // NUMBER
         $this->NUMBER->LinkCustomAttributes = "";
         $this->NUMBER->HrefValue = "";
         $this->NUMBER->TooltipValue = "";
         // CARD_TYPE_ID
         $this->CARD_TYPE_ID->LinkCustomAttributes = "";
         $this->CARD_TYPE_ID->HrefValue = "";
         $this->CARD_TYPE_ID->TooltipValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         $this->BANK_ID->TooltipValue = "";
         // VALID_THRU_MONTH
         $this->VALID_THRU_MONTH->LinkCustomAttributes = "";
         $this->VALID_THRU_MONTH->HrefValue = "";
         $this->VALID_THRU_MONTH->TooltipValue = "";
         // VALID_THRU_YEAR
         $this->VALID_THRU_YEAR->LinkCustomAttributes = "";
         $this->VALID_THRU_YEAR->HrefValue = "";
         $this->VALID_THRU_YEAR->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #18
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (nos_members)
     if (!isset($GLOBALS["nos_members"]) || get_class($GLOBALS["nos_members"]) == "cnos_members") {
         $GLOBALS["nos_members"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["nos_members"];
     }
     // Table object (nos_roster_admin)
     if (!isset($GLOBALS['nos_roster_admin'])) {
         $GLOBALS['nos_roster_admin'] = new cnos_roster_admin();
     }
     // 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", 'nos_members', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (nos_roster_admin)
     if (!isset($UserTable)) {
         $UserTable = new cnos_roster_admin();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
Example #19
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // image_id
     // p_id
     // image_name
     // image_detail
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // image_id
         $this->image_id->ViewValue = $this->image_id->CurrentValue;
         $this->image_id->ViewCustomAttributes = "";
         // p_id
         if (strval($this->p_id->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->p_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `id`, `title` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `projects`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->p_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->p_id->ViewValue = $this->p_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->p_id->ViewValue = $this->p_id->CurrentValue;
             }
         } else {
             $this->p_id->ViewValue = NULL;
         }
         $this->p_id->ViewCustomAttributes = "";
         // image_name
         $this->image_name->UploadPath = "/projectimages";
         if (!ew_Empty($this->image_name->Upload->DbValue)) {
             $this->image_name->ViewValue = $this->image_name->Upload->DbValue;
         } else {
             $this->image_name->ViewValue = "";
         }
         $this->image_name->ViewCustomAttributes = "";
         // image_detail
         $this->image_detail->ViewValue = $this->image_detail->CurrentValue;
         $this->image_detail->ViewCustomAttributes = "";
         // p_id
         $this->p_id->LinkCustomAttributes = "";
         $this->p_id->HrefValue = "";
         $this->p_id->TooltipValue = "";
         // image_name
         $this->image_name->LinkCustomAttributes = "";
         $this->image_name->HrefValue = "";
         $this->image_name->HrefValue2 = $this->image_name->UploadPath . $this->image_name->Upload->DbValue;
         $this->image_name->TooltipValue = "";
         // image_detail
         $this->image_detail->LinkCustomAttributes = "";
         $this->image_detail->HrefValue = "";
         $this->image_detail->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // p_id
         $this->p_id->EditAttrs["class"] = "form-control";
         $this->p_id->EditCustomAttributes = "";
         if ($this->p_id->getSessionValue() != "") {
             $this->p_id->CurrentValue = $this->p_id->getSessionValue();
             if (strval($this->p_id->CurrentValue) != "") {
                 $sFilterWrk = "`id`" . ew_SearchString("=", $this->p_id->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `id`, `title` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `projects`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->p_id, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->p_id->ViewValue = $this->p_id->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->p_id->ViewValue = $this->p_id->CurrentValue;
                 }
             } else {
                 $this->p_id->ViewValue = NULL;
             }
             $this->p_id->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->p_id->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`id`" . ew_SearchString("=", $this->p_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             }
             $sSqlWrk = "SELECT `id`, `title` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `projects`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->p_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->p_id->EditValue = $arwrk;
         }
         // image_name
         $this->image_name->EditAttrs["class"] = "form-control";
         $this->image_name->EditCustomAttributes = "";
         $this->image_name->UploadPath = "/projectimages";
         if (!ew_Empty($this->image_name->Upload->DbValue)) {
             $this->image_name->EditValue = $this->image_name->Upload->DbValue;
         } else {
             $this->image_name->EditValue = "";
         }
         if (!ew_Empty($this->image_name->CurrentValue)) {
             $this->image_name->Upload->FileName = $this->image_name->CurrentValue;
         }
         if (($this->CurrentAction == "I" || $this->CurrentAction == "C") && !$this->EventCancelled) {
             ew_RenderUploadField($this->image_name);
         }
         // image_detail
         $this->image_detail->EditAttrs["class"] = "form-control";
         $this->image_detail->EditCustomAttributes = "";
         $this->image_detail->EditValue = ew_HtmlEncode($this->image_detail->CurrentValue);
         $this->image_detail->PlaceHolder = ew_RemoveHtml($this->image_detail->FldCaption());
         // Edit refer script
         // p_id
         $this->p_id->HrefValue = "";
         // image_name
         $this->image_name->HrefValue = "";
         $this->image_name->HrefValue2 = $this->image_name->UploadPath . $this->image_name->Upload->DbValue;
         // image_detail
         $this->image_detail->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #20
0
function API_Re($tid, $co)
{
    global $Channel, $userid, $username, $onlineip;
    ToOnezCode($co);
    $arr = array('fid' => $Channel['forumid'], 'tid' => $tid, 'first' => '0', 'author' => $username, 'authorid' => $userid, 'dateline' => time(), 'message' => $co, 'useip' => $onlineip, 'bbcodeoff' => '0', 'smileyoff' => '-1', 'parseurloff' => '');
    Conn()->insert("posts", $arr);
    Conn()->query("UPDATE " . Conn()->tbl . "threads SET lastposter='{$username}', lastpost='" . time() . "', replies=replies+1 WHERE tid='{$tid}'");
    Conn()->query("UPDATE " . Conn()->tbl . "members SET posts=posts+('+1') , lastpost='" . time() . "'  WHERE uid IN ({$userid})");
    Conn()->query("UPDATE " . Conn()->tbl . "forums SET lastpost='{$tid}\t{$ti}\t" . time() . "\t{$username}', posts=posts+1, todayposts=todayposts+1 WHERE fid='{$Channel['forumid']}'");
    return 1;
}
Example #21
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // delivery_id
     // m_id
     // package_id
     // customer_name
     // customer_cell
     // date
     // month
     // category
     // amount
     // Details
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // delivery_id
         $this->delivery_id->ViewValue = $this->delivery_id->CurrentValue;
         $this->delivery_id->ViewCustomAttributes = "";
         // m_id
         if ($this->m_id->VirtualValue != "") {
             $this->m_id->ViewValue = $this->m_id->VirtualValue;
         } else {
             $this->m_id->ViewValue = $this->m_id->CurrentValue;
             if (strval($this->m_id->CurrentValue) != "") {
                 $sFilterWrk = "`mid`" . ew_SearchString("=", $this->m_id->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `mid`, `mcardnumber` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `members`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->m_id, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->m_id->ViewValue = $this->m_id->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->m_id->ViewValue = $this->m_id->CurrentValue;
                 }
             } else {
                 $this->m_id->ViewValue = NULL;
             }
         }
         $this->m_id->ViewCustomAttributes = "";
         // package_id
         if (strval($this->package_id->CurrentValue) != "") {
             $sFilterWrk = "`package_id`" . ew_SearchString("=", $this->package_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `package_id`, `package_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `package`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->package_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->package_id->ViewValue = $this->package_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->package_id->ViewValue = $this->package_id->CurrentValue;
             }
         } else {
             $this->package_id->ViewValue = NULL;
         }
         $this->package_id->ViewCustomAttributes = "";
         // customer_name
         $this->customer_name->ViewValue = $this->customer_name->CurrentValue;
         $this->customer_name->ViewCustomAttributes = "";
         // customer_cell
         $this->customer_cell->ViewValue = $this->customer_cell->CurrentValue;
         $this->customer_cell->ViewCustomAttributes = "";
         // date
         $this->date->ViewValue = $this->date->CurrentValue;
         $this->date->ViewValue = ew_FormatDateTime($this->date->ViewValue, 7);
         $this->date->ViewCustomAttributes = "";
         // month
         if (strval($this->month->CurrentValue) != "") {
             $this->month->ViewValue = $this->month->OptionCaption($this->month->CurrentValue);
         } else {
             $this->month->ViewValue = NULL;
         }
         $this->month->ViewCustomAttributes = "";
         // category
         if (strval($this->category->CurrentValue) != "") {
             $this->category->ViewValue = $this->category->OptionCaption($this->category->CurrentValue);
         } else {
             $this->category->ViewValue = NULL;
         }
         $this->category->ViewCustomAttributes = "";
         // amount
         $this->amount->ViewValue = $this->amount->CurrentValue;
         $this->amount->ViewCustomAttributes = "";
         // Details
         $this->Details->ViewValue = $this->Details->CurrentValue;
         $this->Details->ViewCustomAttributes = "";
         // m_id
         $this->m_id->LinkCustomAttributes = "";
         $this->m_id->HrefValue = "";
         $this->m_id->TooltipValue = "";
         // package_id
         $this->package_id->LinkCustomAttributes = "";
         $this->package_id->HrefValue = "";
         $this->package_id->TooltipValue = "";
         // customer_name
         $this->customer_name->LinkCustomAttributes = "";
         $this->customer_name->HrefValue = "";
         $this->customer_name->TooltipValue = "";
         // customer_cell
         $this->customer_cell->LinkCustomAttributes = "";
         $this->customer_cell->HrefValue = "";
         $this->customer_cell->TooltipValue = "";
         // date
         $this->date->LinkCustomAttributes = "";
         $this->date->HrefValue = "";
         $this->date->TooltipValue = "";
         // month
         $this->month->LinkCustomAttributes = "";
         $this->month->HrefValue = "";
         $this->month->TooltipValue = "";
         // category
         $this->category->LinkCustomAttributes = "";
         $this->category->HrefValue = "";
         $this->category->TooltipValue = "";
         // amount
         $this->amount->LinkCustomAttributes = "";
         $this->amount->HrefValue = "";
         $this->amount->TooltipValue = "";
         // Details
         $this->Details->LinkCustomAttributes = "";
         $this->Details->HrefValue = "";
         $this->Details->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // m_id
         $this->m_id->EditAttrs["class"] = "form-control";
         $this->m_id->EditCustomAttributes = "";
         $this->m_id->EditValue = ew_HtmlEncode($this->m_id->CurrentValue);
         $this->m_id->PlaceHolder = ew_RemoveHtml($this->m_id->FldCaption());
         // package_id
         $this->package_id->EditCustomAttributes = "";
         if (trim(strval($this->package_id->CurrentValue)) == "") {
             $sFilterWrk = "0=1";
         } else {
             $sFilterWrk = "`package_id`" . ew_SearchString("=", $this->package_id->CurrentValue, EW_DATATYPE_NUMBER, "");
         }
         $sSqlWrk = "SELECT `package_id`, `package_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, `package_id` AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `package`";
         $sWhereWrk = "";
         ew_AddFilter($sWhereWrk, $sFilterWrk);
         $this->Lookup_Selecting($this->package_id, $sWhereWrk);
         // Call Lookup selecting
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = Conn()->Execute($sSqlWrk);
         if ($rswrk && !$rswrk->EOF) {
             // Lookup values found
             $arwrk = array();
             $arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld'));
             $this->package_id->ViewValue = $this->package_id->DisplayValue($arwrk);
         } else {
             $this->package_id->ViewValue = $Language->Phrase("PleaseSelect");
         }
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->package_id->EditValue = $arwrk;
         // customer_name
         $this->customer_name->EditAttrs["class"] = "form-control";
         $this->customer_name->EditCustomAttributes = "";
         $this->customer_name->EditValue = ew_HtmlEncode($this->customer_name->CurrentValue);
         $this->customer_name->PlaceHolder = ew_RemoveHtml($this->customer_name->FldCaption());
         // customer_cell
         $this->customer_cell->EditAttrs["class"] = "form-control";
         $this->customer_cell->EditCustomAttributes = "";
         $this->customer_cell->EditValue = ew_HtmlEncode($this->customer_cell->CurrentValue);
         $this->customer_cell->PlaceHolder = ew_RemoveHtml($this->customer_cell->FldCaption());
         // date
         $this->date->EditAttrs["class"] = "form-control";
         $this->date->EditCustomAttributes = "";
         $this->date->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->date->CurrentValue, 7));
         $this->date->PlaceHolder = ew_RemoveHtml($this->date->FldCaption());
         // month
         $this->month->EditAttrs["class"] = "form-control";
         $this->month->EditCustomAttributes = "";
         $this->month->EditValue = $this->month->Options(TRUE);
         // category
         $this->category->EditAttrs["class"] = "form-control";
         $this->category->EditCustomAttributes = "";
         $this->category->EditValue = $this->category->Options(TRUE);
         // amount
         $this->amount->EditAttrs["class"] = "form-control";
         $this->amount->EditCustomAttributes = "";
         $this->amount->EditValue = ew_HtmlEncode($this->amount->CurrentValue);
         $this->amount->PlaceHolder = ew_RemoveHtml($this->amount->FldCaption());
         // Details
         $this->Details->EditAttrs["class"] = "form-control";
         $this->Details->EditCustomAttributes = "";
         $this->Details->EditValue = ew_HtmlEncode($this->Details->CurrentValue);
         $this->Details->PlaceHolder = ew_RemoveHtml($this->Details->FldCaption());
         // Edit refer script
         // m_id
         $this->m_id->HrefValue = "";
         // package_id
         $this->package_id->HrefValue = "";
         // customer_name
         $this->customer_name->HrefValue = "";
         // customer_cell
         $this->customer_cell->HrefValue = "";
         // date
         $this->date->HrefValue = "";
         // month
         $this->month->HrefValue = "";
         // category
         $this->category->HrefValue = "";
         // amount
         $this->amount->HrefValue = "";
         // Details
         $this->Details->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #22
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // delivery_id
     // m_id
     // package_id
     // customer_name
     // customer_cell
     // date
     // month
     // category
     // amount
     // Details
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // delivery_id
         $this->delivery_id->ViewValue = $this->delivery_id->CurrentValue;
         $this->delivery_id->ViewCustomAttributes = "";
         // m_id
         if ($this->m_id->VirtualValue != "") {
             $this->m_id->ViewValue = $this->m_id->VirtualValue;
         } else {
             $this->m_id->ViewValue = $this->m_id->CurrentValue;
             if (strval($this->m_id->CurrentValue) != "") {
                 $sFilterWrk = "`mid`" . ew_SearchString("=", $this->m_id->CurrentValue, EW_DATATYPE_NUMBER, "");
                 $sSqlWrk = "SELECT `mid`, `mcardnumber` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `members`";
                 $sWhereWrk = "";
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
                 $this->Lookup_Selecting($this->m_id, $sWhereWrk);
                 // Call Lookup selecting
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = Conn()->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $arwrk = array();
                     $arwrk[1] = $rswrk->fields('DispFld');
                     $this->m_id->ViewValue = $this->m_id->DisplayValue($arwrk);
                     $rswrk->Close();
                 } else {
                     $this->m_id->ViewValue = $this->m_id->CurrentValue;
                 }
             } else {
                 $this->m_id->ViewValue = NULL;
             }
         }
         $this->m_id->ViewCustomAttributes = "";
         // package_id
         if (strval($this->package_id->CurrentValue) != "") {
             $sFilterWrk = "`package_id`" . ew_SearchString("=", $this->package_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `package_id`, `package_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `package`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->package_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->package_id->ViewValue = $this->package_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->package_id->ViewValue = $this->package_id->CurrentValue;
             }
         } else {
             $this->package_id->ViewValue = NULL;
         }
         $this->package_id->ViewCustomAttributes = "";
         // customer_name
         $this->customer_name->ViewValue = $this->customer_name->CurrentValue;
         $this->customer_name->ViewCustomAttributes = "";
         // customer_cell
         $this->customer_cell->ViewValue = $this->customer_cell->CurrentValue;
         $this->customer_cell->ViewCustomAttributes = "";
         // date
         $this->date->ViewValue = $this->date->CurrentValue;
         $this->date->ViewValue = ew_FormatDateTime($this->date->ViewValue, 7);
         $this->date->ViewCustomAttributes = "";
         // month
         if (strval($this->month->CurrentValue) != "") {
             $this->month->ViewValue = $this->month->OptionCaption($this->month->CurrentValue);
         } else {
             $this->month->ViewValue = NULL;
         }
         $this->month->ViewCustomAttributes = "";
         // category
         if (strval($this->category->CurrentValue) != "") {
             $this->category->ViewValue = $this->category->OptionCaption($this->category->CurrentValue);
         } else {
             $this->category->ViewValue = NULL;
         }
         $this->category->ViewCustomAttributes = "";
         // amount
         $this->amount->ViewValue = $this->amount->CurrentValue;
         $this->amount->ViewCustomAttributes = "";
         // Details
         $this->Details->ViewValue = $this->Details->CurrentValue;
         $this->Details->ViewCustomAttributes = "";
         // delivery_id
         $this->delivery_id->LinkCustomAttributes = "";
         $this->delivery_id->HrefValue = "";
         $this->delivery_id->TooltipValue = "";
         // m_id
         $this->m_id->LinkCustomAttributes = "";
         $this->m_id->HrefValue = "";
         $this->m_id->TooltipValue = "";
         // package_id
         $this->package_id->LinkCustomAttributes = "";
         $this->package_id->HrefValue = "";
         $this->package_id->TooltipValue = "";
         // customer_name
         $this->customer_name->LinkCustomAttributes = "";
         $this->customer_name->HrefValue = "";
         $this->customer_name->TooltipValue = "";
         // customer_cell
         $this->customer_cell->LinkCustomAttributes = "";
         $this->customer_cell->HrefValue = "";
         $this->customer_cell->TooltipValue = "";
         // date
         $this->date->LinkCustomAttributes = "";
         $this->date->HrefValue = "";
         $this->date->TooltipValue = "";
         // month
         $this->month->LinkCustomAttributes = "";
         $this->month->HrefValue = "";
         $this->month->TooltipValue = "";
         // category
         $this->category->LinkCustomAttributes = "";
         $this->category->HrefValue = "";
         $this->category->TooltipValue = "";
         // amount
         $this->amount->LinkCustomAttributes = "";
         $this->amount->HrefValue = "";
         $this->amount->TooltipValue = "";
         // Details
         $this->Details->LinkCustomAttributes = "";
         $this->Details->HrefValue = "";
         $this->Details->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (air_port)
     if (!isset($GLOBALS["air_port"]) || get_class($GLOBALS["air_port"]) == "cair_port") {
         $GLOBALS["air_port"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["air_port"];
     }
     // Initialize URLs
     $this->ExportPrintUrl = $this->PageUrl() . "export=print";
     $this->ExportExcelUrl = $this->PageUrl() . "export=excel";
     $this->ExportWordUrl = $this->PageUrl() . "export=word";
     $this->ExportHtmlUrl = $this->PageUrl() . "export=html";
     $this->ExportXmlUrl = $this->PageUrl() . "export=xml";
     $this->ExportCsvUrl = $this->PageUrl() . "export=csv";
     $this->ExportPdfUrl = $this->PageUrl() . "export=pdf";
     $this->AddUrl = "air_portadd.php";
     $this->InlineAddUrl = $this->PageUrl() . "a=add";
     $this->GridAddUrl = $this->PageUrl() . "a=gridadd";
     $this->GridEditUrl = $this->PageUrl() . "a=gridedit";
     $this->MultiDeleteUrl = "air_portdelete.php";
     $this->MultiUpdateUrl = "air_portupdate.php";
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'list', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'air_port', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
     // List options
     $this->ListOptions = new cListOptions();
     $this->ListOptions->TableVar = $this->TableVar;
     // Export options
     $this->ExportOptions = new cListOptions();
     $this->ExportOptions->Tag = "div";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Other options
     $this->OtherOptions['addedit'] = new cListOptions();
     $this->OtherOptions['addedit']->Tag = "div";
     $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption";
     $this->OtherOptions['detail'] = new cListOptions();
     $this->OtherOptions['detail']->Tag = "div";
     $this->OtherOptions['detail']->TagClassName = "ewDetailOption";
     $this->OtherOptions['action'] = new cListOptions();
     $this->OtherOptions['action']->Tag = "div";
     $this->OtherOptions['action']->TagClassName = "ewActionOption";
     // Filter options
     $this->FilterOptions = new cListOptions();
     $this->FilterOptions->Tag = "div";
     $this->FilterOptions->TagClassName = "ewFilterOption fair_portlistsrch";
     // List actions
     $this->ListActions = new cListActions();
 }
Example #24
0
function API_Re($tid, $co)
{
    global $Channel, $userid, $username, $onlineip;
    ToOnezCode($co);
    $arr = array('pid' => '', 'fid' => $Channel['forumid'], 'tid' => $tid, 'aid' => '0', 'author' => $username, 'authorid' => $userid, 'icon' => '0', 'postdate' => time(), 'subject' => '', 'userip' => $onlineip, 'ifsign' => '1', 'ipfrom' => getaddress($onlineip), 'ifconvert' => '2', 'ifwordsfb' => '2', 'ifcheck' => '1', 'content' => $co, 'anonymous' => '0', 'ifhide' => '0');
    Conn()->insert("posts", $arr);
    $pid = (int) Conn()->select("posts", "pid", "1 order by tid desc");
    Conn()->query("UPDATE " . Conn()->tbl . "threads SET replies=replies+1,hits=hits+1, lastposter='{$username}', lastpost='" . time() . "' WHERE tid= '{$tid}'");
    Conn()->query("UPDATE " . Conn()->tbl . "memberdata SET  postnum=postnum+1, todaypost=todaypost+1, monthpost=monthpost+1, lastpost='" . time() . "' WHERE uid= '1' ");
    Conn()->query("UPDATE " . Conn()->tbl . "forumdata SET tpost=tpost+'1',article=article+'1' ,lastpost= 'Re:\t{$username}\t" . time() . "\tread.php?tid={$tid}&page=e#a'  WHERE fid= '{$Channel['forumid']}' ");
    $value = (int) Conn()->select("elements", "value", "type='replysort' and mark='{$Channel['forumid']}'");
    $value++;
    Conn()->query("REPLACE INTO " . Conn()->tbl . "elements (type,mark,id,value,addition,special) VALUES  ('replysort','{$Channel['forumid']}','{$tid}','{$value}','','0') , ('replysortday','{$Channel['forumid']}','{$tid}','{$value}','" . time() . "','0') ");
    return 1;
}
Example #25
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     if (!isset($GLOBALS["nos_roster_admin"])) {
         $GLOBALS["nos_roster_admin"] = new cnos_roster_admin();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'logout', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect();
     }
     // User table object (nos_roster_admin)
     if (!isset($UserTable)) {
         $UserTable = new cnos_roster_admin();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
Example #26
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = 48 * 60 * 60;
     // 48 hours for login
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (user)
     if (!isset($GLOBALS["user"]) || get_class($GLOBALS["user"]) == "cuser") {
         $GLOBALS["user"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["user"];
     }
     if (!isset($GLOBALS["user"])) {
         $GLOBALS["user"] =& $this;
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'login', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
Example #27
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (bank)
     if (!isset($GLOBALS["bank"]) || get_class($GLOBALS["bank"]) == "cbank") {
         $GLOBALS["bank"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["bank"];
     }
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'delete', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'bank', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
Example #28
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // product_id
     // category_id
     // scat_id
     // product_name
     // product_image
     // product_secimage
     // product_description
     // feature_ledtype
     // feature_power
     // feature_lumen
     // feature_viewangle
     // feature_cri
     // feature_iprating
     // feature_colortemp
     // feature_body
     // feature_cutoutsize
     // feature_colors
     // feature_dimmable
     // feature_warranty
     // feature_application
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // product_id
         $this->product_id->ViewValue = $this->product_id->CurrentValue;
         $this->product_id->ViewCustomAttributes = "";
         // category_id
         if (strval($this->category_id->CurrentValue) != "") {
             $sFilterWrk = "`category_id`" . ew_SearchString("=", $this->category_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `category_id`, `category_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->category_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->category_id->ViewValue = $this->category_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->category_id->ViewValue = $this->category_id->CurrentValue;
             }
         } else {
             $this->category_id->ViewValue = NULL;
         }
         $this->category_id->ViewCustomAttributes = "";
         // scat_id
         if (strval($this->scat_id->CurrentValue) != "") {
             $sFilterWrk = "`scat_id`" . ew_SearchString("=", $this->scat_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `scat_id`, `scat_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sub_category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->scat_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->scat_id->ViewValue = $this->scat_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->scat_id->ViewValue = $this->scat_id->CurrentValue;
             }
         } else {
             $this->scat_id->ViewValue = NULL;
         }
         $this->scat_id->ViewCustomAttributes = "";
         // product_name
         $this->product_name->ViewValue = $this->product_name->CurrentValue;
         $this->product_name->ViewCustomAttributes = "";
         // product_image
         if (!ew_Empty($this->product_image->Upload->DbValue)) {
             $this->product_image->ViewValue = $this->product_image->Upload->DbValue;
         } else {
             $this->product_image->ViewValue = "";
         }
         $this->product_image->ViewCustomAttributes = "";
         // product_secimage
         if (!ew_Empty($this->product_secimage->Upload->DbValue)) {
             $this->product_secimage->ViewValue = $this->product_secimage->Upload->DbValue;
         } else {
             $this->product_secimage->ViewValue = "";
         }
         $this->product_secimage->ViewCustomAttributes = "";
         // feature_ledtype
         $this->feature_ledtype->ViewValue = $this->feature_ledtype->CurrentValue;
         $this->feature_ledtype->ViewCustomAttributes = "";
         // feature_power
         $this->feature_power->ViewValue = $this->feature_power->CurrentValue;
         $this->feature_power->ViewCustomAttributes = "";
         // feature_lumen
         $this->feature_lumen->ViewValue = $this->feature_lumen->CurrentValue;
         $this->feature_lumen->ViewCustomAttributes = "";
         // feature_viewangle
         $this->feature_viewangle->ViewValue = $this->feature_viewangle->CurrentValue;
         $this->feature_viewangle->ViewCustomAttributes = "";
         // feature_cri
         $this->feature_cri->ViewValue = $this->feature_cri->CurrentValue;
         $this->feature_cri->ViewCustomAttributes = "";
         // feature_iprating
         $this->feature_iprating->ViewValue = $this->feature_iprating->CurrentValue;
         $this->feature_iprating->ViewCustomAttributes = "";
         // feature_colortemp
         $this->feature_colortemp->ViewValue = $this->feature_colortemp->CurrentValue;
         $this->feature_colortemp->ViewCustomAttributes = "";
         // feature_body
         $this->feature_body->ViewValue = $this->feature_body->CurrentValue;
         $this->feature_body->ViewCustomAttributes = "";
         // feature_cutoutsize
         $this->feature_cutoutsize->ViewValue = $this->feature_cutoutsize->CurrentValue;
         $this->feature_cutoutsize->ViewCustomAttributes = "";
         // feature_dimmable
         $this->feature_dimmable->ViewValue = $this->feature_dimmable->CurrentValue;
         $this->feature_dimmable->ViewCustomAttributes = "";
         // feature_warranty
         $this->feature_warranty->ViewValue = $this->feature_warranty->CurrentValue;
         $this->feature_warranty->ViewCustomAttributes = "";
         // product_id
         $this->product_id->LinkCustomAttributes = "";
         $this->product_id->HrefValue = "";
         $this->product_id->TooltipValue = "";
         // category_id
         $this->category_id->LinkCustomAttributes = "";
         $this->category_id->HrefValue = "";
         $this->category_id->TooltipValue = "";
         // scat_id
         $this->scat_id->LinkCustomAttributes = "";
         $this->scat_id->HrefValue = "";
         $this->scat_id->TooltipValue = "";
         // product_name
         $this->product_name->LinkCustomAttributes = "";
         $this->product_name->HrefValue = "";
         $this->product_name->TooltipValue = "";
         // product_image
         $this->product_image->LinkCustomAttributes = "";
         $this->product_image->HrefValue = "";
         $this->product_image->HrefValue2 = $this->product_image->UploadPath . $this->product_image->Upload->DbValue;
         $this->product_image->TooltipValue = "";
         // product_secimage
         $this->product_secimage->LinkCustomAttributes = "";
         $this->product_secimage->HrefValue = "";
         $this->product_secimage->HrefValue2 = $this->product_secimage->UploadPath . $this->product_secimage->Upload->DbValue;
         $this->product_secimage->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
<?php

include 'mysql_connect.php';
$db = Conn();
$sql = "CREATE TABLE IF NOT EXISTS `heroeverything`.`Bar` (\n  `barid` int(11) unsigned NOT NULL AUTO_INCREMENT,\n  `userid` int(11) unsigned NOT NULL,\n  `unit` varchar(11) NOT NULL DEFAULT '',\n  `type` varchar(11) NOT NULL DEFAULT '',\n  `name` varchar(11) NOT NULL DEFAULT '',\n  `title` varchar(20) NOT NULL DEFAULT '',\n  `vol_current` int(11) unsigned NOT NULL,\n  `vol_max` int(11) unsigned NOT NULL,\n  `cron` varchar(30) NOT NULL DEFAULT '',\n  `api_key` varchar(20) DEFAULT NULL,\n  `privacy` varchar(20) DEFAULT NULL,\n  PRIMARY KEY (`barid`)\n) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;";
$db->exec($sql);
$db = null;
Example #30
0
 function &Connection()
 {
     return Conn($this->DBID);
 }