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


PHP IsNumberType函数代码示例

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


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

示例1: 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

示例2: array

        //	CompanyLastSyncDate - Short Date
        $viewContainer->recId = $recordsCounter;
        $value = $viewContainer->showDBValue("CompanyLastSyncDate", $data, $keylink);
        $row["CompanyLastSyncDate_value"] = $value;
        $format = $pSet->getViewFormat("CompanyLastSyncDate");
        $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($pSet->getFieldType("CompanyLastSyncDate"))) {
            $class = ' rnr-field-number';
        }
        $row["CompanyLastSyncDate_class"] = $class;
        $rowinfo[] = $row;
        if ($b) {
            $rowinfo2[] = $row;
            $b = false;
        }
        $data = $cipherer->DecryptFetchedArray($qResult->fetchAssoc());
    }
    $xt->assign_loopsection("details_row", $rowinfo);
    $xt->assign_loopsection("details_row_header", $rowinfo2);
    // assign class for header
}
$returnJSON = array("success" => true);
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:31,代码来源:CompanyMaster_detailspreview.php

示例3: GetGroupDisplay

function GetGroupDisplay($field, $value) {
    global $locale_info, $rpt_array, $tbl, $fields_type;
    for ($i = 0; $i < count($rpt_array['group_fields']) - 1; $i++){
	$arr = $rpt_array['group_fields'][$i];
	foreach ($rpt_array['totals'] as $fld){
	    if ($arr['name'] == fldname($fld)) {
		if (!is_wr_custom())
		    $ftype = WRGetFieldType($fld['table'] . "." . $fld['name']);
		else
		    $ftype = $fields_type[$fld['name']];
		if ($field == $arr['name']) {
		    if ($arr['int_type'] == 0) {
			$prefix = "";
			if (!is_wr_db())
			    $prefix = $rpt_array["tables"][0] . "_";
			else
			    $field = GoodFieldName($field);
			if ($rpt_array['totals'][$prefix . $field]['curr'] == "true")
			    return str_format_currency($value);
			else
			    return $value;
		    } elseif (IsNumberType($ftype)) {
			$start = $value - ($value % $arr['int_type']);
			$end = $start + $arr['int_type'];
			$prefix = "";
			if (!is_wr_db())
			    $prefix = $rpt_array["tables"][0] . "_";
			else
			    $field = GoodFieldName($field);
			if ($rpt_array['totals'][$prefix . $field]['curr'] == "true")
			    return str_format_currency($start) . " - " . str_format_currency($end);
			else
			    return $start . " - " . $end;
		    } elseif (IsCharType($ftype)) {
			return substr($value, 0, $arr['int_type']);
		    } elseif (IsDateFieldType($ftype)) {
			$tm = db2time($value);
			if (!count($tm))
			    return "";
			if ($arr['int_type'] == 1) { // DATE_INTERVAL_YEAR
			    return $tm[0];
			} elseif ($arr['int_type'] == 2) { // DATE_INTERVAL_QUARTER
			    return $tm[0] . "/Q" . floor(($tm[1] - 1) / 4 + 1);
			} elseif ($arr['int_type'] == 3) { // DATE_INTERVAL_MONTH
			    return @$locale_info["LOCALE_SABBREVMONTHNAME" . $tm[1]] . " " . $tm[0];
			} elseif ($arr['int_type'] == 4) { // DATE_INTERVAL_WEEK
			    $start = getweekstart($tm);
			    $end = adddays($start, 6);
			    return format_shortdate($start) . " - " . format_shortdate($end);
			} elseif ($arr['int_type'] == 5) { // DATE_INTERVAL_DAY
			    return format_shortdate($tm);
			} elseif ($arr['int_type'] == 6) { // DATE_INTERVAL_HOUR
			    $tm[4] = 0;
			    $tm[5] = 0;
			    return str_format_datetime($tm);
			} elseif ($arr['int_type'] == 7) { // DATE_INTERVAL_MINUTE
			    $tm[5] = 0;
			    return str_format_datetime($tm);
			} else {
			    return str_format_datetime($tm);
			}
		    }
		}
	    }
	}
    }
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:67,代码来源:dreport.php

示例4: array

        }
        if ($masterTablesInfoArr[$i]['dispInfo']) {
            $detailKeys = $masterTablesInfoArr[$i]['detailKeys'];
            for ($j = 0; $j < count($detailKeys); $j++) {
                $masterWhere .= " and " . $controls->getControl($detailKeys[$j])->getSuggestWhere('Equals', @$_SESSION[$strTableName . "_masterkey" . ($j + 1)]);
            }
        }
        break;
    }
}
$result = array();
// traversing searchable fields
foreach ($allSearchFields as $f) {
    // filter fields by type
    $fType = $pSet->getFieldType($f);
    if (!IsCharType($fType) && !IsNumberType($fType) && !IsGuid($fType) || in_array($f, $detailKeys)) {
        continue;
    }
    if ($_connection->dbType == nDATABASE_Oracle && IsTextType($fType)) {
        continue;
    }
    if ($searchField != '' && $searchField != GoodFieldName($f) || !$pSet->checkFieldPermissions($f)) {
        continue;
    }
    $fieldControl = $controls->getControl($f);
    $isAggregateField = $pSet->isAggregateField($f);
    $where = $fieldControl->getSuggestWhere($searchOpt, $searchFor, $isAggregateField);
    $having = $fieldControl->getSuggestHaving($searchOpt, $searchFor, $isAggregateField);
    if (!strlen($where) && !strlen($having)) {
        continue;
    }
开发者ID:sdev1,项目名称:CloudStockEnquiry,代码行数:31,代码来源:searchsuggest.php

示例5: fieldClass

 function fieldClass($f)
 {
     if ($this->pSet->getEditFormat($f) == FORMAT_LOOKUP_WIZARD) {
         return '';
     }
     $format = $this->pSet->getViewFormat($f);
     if ($format == FORMAT_FILE) {
         return ' runner-field-file';
     }
     if ($format == FORMAT_AUDIO) {
         return ' runner-field-audio';
     }
     if ($format == FORMAT_CHECKBOX) {
         return ' runner-field-checkbox';
     }
     if ($format == FORMAT_NUMBER || IsNumberType($this->pSet->getFieldType($f))) {
         return ' runner-field-number';
     }
     return "";
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:20,代码来源:listpage.php

示例6: array

// array of vals
$response = array();
if (postvalue("start")) {
    $suggestAllContent = false;
}
$searchFor = postvalue('searchFor');
$searchField = GoodFieldName(postvalue('searchField'));
$strSecuritySql = SecuritySQL("Search", $strTableName);
if ($searchField == "") {
    $allSearchFields = GetTableData($strTableName, '.googleLikeFields', array());
}
// proccess fields and create sql
foreach ($allSearchFields as $f) {
    $fType = GetFieldType($f, $strTableName);
    // filter fields by type
    if (!IsCharType($fType) && !IsNumberType($fType) && !IsGuid($fType) || IsTextType($fType)) {
        continue;
    }
    // get suggest for field
    if (($searchField == '' || $searchField == GoodFieldName($f)) && CheckFieldPermissions($f)) {
        $where = "";
        $having = "";
        if (!$gQuery->IsAggrFuncField(GetFieldIndex($f) - 1)) {
            $where = $searchClauseObj->getSuggestWhere($f, $fType, $suggestAllContent, $searchFor);
        } elseif ($gQuery->IsAggrFuncField(GetFieldIndex($f) - 1)) {
            $having = $searchClauseObj->getSuggestWhere($f, $fType, $suggestAllContent, $searchFor);
        }
        // prepare common vals
        $sqlHead = "SELECT DISTINCT " . GetFullFieldName($f) . " ";
        $oHaving = $gQuery->Having();
        $sqlHaving = $oHaving->toSql($gQuery);
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:searchsuggest.php

示例7: setAttrAlign

 function setAttrAlign($i)
 {
     if ($this->listFields[$i]['editFormat'] == FORMAT_LOOKUP_WIZARD) {
         return 'runner-field-lookup';
     } elseif ($this->listFields[$i]['viewFormat'] == FORMAT_CHECKBOX) {
         return 'runner-field-checkbox';
     } elseif ($this->listFields[$i]['viewFormat'] == FORMAT_NUMBER || IsNumberType(GetFieldType($this->listFields[$i]['fName']))) {
         return 'runner-field-number';
     } elseif ($this->listFields[$i]['viewFormat'] == FORMAT_AUDIO) {
         return 'runner-field-audio';
     } else {
         return false;
     }
 }
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:14,代码来源:listpage.php

示例8: sortFilterBlocks

 /**
  * Sort filter blocks depending on the field's type and format
  * @param &Array filterCtrlBlocks
  */
 protected function sortFilterBlocks(&$filterCtrlBlocks)
 {
     if ($this->sortingType != SORT_BY_DISP_VALUE) {
         return;
     }
     $compareFunction = IsNumberType($this->fieldType) ? "compareBlocksByNumericValues" : "compareBlocksByStringValues";
     usort($filterCtrlBlocks, array("FilterControl", $compareFunction));
     if ($this->isDescendingSortOrder) {
         $filterCtrlBlocks = array_reverse($filterCtrlBlocks);
     }
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:15,代码来源:FilterValuesList.php

示例9: _fetch_array

 /**	
  * Fetch a result row as an  array
  * @param Mixed qHanle				The query handle
  * @param Number assoc (optional)
  * @return Array
  */
 protected function _fetch_array($qHanle, $assoc = 1)
 {
     $ret = array();
     if ($qHanle->EOF()) {
         return false;
     }
     try {
         for ($i = 0; $i < $this->num_fields($qHanle); $i++) {
             if (IsBinaryType($qHanle->Fields[$i]->Type) && $qHanle->Fields[$i]->Type != 128 || $qHanle->Fields[$i]->Type == 203) {
                 $str = "";
                 if ($qHanle->Fields[$i]->ActualSize > 0) {
                     $size = $qHanle->Fields[$i]->ActualSize;
                     $val = $qHanle->Fields[$i]->GetChunk($size);
                     if (is_array($val) || is_object($val)) {
                         $str = str_pad("", $size);
                         $j = 0;
                         foreach ($val as $byte) {
                             $str[$j++] = chr($byte);
                         }
                     } else {
                         $str = $val;
                     }
                 }
                 if ($assoc) {
                     $ret[$qHanle->Fields[$i]->Name] = $str;
                 } else {
                     $ret[$i] = $str;
                 }
             } else {
                 $value = $qHanle->Fields[$i]->Value;
                 if (is_null($value)) {
                     $val = NULL;
                 } else {
                     if (isdatefieldtype($qHanle->Fields[$i]->Type)) {
                         $value = localdatetime2db((string) $qHanle->Fields[$i]->Value, $this->access_dmy);
                     }
                     if (IsNumberType($qHanle->Fields[$i]->Type)) {
                         $val = floatval($value);
                     } else {
                         $val = strval($value);
                     }
                 }
                 if ($assoc) {
                     $ret[$qHanle->Fields[$i]->Name] = $val;
                 } else {
                     $ret[$i] = $val;
                 }
             }
         }
         $qHanle->MoveNext();
     } catch (com_exception $e) {
         trigger_error($e->getMessage(), E_USER_ERROR);
     }
     return $ret;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:61,代码来源:ADOConnection.php

示例10: fieldClass

 /**
  * Get the field's class name to align the field's value 
  * basing on its edti and view formats
  * 
  * @param string	$f field name
  * 
  * @return string
  */
 function fieldClass($f)
 {
     if ($this->pSet->getEditFormat($f) == FORMAT_LOOKUP_WIZARD) {
         return '';
     }
     $format = $this->pSet->getViewFormat($f);
     if ($format == FORMAT_FILE) {
         return ' rnr-field-file';
     }
     if ($this->listGridLayout == gltVERTICAL || $this->listGridLayout == gltCOLUMNS) {
         return '';
     }
     if ($format == FORMAT_AUDIO) {
         return ' rnr-field-audio';
     }
     if ($format == FORMAT_CHECKBOX) {
         return ' rnr-field-checkbox';
     }
     if ($format == FORMAT_NUMBER || IsNumberType($this->pSet->getFieldType($f))) {
         return ' rnr-field-number';
     }
     return 'rnr-field-text';
 }
开发者ID:sdev1,项目名称:CloudStockEnquiry,代码行数:31,代码来源:listpage.php

示例11: prepareFiledsValuesData

 /**
  * Prepare fields' values of numeric and time types for db
  * The fields of other types have been already db-prepared
  * @param Array fieldsValuesData
  * @return Array
  */
 protected function prepareFiledsValuesData($fieldsValuesData)
 {
     global $locale_info;
     $refinedFieldsValuesData = array();
     foreach ($fieldsValuesData as $field => $val) {
         $type = $this->pSet->getFieldType($field);
         if (IsTimeType($type)) {
             $value = prepare_for_db($field, $val, "time", "", $this->tName);
             if (strlen($value) > 0) {
                 $refinedFieldsValuesData[$field] = $value;
             } else {
                 $refinedFieldsValuesData[$field] = NULL;
             }
             continue;
         }
         if (!IsNumberType($type)) {
             $refinedFieldsValuesData[$field] = $val;
             continue;
         }
         $value = str_replace(",", ".", (string) $val);
         if (strlen($value) > 0) {
             if (strpos($value, $locale_info["LOCALE_SCURRENCY"]) !== FALSE) {
                 // try to process the currency format
                 $value = str_replace(array($locale_info["LOCALE_SCURRENCY"], " "), array("", ""), $value);
                 $matches = array();
                 if (preg_match('/^\\((.*)\\)$/', $value, $matches)) {
                     $value = -1 * $matches[1];
                 }
             }
             $refinedFieldsValuesData[$field] = 0 + $value;
         } else {
             $refinedFieldsValuesData[$field] = NULL;
         }
     }
     return $refinedFieldsValuesData;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:42,代码来源:importpage.php

示例12: 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

示例13: SQLStatement

 function SQLStatement($sql, $order, $pagesize, $connection, &$searchClauseObj, &$params)
 {
     // copy properties to object
     RunnerApply($this, $params);
     $this->searchClauseObj = $searchClauseObj;
     $this->pSet = new ProjectSettings($this->tName, PAGE_REPORT);
     if (!is_array($sql)) {
         die('Invalid sql parameter');
     }
     global $reportCaseSensitiveGroupFields;
     $this->_originalSql = $sql;
     $start = 0;
     $fields = array();
     for ($i = 0; $i < count($this->repGroupFields); $i++) {
         for ($j = 0; $j < count($this->fieldsArr); $j++) {
             if ($this->repGroupFields[$i]['strGroupField'] == $this->fieldsArr[$j]['name']) {
                 $add = array();
                 $add['name'] = $this->fieldsArr[$j]['name'];
                 if (IsNumberType($this->pSet->getFieldType($this->fieldsArr[$j]['name']))) {
                     $add['type'] = 'numeric';
                 } elseif (IsCharType($this->pSet->getFieldType($this->fieldsArr[$j]['name']))) {
                     $add['type'] = 'char';
                     $add['case_sensitive'] = $reportCaseSensitiveGroupFields;
                 } elseif (IsDateFieldType($this->pSet->getFieldType($this->fieldsArr[$j]['name']))) {
                     $add['type'] = 'date';
                 } else {
                     $add['type'] = 'char';
                 }
                 $add['interval'] = $this->repGroupFields[$i]['groupInterval'];
                 $add['viewformat'] = $this->fieldsArr[$j]['viewFormat'];
                 $add['rowsinsummary'] = 1;
                 if ($this->fieldsArr[$j]['totalMax'] || $this->fieldsArr[$j]['totalMin'] || $this->fieldsArr[$j]['totalAvg'] || $this->fieldsArr[$j]['totalSum']) {
                     $add['rowsinsummary']++;
                 }
                 if ($this->repLayout == REPORT_STEPPED) {
                     $add['rowsinheader'] = 1;
                 } elseif ($this->repLayout == REPORT_BLOCK) {
                     $add['rowsinheader'] = 0;
                 } elseif ($this->repLayout == REPORT_OUTLINE || $this->repLayout == REPORT_ALIGN) {
                     if ($j == count($this->fieldsArr) - 1) {
                         $add['rowsinheader'] = 2;
                     } else {
                         $add['rowsinheader'] = 1;
                     }
                 } elseif ($this->repLayout == REPORT_TABULAR) {
                     $add['rowsinheader'] = 0;
                 }
                 $fields[] = $add;
             }
         }
     }
     $this->_hasGroups = count($fields) > 0;
     foreach ($fields as $field) {
         $f = create_reportfield($field['name'], $field['type'], $field['interval'], 'grp', $this->tName);
         $start = $f->setStart($start);
         if (isset($field['case_sensitive'])) {
             $f->setCaseSensitive($field['case_sensitive']);
         }
         if (isset($field['rowsinsummary'])) {
             $f->_rowsInSummary = $field['rowsinsummary'];
         }
         if (isset($field['rowsinheader'])) {
             $f->_rowsInHeader = $field['rowsinheader'];
         }
         $f->_viewFormat = $field['viewformat'];
         $this->_fields[] = $f;
     }
     // order
     if ($order) {
         $order_in = array();
         $order_out = array();
         $order_old = array();
         foreach ($order as $o) {
             $order_in[] = $o[2] . ' as ' . cached_ffn('originalorder' . $o[0]);
             $order_out[] = cached_ffn('originalorder' . $o[0]) . ' ' . $o[1];
             $groupField = false;
             for ($i = 0; $i < count($this->repGroupFields); $i++) {
                 for ($j = 0; $j < count($this->fieldsArr); $j++) {
                     if ($this->repGroupFields[$i]['strGroupField'] == $this->fieldsArr[$j]['name']) {
                         $fieldIndex = $this->pSet->GetFieldIndex($this->repGroupFields[$i]['strGroupField']);
                         if ($fieldIndex == $o[0]) {
                             $n = $this->repGroupFields[$i]['groupOrder'] - 1;
                             $this->_fields[$n]->_orderBy = $o[1];
                             $groupField = true;
                         }
                     }
                 }
             }
             //	don't add group fields to the $order_old
             if (!$groupField) {
                 $order_old[] = $o[2] . ' ' . $o[1];
             }
         }
         $this->_order_in = join(', ', $order_in);
         $this->_order_out = join(', ', $order_out);
         $this->_order_old = join(', ', $order_old);
     }
     for ($i = 0; $i < count($this->fieldsArr); $i++) {
         if ($this->fieldsArr[$i]['totalMax']) {
             $this->_aggregates[] = 'MAX(' . cached_ffn($this->fieldsArr[$i]['name'], true) . ') as ' . cached_ffn($this->fieldsArr[$i]['name'] . "MAX");
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:reportlib.php

示例14: isLookupSQLquerySimple

 /**
  * Check if the lookup table doesn't have encription and its SQL query doesn't have HAVING, 
  * ORDER BY clauses and FROM clause with subqueries. #8564	
  * @return Boolean
  */
 protected function isLookupSQLquerySimple()
 {
     if ($this->lookupConnection->dbType == nDATABASE_DB2 || $this->lookupConnection->dbType == nDATABASE_Informix || $this->lookupConnection->dbType == nDATABASE_SQLite3) {
         return false;
     }
     if ($this->lookupType == LT_LOOKUPTABLE || $this->lookupType == LT_LISTOFVALUES) {
         return true;
     }
     // encription is turned on
     if ($this->lookupPSet->hasEncryptedFields()) {
         return false;
     }
     $lookupSqlQuery = $this->lookupPSet->getSQLQuery();
     if ($lookupSqlQuery->HasGroupBy() || $lookupSqlQuery->HavingToSql() != "" || $lookupSqlQuery->HasSubQueryInFromClause()) {
         return false;
     }
     if ($this->lookupConnection->dbType != nDATABASE_MySQL) {
         $linkFieldType = $this->lookupPSet->getFieldType($this->linkFieldName);
         if (!(IsNumberType($this->type) && IsNumberType($linkFieldType) || IsCharType($this->type) && IsCharType($linkFieldType) || IsDateFieldType($this->type) && IsDateFieldType($linkFieldType))) {
             return false;
         }
     }
     return true;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:29,代码来源:LookupField.php

示例15: NeedQuotes

function NeedQuotes($type)
{
    return !IsNumberType($type);
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:4,代码来源:commonfunctions.php


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