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


PHP CCourse::_Upper方法代码示例

本文整理汇总了PHP中CCourse::_Upper方法的典型用法代码示例。如果您正苦于以下问题:PHP CCourse::_Upper方法的具体用法?PHP CCourse::_Upper怎么用?PHP CCourse::_Upper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCourse的用法示例。


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

示例1: FilterCreate

 /**
  * This code writed not by me, but I rely on it in good state
  */
 public static function FilterCreate($fname, $vals, $type, &$bFullJoin, $cOperationType = false, $bSkipEmpty = true)
 {
     global $DB;
     if (!is_array($vals)) {
         $vals = array($vals);
     }
     if (count($vals) < 1) {
         return "";
     }
     if (is_bool($cOperationType)) {
         if ($cOperationType === true) {
             $cOperationType = "N";
         } else {
             $cOperationType = "E";
         }
     }
     if ($cOperationType == "G") {
         $strOperation = ">";
     } elseif ($cOperationType == "GE") {
         $strOperation = ">=";
     } elseif ($cOperationType == "LE") {
         $strOperation = "<=";
     } elseif ($cOperationType == "L") {
         $strOperation = "<";
     } else {
         $strOperation = "=";
     }
     $bFullJoin = false;
     $bWasLeftJoin = false;
     $res = array();
     for ($i = 0; $i < count($vals); $i++) {
         $val = $vals[$i];
         if (!$bSkipEmpty || strlen($val) > 0 || is_bool($val) && $val === false) {
             switch ($type) {
                 case "string_equal":
                     if (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL OR " . $DB->Length($fname) . "<=0)";
                     } else {
                         $res[] = "(" . ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT (" : "") . CCourse::_Upper($fname) . $strOperation . CCourse::_Upper("'" . $DB->ForSql($val) . "'") . ($cOperationType == "N" ? ")" : "") . ")";
                     }
                     break;
                 case "string":
                     if ($cOperationType == "?") {
                         if (strlen($val) > 0) {
                             $res[] = GetFilterQuery($fname, $val, "Y", array(), "N");
                         }
                     } elseif (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL OR " . $DB->Length($fname) . "<=0)";
                     } else {
                         if ($strOperation == "=") {
                             $res[] = "(" . ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT (" : "") . (strtoupper($DB->type) == "ORACLE" ? CCourse::_Upper($fname) . " LIKE " . CCourse::_Upper("'" . $DB->ForSqlLike($val) . "'") . " ESCAPE '\\'" : $fname . " " . ($strOperation == "=" ? "LIKE" : $strOperation) . " '" . $DB->ForSqlLike($val) . "'") . ($cOperationType == "N" ? ")" : "") . ")";
                         } else {
                             $res[] = "(" . ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT (" : "") . (strtoupper($DB->type) == "ORACLE" ? CCourse::_Upper($fname) . " " . $strOperation . " " . CCourse::_Upper("'" . $DB->ForSql($val) . "'") . " " : $fname . " " . $strOperation . " '" . $DB->ForSql($val) . "'") . ($cOperationType == "N" ? ")" : "") . ")";
                         }
                     }
                     break;
                 case "date":
                     if (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL)";
                     } else {
                         $res[] = "(" . ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT (" : "") . $fname . " " . $strOperation . " " . $DB->CharToDateFunction($DB->ForSql($val), "FULL") . ($cOperationType == "N" ? ")" : "") . ")";
                     }
                     break;
                 case "number":
                     if (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL)";
                     } else {
                         $res[] = "(" . ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT (" : "") . $fname . " " . $strOperation . " '" . DoubleVal($val) . ($cOperationType == "N" ? "')" : "'") . ")";
                     }
                     break;
                     /*
                     case "number_above":
                     	if(strlen($val)<=0)
                     		$res[] = ($cOperationType=="N"?"NOT":"")."(".$fname." IS NULL)";
                     	else
                     		$res[] = ($cOperationType=="N"?" ".$fname." IS NULL OR NOT ":"")."(".$fname." ".$strOperation." '".$DB->ForSql($val)."')";
                     	break;
                     */
             }
             // INNER JOIN in this case
             if (strlen($val) > 0 && $cOperationType != "N") {
                 $bFullJoin = true;
             } else {
                 $bWasLeftJoin = true;
             }
         }
     }
     $strResult = "";
     for ($i = 0; $i < count($res); $i++) {
         if ($i > 0) {
             $strResult .= $cOperationType == "N" ? " AND " : " OR ";
         }
         $strResult .= $res[$i];
     }
     if (count($res) > 1) {
         $strResult = "(" . $strResult . ")";
     }
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:clearnhelper.php


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