当前位置: 首页>>代码示例>>PHP>>正文


PHP getEventObject函数代码示例

本文整理汇总了PHP中getEventObject函数的典型用法代码示例。如果您正苦于以下问题:PHP getEventObject函数的具体用法?PHP getEventObject怎么用?PHP getEventObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getEventObject函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Chart


//.........这里部分代码省略.........
     $gQuery = $this->pSet->getSQLQuery();
     $masterWhere = "";
     if (!$this->dashChart) {
         $masterTable = $_SESSION[$this->sessionPrefix . "_mastertable"];
         $detailKeysByM = $this->pSet->getDetailKeysByMasterTable($masterTable);
         if (count($detailKeysByM)) {
             for ($i = 0; $i < count($detailKeysByM); $i++) {
                 if ($i != 0) {
                     $masterWhere .= " and ";
                 }
                 if ($this->cipherer && isEncryptionByPHPEnabled()) {
                     $mValue = $this->cipherer->MakeDBValue($detailKeysByM[$i], $_SESSION[$this->sessionPrefix . "_masterkey" . ($i + 1)]);
                 } else {
                     $mValue = make_db_value($detailKeysByM[$i], $_SESSION[$this->sessionPrefix . "_masterkey" . ($i + 1)]);
                 }
                 if (strlen($mValue) != 0) {
                     $masterWhere .= RunnerPage::_getFieldSQLDecrypt($detailKeysByM[$i], $this->connection, $this->pSet, $this->cipherer) . "=" . $mValue;
                 } else {
                     $masterWhere .= "1=0";
                 }
             }
         }
     }
     $strWhereClause = "";
     $searchHavingClause = "";
     $strSearchCriteria = "and";
     global $strTableName;
     // search where for basic charts
     if (!$this->webchart) {
         if (!$this->chartPreview && isset($_SESSION[$this->sessionPrefix . '_advsearch'])) {
             $searchClauseObj = SearchClause::UnserializeObject($_SESSION[$this->sessionPrefix . '_advsearch']);
             include_once getabspath('classes/controls/EditControlsContainer.php');
             $editControls = new EditControlsContainer(null, $this->pSet, PAGE_SEARCH, $this->cipherer);
             $whereComponents = RunnerPage::sGetWhereComponents($gQuery, $this->pSet, $searchClauseObj, $editControls, $this->connection);
             $strWhereClause = $whereComponents["searchWhere"];
             foreach ($whereComponents["filterWhere"] as $fWhere) {
                 $strWhereClause = whereAdd($strWhereClause, $fWhere);
             }
             $searchHavingClause = $whereComponents["searchHaving"];
             foreach ($whereComponents["filterHaving"] as $fHaving) {
                 $searchHavingClause = whereAdd($searchHavingClause, $fHaving);
             }
             $strSearchCriteria = $whereComponents["searchUnionRequired"] ? "or" : "and";
         }
     } else {
         if ($this->table_type != "project") {
             $strTableName = "webchart" . $this->cname;
         }
         $strWhereClause = CalcSearchParam($this->table_type != "project");
     }
     if ($strWhereClause) {
         $this->chrt_array['where'] .= $this->chrt_array['where'] ? " AND (" . $strWhereClause . ")" : " WHERE (" . $strWhereClause . ")";
     }
     if ($this->table_type == "project") {
         if (SecuritySQL("Search", $this->chrt_array['tables'][0])) {
             $strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search", $strTableName));
         }
         $this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
         $strOrderBy = $this->gstrOrderBy;
         $this->strSQL .= " " . $strOrderBy;
         if ($masterWhere) {
             $strWhereClause = whereAdd($strWhereClause, $masterWhere);
         }
         $strSQLbak = $this->strSQL;
         if (tableEventExists("BeforeQueryChart", $strTableName)) {
             $tstrSQL = $this->strSQL;
             $eventObj = getEventObject($strTableName);
             $eventObj->BeforeQueryChart($tstrSQL, $strWhereClause, $strOrderBy);
             $this->strSQL = $tstrSQL;
         }
         if ($strSQLbak == $this->strSQL) {
             $this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
             $this->strSQL .= " " . $strOrderBy;
         }
     }
     if ($this->cname && $this->table_type == "db") {
         $this->strSQL = $this->chrt_array['sql'] . $this->chrt_array['where'] . $this->chrt_array['group_by'] . $this->chrt_array['order_by'];
     } elseif ($this->cname && $this->table_type == "custom") {
         if (!IsStoredProcedure($this->chrt_array['sql'])) {
             $sql_query = $this->chrt_array['sql'];
             if ($this->connection->dbType == nDATABASE_MSSQLServer) {
                 $pos = strrpos(strtoupper($sql_query), "ORDER BY");
                 if ($pos) {
                     $sql_query = substr($sql_query, 0, $pos);
                 }
             }
             if ($this->connection->dbType != nDATABASE_Oracle) {
                 $this->strSQL = "select * from (" . $sql_query . ") as " . $this->connection->addFieldWrappers("custom_query") . $this->chrt_array['where'];
             } else {
                 $this->strSQL = "select * from (" . $sql_query . ")" . $this->chrt_array['where'];
             }
         } else {
             $this->strSQL = $this->chrt_array['sql'];
         }
     }
     if (tableEventExists("UpdateChartSettings", $strTableName)) {
         $eventObj = getEventObject($strTableName);
         $eventObj->UpdateChartSettings($this);
     }
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:101,代码来源:charts.php

示例2: DisplayMasterTableInfo_BranchMaster

function DisplayMasterTableInfo_BranchMaster($params)
{
    global $cman;
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    $xt = new Xtempl();
    $tName = "BranchMaster";
    $xt->eventsObject = getEventObject($tName);
    $settings = new ProjectSettings($tName, PAGE_LIST);
    $cipherer = new RunnerCipherer($tName);
    $connection = $cman->byTable($tName);
    $masterQuery = $settings->getSQLQuery();
    $viewControls = new ViewControlsContainer($settings, PAGE_LIST);
    $where = "";
    $keysAssoc = array();
    $showKeys = "";
    if ($detailtable == "Fact_SalesTransaction") {
        $keysAssoc["GroupID"] = $keys[1 - 1];
        $keysAssoc["CompanyID"] = $keys[2 - 1];
        $where .= RunnerPage::_getFieldSQLDecrypt("GroupID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("GroupID", $keys[1 - 1], "", true);
        $keyValue = $viewControls->showDBValue("GroupID", $keysAssoc);
        $showKeys .= " " . GetFieldLabel("BranchMaster", "GroupID") . ": " . $keyValue;
        $where .= " and ";
        $showKeys .= " , ";
        $where .= RunnerPage::_getFieldSQLDecrypt("CompanyID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("CompanyID", $keys[2 - 1], "", true);
        $keyValue = $viewControls->showDBValue("CompanyID", $keysAssoc);
        $showKeys .= " " . GetFieldLabel("BranchMaster", "CompanyID") . ": " . $keyValue;
        $xt->assign('showKeys', $showKeys);
    }
    if (!$where) {
        return;
    }
    $str = SecuritySQL("Search", $tName);
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($masterQuery->WhereToSql(), $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
    LogInfo($strSQL);
    $data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
    if (!$data) {
        return;
    }
    // reassign pagetitlelabel function adding extra params
    $xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
    $keylink = "";
    $xt->assign("BranchCloudFolder_mastervalue", $viewControls->showDBValue("BranchCloudFolder", $data, $keylink));
    $format = $settings->getViewFormat("BranchCloudFolder");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchCloudFolder"))) {
        $class = ' rnr-field-number';
    }
    $xt->assign("BranchCloudFolder_class", $class);
    // add class for field header as field value
    $xt->assign("BranchLastSyncDate_mastervalue", $viewControls->showDBValue("BranchLastSyncDate", $data, $keylink));
    $format = $settings->getViewFormat("BranchLastSyncDate");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchLastSyncDate"))) {
        $class = ' rnr-field-number';
    }
    $xt->assign("BranchLastSyncDate_class", $class);
    // add class for field header as field value
    $xt->assign("l_mastervalue", $viewControls->showDBValue("l", $data, $keylink));
    $format = $settings->getViewFormat("l");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("l"))) {
        $class = ' rnr-field-number';
    }
    $xt->assign("l_class", $class);
    // add class for field header as field value
//.........这里部分代码省略.........
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:101,代码来源:BranchMaster_masterlist.php

示例3: xt_doevent

 function xt_doevent($params)
 {
     if (isset($this->xt_events[@$params["custom1"]])) {
         $eventArr = $this->xt_events[@$params["custom1"]];
         if (isset($eventArr["method"])) {
             $params = array();
             if (isset($eventArr["params"])) {
                 $params = $eventArr["params"];
             }
             $method = $eventArr["method"];
             //			if(method_exists($eventArr["object"],$method))
             $eventArr["object"]->{$method}($params);
             return;
         }
     }
     global $strTableName, $globalEvents;
     if ($this->eventsObject) {
         $eventObj =& $this->eventsObject;
     } elseif (strlen($strTableName)) {
         $eventObj = getEventObject($strTableName);
     } else {
         $eventObj =& $globalEvents;
     }
     if (!$eventObj) {
         return;
     }
     $eventName = $params["custom1"];
     if (!$eventObj->exists($eventName)) {
         return;
     }
     $eventObj->{$eventName}($params);
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:32,代码来源:xtempl.php

示例4: getReport

 function getReport($from = 0)
 {
     global $bSubqueriesSupported;
     $this->init($from);
     // include all records in report with pagination
     $this->_doPaging = $from == -1;
     $isExistTimeFormatField = false;
     for ($i = 0; $i < count($this->fieldsArr); $i++) {
         if ($this->fieldsArr[$i]['viewFormat'] == "Time") {
             $isExistTimeFormatField = true;
             break;
         }
     }
     // retrieve ALL records from table
     $this->_fullRequest = $this->_doPaging || $this->repGlobalSummary && $isExistTimeFormatField;
     // MYSQL version < 5.0
     // a very bad thing to do, but we need this for global summary and pagination
     if (!$bSubqueriesSupported) {
         $this->_fullRequest = true;
     }
     // use non-optimized algorithm
     $this->_recordBasedRequest = $this->_fullRequest;
     // request records if there is no grouping
     if (!$this->repGroupFieldsCount) {
         $this->_recordBasedRequest = true;
     }
     //////////////////////////////// start building report
     $this->_sql->setRecordBasedRequest($this->_recordBasedRequest);
     if ($this->_doPaging || $this->_fullRequest) {
         $this->_sql->_limitLevel = 0;
         // no limits
     } else {
         if (!$this->repGroupFieldsCount) {
             $this->_sql->_limitLevel = 2;
         } else {
             $this->_sql->_limitLevel = 1;
         }
         // limit groups
     }
     $page = -1;
     $nRow = 0;
     if (!$this->_recordBasedRequest) {
         // get groups to show
         $groups = $this->_groups->getDisplayGroups($from);
         // iterate through records in these groups
         $hsql = $this->_sql->sql2($groups);
         if (tableEventExists('BeforeQueryReport', $this->tName)) {
             $hwhere = $hsql['where'];
             $eventsObj = getEventObject($this->tName);
             $eventsObj->BeforeQueryReport($hwhere);
             $hsql['where'] = $hwhere;
         }
         $sql = $this->_sql->buildsql($hsql);
         $cursor = db_query($sql, $this->_connection);
         while ($data = $this->cipherer->DecryptFetchedArray($cursor)) {
             $this->pageObject->recId = $nRow;
             $this->setSummary($this->repShowDet, $data, $this->recordVisible($nRow) ? $this->getFormattedRow($data) : null);
             $nRow++;
         }
     } else {
         $this->_groups->init($from);
         $this->_sql->setOldAlgorithm();
         $hsql = $this->_sql->sql2(null);
         $sql = $this->_sql->buildsql($hsql);
         $cursor = db_query($sql, $this->_connection);
         while ($data = $this->cipherer->DecryptFetchedArray($cursor)) {
             if ($this->repGroupFieldsCount) {
                 // take a record group into account
                 $this->_groups->setGroup($data);
             }
             if ($this->_fullRequest) {
                 $this->_groups->setGlobalSummary(true, $data);
             }
             if ($this->repGroupFieldsCount) {
                 $visible = $this->_doPaging || $this->_groups->isVisibleGroup() || $this->_pagesize == -1;
             } else {
                 $visible = $this->recordVisible($nRow);
             }
             if ($visible) {
                 $this->pageObject->recId = $nRow;
                 $this->setSummary(true, $data, $this->getFormattedRow($data));
             } else {
                 if (!$this->_fullRequest && count($this->_list) > 0) {
                     // exit loop at the end of visible recordset
                     break;
                 }
             }
             $nRow++;
         }
         $this->_sql->setOldAlgorithm(false);
     }
     $this->setFinish();
     $this->makeSummary();
     $global_totals = $this->getTotals();
     $this->writePageSummary();
     $globals = $this->writeGlobalSummary($global_totals);
     if ($this->repGroupFieldsCount) {
         $countrows = $this->_groups->getCountGroups($this->_fullRequest);
         $countGroups = $countrows;
     } else {
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:reportlib.php

示例5: RunnerPage

 function RunnerPage(&$params)
 {
     global $locale_info, $cCharset, $page_layouts;
     // copy properties to object
     RunnerApply($this, $params);
     $this->setTableConnection();
     $this->pSet = new ProjectSettings($this->tName, $this->pageType);
     $this->pSetEdit = $this->pSet;
     $this->pSetSearch = new ProjectSettings($this->tName, PAGE_SEARCH);
     $this->searchTableName = $this->tName;
     $this->assignCipherer();
     include_once getabspath("classes/controls/EditControlsContainer.php");
     $this->controls = new EditControlsContainer($this, $this->pSetEdit, $this->pageType);
     include_once getabspath("classes/controls/ViewControlsContainer.php");
     $this->viewControls = new ViewControlsContainer($this->pSet, $this->pageType, $this);
     $this->gQuery = $this->pSet->getSQLQuery();
     //set google map configuration
     $this->googleMapCfg = array('isUseMainMaps' => false, 'isUseFieldsMaps' => false, 'isUseGoogleMap' => false, 'APIcode' => GetGlobalData("apiGoogleMapsCode", ""), 'mainMapIds' => array(), 'fieldMapsIds' => array(), 'mapsData' => array());
     $this->debugJSMode = false;
     if ($this->flyId < $this->id + 1) {
         $this->flyId = $this->id + 1;
     }
     // get permissions
     if ($this->tName) {
         $this->permis[$this->tName] = $this->getPermissions();
         $this->eventsObject =& getEventObject($this->tName);
     }
     if (!$this->sessionPrefix) {
         $this->assignSessionPrefix();
     }
     $this->isDisplayLoading = $this->pSet->displayLoading();
     //init settingMap globalSettings
     $this->settingsMap["globalSettings"] = array();
     $this->settingsMap["globalSettings"]["shortTNames"] = array();
     $this->searchPanelActivated = $this->checkIfSearchPanelActivated(isMobile());
     //global settings including "shortTNames" might be updated
     $this->setParamsForSearchPanel();
     $this->searchSavingEnabled = $this->isSearchSavingEnabled() && $this->needSearchClauseObj;
     $this->setSessionVariables();
     //	get locking object
     $this->lockingObj = GetLockingObject($this->tName);
     $this->warnLeavingPages = $this->pSet->warnLeavingPages();
     $this->is508 = isEnableSection508();
     $this->isUseVideo = $this->pSet->isUseVideo();
     $this->strCaption = GetTableCaption(GoodFieldName($this->tName));
     $this->tableType = $this->pSet->getTableType();
     $this->isAddWebRep = GetGlobalData("isAddWebRep", false);
     //	get details keys by master table
     $this->detailKeysByM = $this->getDetailKeysByMasterTable();
     $this->isDynamicPerm = GetGlobalData("isDynamicPerm", false);
     $this->shortTableName = $this->pSet->getShortTableName();
     $this->isResizeColumns = $this->pSet->isResizeColumns();
     $this->isUseAjaxSuggest = $this->pSetSearch->isUseAjaxSuggest();
     $this->useDetailsPreview = $this->pSet->isUseDetailsPreview();
     $this->isShowDetailTables = displayDetailsOn($this->tName, $this->pageType);
     //	get all details table for current table
     $this->allDetailsTablesArr = $this->pSet->getDetailTablesArr();
     //	set template file
     $this->setTemplateFile();
     //	init jsSettings
     $this->jsSettings = array();
     $this->jsSettings["tableSettings"] = array();
     $this->jsSettings["tableSettings"][$this->tName] = array();
     $this->jsSettings["tableSettings"][$this->tName]["proxy"] = array("proxy" => "");
     $this->jsSettings["tableSettings"][$this->tName]['fieldSettings'] = array();
     $this->settingsMap["globalSettings"]["webRootPath"] = GetWebRootPath();
     $this->settingsMap["globalSettings"]["ext"] = "php";
     $this->settingsMap["globalSettings"]["charSet"] = $cCharset;
     $this->settingsMap["globalSettings"]["debugMode"] = $this->debugJSMode;
     $this->settingsMap["globalSettings"]["googleMapsApiCode"] = $this->googleMapCfg['APIcode'];
     $this->settingsMap["globalSettings"]["shortTNames"][$this->tName] = $this->shortTableName;
     $globalPopupPagesLayoutNames = GetGlobalData("popupPagesLayoutNames", array());
     if (count($globalPopupPagesLayoutNames)) {
         $this->settingsMap["globalSettings"]["popupPagesLayoutNames"] = $globalPopupPagesLayoutNames;
     }
     //isMobile
     $this->settingsMap["globalSettings"]["isMobile"] = isMobile();
     $this->settingsMap["globalSettings"]["mobileDeteced"] = detectMobileDevice();
     // s508 must be in global settings
     $this->settingsMap['globalSettings']['s508'] = $this->is508;
     $this->settingsMap["globalSettings"]["locale"] = array();
     $this->settingsMap["globalSettings"]["locale"]["dateFormat"] = $locale_info["LOCALE_IDATE"];
     $this->settingsMap["globalSettings"]["locale"]["startWeekDay"] = $locale_info["LOCALE_IFIRSTDAYOFWEEK"];
     $this->settingsMap["globalSettings"]["locale"]["dateDelimiter"] = $locale_info["LOCALE_SDATE"];
     $this->settingsMap["tableSettings"] = array();
     $this->settingsMap['tableSettings']['hasEvents'] = array("default" => false, "jsName" => "hasEvents");
     $this->settingsMap["tableSettings"]["strCaption"] = array("default" => "", "jsName" => "strCaption");
     $this->settingsMap["tableSettings"]["isUseAudio"] = array("default" => false, "jsName" => "isUseAudio");
     //fix it
     $this->settingsMap["tableSettings"]["isUseVideo"] = array("default" => false, "jsName" => "isUseVideo");
     $this->settingsMap['tableSettings']['listGridLayout'] = array("default" => gltHORIZONTAL, "jsName" => "listGridLayout");
     $this->settingsMap["tableSettings"]["rowHighlite"] = array("default" => false, "jsName" => "isUseHighlite");
     $this->settingsMap["tableSettings"]["isUseToolTips"] = array("default" => false, "jsName" => "isUseToolTips");
     $this->settingsMap['tableSettings']['recsPerRowList'] = array("default" => 1, "jsName" => "recsPerRowList");
     $this->settingsMap["tableSettings"]["showAddInPopup"] = array("default" => false, "jsName" => "showAddInPopup");
     $this->settingsMap["tableSettings"]["showEditInPopup"] = array("default" => false, "jsName" => "showEditInPopup");
     $this->settingsMap["tableSettings"]["showViewInPopup"] = array("default" => false, "jsName" => "showViewInPopup");
     $this->settingsMap["tableSettings"]["isResizeColumns"] = array("default" => false, "jsName" => "isUseResize");
     $this->settingsMap["tableSettings"]["useDetailsPreview"] = array("default" => false, "jsName" => "isUseDP");
     $this->settingsMap['tableSettings']['isUsebuttonHandlers'] = array("default" => false, "jsName" => "isUseButtons");
//.........这里部分代码省略.........
开发者ID:sdev1,项目名称:CloudStockEnquiry,代码行数:101,代码来源:runnerpage.php

示例6: getstrSQL

 /**
  * Get a report's SQL query string
  * @param String strSQL		The report table's SQL query
  * @return String	
  */
 protected function getstrSQL($strSQL)
 {
     global $strTableName;
     $group_x = $this->getIntervalType($this->index_field_x);
     $group_y = $this->getIntervalType($this->index_field_y);
     $fName = $this->CrossGoodFieldName($this->dataField);
     $select_field = "' ', ";
     $avg_func = "";
     if ($fName != " ") {
         $select_field = $this->dataGroupFunction . "(" . $this->connection->addFieldWrappers($fName) . "), ";
         $this->is_value_empty = false;
         $ftype = $this->getFieldType($field);
         if ($this->dataGroupFunction == "avg" && !IsDateFieldType($ftype)) {
             $avg_func = ", sum(" . $this->connection->addFieldWrappers($fName) . ") as " . $this->connection->addFieldWrappers("avg_sum") . ", count(" . $this->connection->addFieldWrappers($fName) . ") as " . $this->connection->addFieldWrappers("avg_count");
         } else {
             $avg_func = ", 1 as " . $this->connection->addFieldWrappers("avg_sum") . ", 1 as " . $this->connection->addFieldWrappers("avg_count");
         }
     }
     $whereClause = "";
     if (tableEventExists("BeforeQueryReport", $strTableName)) {
         $eventObj = getEventObject($strTableName);
         $eventObj->BeforeQueryReport($whereClause);
         if ($whereClause) {
             $whereClause = " where " . $whereClause;
         }
     }
     $selectClause = "select " . $select_field . $group_y[0] . ", " . $group_x[0] . $avg_func;
     $groupByClause = "group by " . $group_x[1] . ", " . $group_y[1];
     $orderByClause = "order by " . $group_x[1] . "," . $group_y[1];
     if ($this->connection->dbType != nDATABASE_Oracle) {
         if ($this->connection->dbType == nDATABASE_MSSQLServer) {
             $pos = strrpos(strtoupper($strSQL), "ORDER BY");
             if ($pos) {
                 $strSQL = substr($strSQL, 0, $pos);
             }
         }
         return $selectClause . " from (" . $strSQL . ") as cross_table" . $whereClause . " " . $groupByClause . " " . $orderByClause;
     }
     return $selectClause . " from (" . $strSQL . ")" . $whereClause . " " . $groupByClause . " " . $orderByClause;
 }
开发者ID:kcallow,项目名称:MatchMe,代码行数:45,代码来源:crosstable_report.php

示例7: xt_doevent

	function xt_doevent($params)
	{
		if (isset($this->xt_events[@$params["custom1"]]))
		{
			$eventArr = $this->xt_events[@$params["custom1"]];
			
			if(isset($eventArr["method"]))
			{
				$params=array();
				if(isset($eventArr["params"]))
					$params=$eventArr["params"];
				$method=$eventArr["method"];
				$eventArr["object"]->$method($params);
				return;
			}
		}
		global $strTableName, $globalEvents;
		if($this->eventsObject)
			$eventObj = &$this->eventsObject;
		elseif(strlen($strTableName))
			$eventObj = getEventObject($strTableName);
		else
			$eventObj = &$globalEvents;
		if(!$eventObj)
			return;
		$eventName = $params["custom1"];
		if(!$eventObj->exists($eventName))
			return;
		$eventObj->$eventName($params);
	}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:30,代码来源:xtempl.php

示例8: RunnerPage

 function RunnerPage(&$params)
 {
     global $locale_info, $cCharset, $page_layouts;
     // copy properties to object
     RunnerApply($this, $params);
     $this->pSet = new ProjectSettings($this->tName, $this->pageType);
     $this->pSetEdit = $this->pSet;
     $this->cipherer = new RunnerCipherer($this->tName, $this->pSet);
     include_once getabspath("classes/controls/EditControlsContainer.php");
     $this->controls = new EditControlsContainer($this);
     include_once getabspath("classes/controls/ViewControlsContainer.php");
     $this->viewControls = new ViewControlsContainer($this->pSet, $this->pageType, $this);
     $this->gQuery = $this->pSet->getSQLQuery();
     //set google map configuration
     $this->googleMapCfg = array('markerAsLinkToView' => true, 'isUseMainMaps' => false, 'isUseFieldsMaps' => false, 'isUseGoogleMap' => false, 'APIcode' => GetGlobalData("apiGoogleMapsCode", ""), 'mainMapIds' => array(), 'fieldMapsIds' => array(), 'mapsData' => array());
     $this->debugJSMode = false;
     if ($this->flyId < $this->id + 1) {
         $this->flyId = $this->id + 1;
     }
     // get permissions
     if ($this->tName) {
         $this->permis[$this->tName] = $this->getPermissions();
         $this->eventsObject =& getEventObject($this->tName);
     }
     if (!$this->sessionPrefix) {
         $this->sessionPrefix = $this->tName;
     }
     $this->setSessionVariables();
     //	get locking object
     $this->lockingObj = GetLockingObject($this->tName);
     $this->is508 = isEnableSection508();
     $this->isEncryptionEnabled = isEncryptionEnabled();
     $this->isEncryptionByPHPEnabled = isEncryptionByPHPEnabled();
     $this->isUseVideo = $this->pSet->isUseVideo();
     $this->isUseAudio = $this->pSet->isUseAudio();
     $this->strCaption = GetTableCaption(GoodFieldName($this->tName));
     $this->isTableType = $this->pSet->isTableType();
     $this->isAddWebRep = GetGlobalData("isAddWebRep", false);
     //	get details keys by master table
     $this->detailKeysByM = $this->pSet->getDetailKeysByMasterTable($this->masterTable);
     $this->isDynamicPerm = GetGlobalData("isDynamicPerm", false);
     $this->shortTableName = $this->pSet->getShortTableName();
     $this->showAddInPopup = $this->pSet->isShowAddInPopup();
     $this->showEditInPopup = $this->pSet->isShowEditInPopup();
     $this->showViewInPopup = $this->pSet->isShowViewInPopup();
     $this->isResizeColumns = $this->pSet->isResizeColumns();
     $this->isUseAjaxSuggest = $this->pSet->isUseAjaxSuggest();
     $this->useDetailsPreview = $this->pSet->isUseDetailsPreview();
     $this->isShowDetailTables = displayDetailsOn($this->tName, $this->pageType);
     //	get all details table for current table
     $this->allDetailsTablesArr = $this->pSet->getDetailTablesArr();
     //	set template file
     $this->setTemplateFile();
     //	init jsSettings
     $this->jsSettings["tableSettings"][$this->tName] = array();
     $this->jsSettings["tableSettings"][$this->tName]["proxy"] = array("proxy" => "");
     $this->jsSettings["tableSettings"][$this->tName]['fieldSettings'] = array();
     $this->settingsMap["globalSettings"] = array();
     $this->settingsMap["globalSettings"]["ext"] = "php";
     $this->settingsMap["globalSettings"]["charSet"] = $cCharset;
     $this->settingsMap["globalSettings"]["debugMode"] = $this->debugJSMode;
     $this->settingsMap["globalSettings"]["googleMapsApiCode"] = $this->googleMapCfg['APIcode'];
     $this->settingsMap["globalSettings"]["shortTNames"][$this->tName] = $this->shortTableName;
     //isMobile
     $this->settingsMap["globalSettings"]["isMobile"] = isMobile();
     // s508 must be in global settings
     $this->settingsMap['globalSettings']['s508'] = $this->is508;
     $this->settingsMap["globalSettings"]["locale"]["dateFormat"] = $locale_info["LOCALE_IDATE"];
     $this->settingsMap["globalSettings"]["locale"]["startWeekDay"] = $locale_info["LOCALE_IFIRSTDAYOFWEEK"];
     $this->settingsMap["globalSettings"]["locale"]["dateDelimiter"] = $locale_info["LOCALE_SDATE"];
     $this->settingsMap["tableSettings"] = array();
     $this->settingsMap['tableSettings']['hasEvents'] = array("default" => false, "jsName" => "hasEvents");
     $this->settingsMap["tableSettings"]["listIcons"] = array("default" => false, "jsName" => "listIcons");
     $this->settingsMap["tableSettings"]["strCaption"] = array("default" => "", "jsName" => "strCaption");
     $this->settingsMap["tableSettings"]["isUseAudio"] = array("default" => false, "jsName" => "isUseAudio");
     $this->settingsMap["tableSettings"]["isUseVideo"] = array("default" => false, "jsName" => "isUseVideo");
     $this->settingsMap['tableSettings']['isVerLayout'] = array("default" => false, "jsName" => "isVertLayout");
     $this->settingsMap["tableSettings"]["rowHighlite"] = array("default" => false, "jsName" => "isUseHighlite");
     $this->settingsMap["tableSettings"]["isUseToolTips"] = array("default" => false, "jsName" => "isUseToolTips");
     $this->settingsMap['tableSettings']['recsPerRowList'] = array("default" => 1, "jsName" => "recsPerRowList");
     $this->settingsMap["tableSettings"]["showAddInPopup"] = array("default" => false, "jsName" => "showAddInPopup");
     $this->settingsMap["tableSettings"]["showEditInPopup"] = array("default" => false, "jsName" => "showEditInPopup");
     $this->settingsMap["tableSettings"]["showViewInPopup"] = array("default" => false, "jsName" => "showViewInPopup");
     $this->settingsMap["tableSettings"]["isResizeColumns"] = array("default" => false, "jsName" => "isUseResize");
     $this->settingsMap["tableSettings"]["isUseAjaxSuggest"] = array("default" => true, "jsName" => "ajaxSuggest");
     $this->settingsMap["tableSettings"]["useDetailsPreview"] = array("default" => false, "jsName" => "isUseDP");
     $this->settingsMap['tableSettings']['isUsebuttonHandlers'] = array("default" => false, "jsName" => "isUseButtons");
     if ($this->pageType == PAGE_REGISTER || $this->pageType == PAGE_CHANGEPASS) {
         $layout = GetPageLayout('', $this->pageType);
     } else {
         $layout = GetPageLayout($this->shortTableName, $this->pageType);
     }
     if ($layout) {
         $rtl = $this->xt->getReadingOrder() == 'RTL' ? 'RTL' : '';
         $this->jsSettings['tableSettings'][$this->tName]['pageCSS'] = "styles/" . $layout->style . '/style' . $rtl . ".css";
         $this->jsSettings['tableSettings'][$this->tName]['pageLayout'] = "pagestyles/" . $layout->name . $rtl . ".css";
         $this->jsSettings['tableSettings'][$this->tName]['pageSkinStyle'] = $layout->style . " page-" . $layout->name;
     }
     $this->settingsMap["fieldSettings"]["UseTimestamp"] = array("default" => false, "jsName" => "isUseTimeStamp");
     $this->settingsMap["fieldSettings"]["strName"] = array("default" => "", "jsName" => "strName");
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:runnerpage.php

示例9: getstrSQL

 function getstrSQL()
 {
     global $strSQL;
     $gr_x = $_SESSION[$this->TableName . "_gr_x"];
     $gr_y = $_SESSION[$this->TableName . "_gr_y"];
     $index_field = $_SESSION[$this->TableName . "_field"];
     $group_func = $_SESSION[$this->TableName . "_group_func"];
     $group_x = array();
     $group_y = array();
     $arr_value = array();
     if ($gr_x == "") {
         $this->index_field_x = $this->getFirstGroupField("x");
         $group_x = $this->getIntervalType($this->index_field_x);
     } else {
         $group_x = $this->getIntervalType($gr_x);
         $this->index_field_x = $gr_x;
     }
     if ($gr_y == "") {
         $this->index_field_y = $this->getFirstGroupField("y");
         $group_y = $this->getIntervalType($this->index_field_y);
     } else {
         $group_y = $this->getIntervalType($gr_y);
         $this->index_field_y = $gr_y;
     }
     $arr_value = $this->getSelectedValue();
     if ($index_field == "") {
         if (!empty($arr_value)) {
             $field = $arr_value[0];
             $val = AddFieldWrappers($this->CrossGoodFieldName($field));
         } else {
             $field = $_SESSION['webreports']['group_fields'][0]["name"];
             $val = AddFieldWrappers($this->CrossGoodFieldName($field));
         }
     } else {
         $val = AddFieldWrappers($this->CrossGoodFieldName($arr_value[$index_field]));
         $field = $arr_value[$index_field];
     }
     if ($group_func == "") {
         $group_func = "sum";
     }
     $gr_func = $this->getGroupFunction($field, $group_func);
     $select_field = "' ', ";
     $avg_func = "";
     if ($val != " ") {
         $select_field = $gr_func . "(" . AddFieldWrappers($val) . "), ";
         $this->is_value_empty = false;
         $ftype = $this->getFieldType($field);
         if ($group_func == "avg" && !IsDateFieldType($ftype)) {
             $avg_func = ", sum(" . AddFieldWrappers($val) . ") as " . AddFieldWrappers("avg_sum") . ", count(" . AddFieldWrappers($val) . ") as " . AddFieldWrappers("avg_count");
         } else {
             $avg_func = ", 1 as " . AddFieldWrappers("avg_sum") . ", 1 as " . AddFieldWrappers("avg_count");
         }
     }
     global $strTableName;
     $hwhere = "";
     if (tableEventExists("BeforeQueryReport", $strTableName)) {
         $eventObj = getEventObject($strTableName);
         $eventObj->BeforeQueryReport($hwhere);
         if ($hwhere) {
             $hwhere = " where " . $hwhere;
         }
     }
     $crtableSQL = "select " . $select_field . $group_y[0] . ", " . $group_x[0] . $avg_func . " from (" . $strSQL . ") as cross_table" . $hwhere . " group by " . $group_x[1] . ", " . $group_y[1] . " Order by " . $group_x[1];
     //echo $crtableSQL;
     return $crtableSQL;
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:66,代码来源:crosstable_report.php

示例10: DisplayMasterTableInfoForPrint_calendar_table

function DisplayMasterTableInfoForPrint_calendar_table($params)
{
    global $cman;
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    $xt = new Xtempl();
    $tName = "calendar_table";
    $xt->eventsObject = getEventObject($tName);
    $cipherer = new RunnerCipherer($tName);
    $settings = new ProjectSettings($tName, PAGE_PRINT);
    $connection = $cman->byTable($tName);
    $masterQuery = $settings->getSQLQuery();
    $viewControls = new ViewControlsContainer($settings, PAGE_PRINT);
    $where = "";
    $keysAssoc = array();
    $showKeys = "";
    if ($detailtable == "Fact_SalesTransaction") {
        $keysAssoc["dt"] = $keys[1 - 1];
        $where .= RunnerPage::_getFieldSQLDecrypt("dt", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("dt", $keys[1 - 1], "", true);
        $keyValue = $viewControls->showDBValue("dt", $keysAssoc);
        $showKeys .= " " . GetFieldLabel("calendar_table", "dt") . ": " . $keyValue;
        $xt->assign('showKeys', $showKeys);
    }
    if ($detailtable == "Current Year Sales") {
        $keysAssoc["dt"] = $keys[1 - 1];
        $where .= RunnerPage::_getFieldSQLDecrypt("dt", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("dt", $keys[1 - 1], "", true);
        $keyValue = $viewControls->showDBValue("dt", $keysAssoc);
        $showKeys .= " " . GetFieldLabel("calendar_table", "dt") . ": " . $keyValue;
        $xt->assign('showKeys', $showKeys);
    }
    if (!$where) {
        return;
    }
    $str = SecuritySQL("Export", $tName);
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
    LogInfo($strSQL);
    $data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
    if (!$data) {
        return;
    }
    // reassign pagetitlelabel function adding extra params
    $xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
    $keylink = "";
    $keylink .= "&key1=" . runner_htmlspecialchars(rawurlencode(@$data["dt"]));
    $xt->assign("dt_mastervalue", $viewControls->showDBValue("dt", $data, $keylink));
    $format = $settings->getViewFormat("dt");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("dt"))) {
        $class = ' rnr-field-number';
    }
    $xt->assign("dt_class", $class);
    // add class for field header as field value
    $xt->assign("y_mastervalue", $viewControls->showDBValue("y", $data, $keylink));
    $format = $settings->getViewFormat("y");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("y"))) {
        $class = ' rnr-field-number';
    }
    $xt->assign("y_class", $class);
    // add class for field header as field value
    $xt->assign("q_mastervalue", $viewControls->showDBValue("q", $data, $keylink));
    $format = $settings->getViewFormat("q");
    $class = " rnr-field-text";
    if ($format == FORMAT_FILE) {
        $class = ' rnr-field-file';
    }
    if ($format == FORMAT_AUDIO) {
        $class = ' rnr-field-audio';
    }
    if ($format == FORMAT_CHECKBOX) {
        $class = ' rnr-field-checkbox';
    }
    if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("q"))) {
        $class = ' rnr-field-number';
    }
//.........这里部分代码省略.........
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:101,代码来源:calendar_table_masterprint.php

示例11: Chart


//.........这里部分代码省略.........
         for ($j = 0; $j < count($this->chrt_array['fields']); $j++) {
             if ($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name'] == $this->chrt_array['fields'][$j]['name']) {
                 if ($this->table_type == "project") {
                     $this->label2 = $this->chart_xmlencode(GetFieldLabel($TableName, GoodFieldName($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name'])));
                 } else {
                     $this->label2 = $this->chart_xmlencode($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name']);
                 }
             }
         }
     }
     if ($this->chrt_array["chart_type"]["type"] != "ohlc" && $this->chrt_array["chart_type"]["type"] != "candlestick") {
         foreach ($this->arrDataColor as $ind => $val) {
             if ($ind == 0) {
                 $this->arrAxesColor = "#000000";
             } else {
                 $this->arrAxesColor = "#" . $this->arrDataColor[$ind];
             }
         }
     } else {
         foreach ($this->arrOHLC_color as $ind => $val) {
             if ($ind == 0) {
                 $this->arrAxesColor = "#000000";
             } else {
                 $this->arrAxesColor = "#" . $this->arrOHLC_color[$ind];
             }
         }
     }
     // prepare search params
     $gQuery = $this->pSet->getSQLQuery();
     $strWhereClause = "";
     $searchHavingClause = "";
     $strSearchCriteria = "and";
     global $strTableName;
     // search where for basic charts
     if (!$this->webchart) {
         if (isset($_SESSION[$this->sessionPrefix . '_advsearch'])) {
             $searchClauseObj = unserialize($_SESSION[$this->sessionPrefix . '_advsearch']);
             include_once getabspath('classes/controls/EditControlsContainer.php');
             $editControls = new EditControlsContainer(null, $this->pSet, PAGE_REPORT, $this->cipherer);
             $strWhereClause = $searchClauseObj->getWhere($this->pSet->getListOfFieldsByExprType(false), $editControls);
             $searchHavingClause = $searchClauseObj->getWhere($this->pSet->getListOfFieldsByExprType(true), $editControls);
             $strSearchCriteria = @$_SESSION[$strTableName . "_criteria"];
             if ($searchClauseObj->isUsedSearchFor && !$searchClauseObj->isUsedFieldsForSearch) {
                 $strSearchCriteria = "or";
             }
         }
     } else {
         if ($this->table_type != "project") {
             $strTableName = "webchart" . $this->cname;
         }
         $strWhereClause = CalcSearchParam($this->table_type != "project");
     }
     if ($strWhereClause) {
         $this->chrt_array['where'] .= $this->chrt_array['where'] ? " AND (" . $strWhereClause . ")" : " WHERE (" . $strWhereClause . ")";
     }
     if ($this->table_type == "project") {
         if (SecuritySQL("Search")) {
             $strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search"));
         }
         $this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
         $strOrderBy = $this->gstrOrderBy;
         $this->strSQL .= " " . $strOrderBy;
         $strSQLbak = $this->strSQL;
         if (tableEventExists("BeforeQueryChart", $strTableName)) {
             $tstrSQL = $this->strSQL;
             $eventObj = getEventObject($strTableName);
             $eventObj->BeforeQueryChart($tstrSQL, $strWhereClause, $strOrderBy);
             $this->strSQL = $tstrSQL;
         }
         if ($strSQLbak == $this->strSQL) {
             $this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
             $this->strSQL .= " " . $strOrderBy;
         }
     }
     if ($this->cname && $this->table_type == "db") {
         $this->strSQL = $this->chrt_array['sql'] . $this->chrt_array['where'] . $this->chrt_array['group_by'] . $this->chrt_array['order_by'];
     } elseif ($this->cname && $this->table_type == "custom") {
         if (!IsStoredProcedure($this->chrt_array['sql'])) {
             $sql_query = $this->chrt_array['sql'];
             if (GetDatabaseType() == 2) {
                 $pos = strrpos(strtoupper($sql_query), "ORDER BY");
                 if ($pos) {
                     $sql_query = substr($sql_query, 0, $pos);
                 }
             }
             if (GetDatabaseType() != 1) {
                 //Oracle
                 $this->strSQL = "select * from (" . $sql_query . ") as " . AddFieldWrappers("custom_query") . $this->chrt_array['where'];
             } else {
                 $this->strSQL = "select * from (" . $sql_query . ")" . $this->chrt_array['where'];
             }
         } else {
             $this->strSQL = $this->chrt_array['sql'];
         }
     }
     if (tableEventExists("UpdateChartSettings", $strTableName)) {
         $eventObj = getEventObject($strTableName);
         $eventObj->UpdateChartSettings($this);
     }
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:charts.php


注:本文中的getEventObject函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。