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


PHP Contract::getContractRenewalIDByName方法代码示例

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


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

示例1: addWhere


//.........这里部分代码省略.........
                 }
             }
             if (is_int($val) && $val > 0) {
                 if ($nott) {
                     return $link . " (`{$table}`.`{$field}` <> '{$val}' " . $ADD . " ) ";
                 }
                 return $link . " (`{$table}`.`{$field}` = '{$val}' " . $ADD . " ) ";
             }
             break;
         case "glpi_contacts.completename":
             if (in_array($searchtype, array('equals', 'notequals'))) {
                 return " {$link} `{$table}`.`id`" . $SEARCH;
             }
             if ($_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE) {
                 $name1 = 'firstname';
                 $name2 = 'name';
             } else {
                 $name1 = 'name';
                 $name2 = 'firstname';
             }
             $tmplink = 'OR';
             if ($nott) {
                 $tmplink = 'AND';
             }
             return $link . " (`{$table}`.`{$name1}` {$SEARCH}\n                            {$tmplink} `{$table}`.`{$name2}` {$SEARCH}\n                            {$tmplink} CONCAT(`{$table}`.`{$name1}`,' ',`{$table}`.`{$name2}`) {$SEARCH}) ";
         case "glpi_auth_tables.name":
             $user_searchopt = self::getOptions('User');
             $tmplink = 'OR';
             if ($nott) {
                 $tmplink = 'AND';
             }
             return $link . " (`glpi_authmails" . $addtable . "_" . self::computeComplexJoinID($user_searchopt[31]['joinparams']) . "`.`name`\n                           {$SEARCH}\n                           {$tmplink} `glpi_authldaps" . $addtable . "_" . self::computeComplexJoinID($user_searchopt[30]['joinparams']) . "`.`name`\n                           {$SEARCH} ) ";
         case "glpi_contracts.renewal":
             $valid = Contract::getContractRenewalIDByName($val);
             if ($valid > 0) {
                 return $link . " `{$table}`.`{$field}`" . "=" . "'{$valid}'";
             }
             return "";
         case "glpi_profiles.interface":
             if (stristr(Profile::getInterfaceName('central'), $val)) {
                 return $link . " `{$table}`.`{$field}`='central'";
             }
             if (stristr(Profile::getInterfaceName('helpdesk'), $val)) {
                 return $link . " `{$table}`.`{$field}`='helpdesk'";
             }
             return "";
         case "glpi_ipaddresses.name":
             $search = array("/\\&lt;/", "/\\&gt;/");
             $replace = array("<", ">");
             $val = preg_replace($search, $replace, $val);
             if (preg_match("/^\\s*([<>])([=]*)[[:space:]]*([0-9\\.]+)/", $val, $regs)) {
                 if ($nott) {
                     if ($regs[1] == '<') {
                         $regs[1] = '>';
                     } else {
                         $regs[1] = '<';
                     }
                 }
                 $regs[1] .= $regs[2];
                 return $link . " (INET_ATON(`{$table}`.`{$field}`) " . $regs[1] . " INET_ATON('" . $regs[3] . "')) ";
             }
             //             return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link);
             break;
         case "glpi_tickets.status":
         case "glpi_problems.status":
         case "glpi_changes.status":
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:67,代码来源:searcha.class.php

示例2: addWhere


//.........这里部分代码省略.........
             if ($nott && $val != 'NULL' && $val != 'null') {
                 $ADD = " OR `{$table}`.`{$field}` IS NULL";
             }
             if (stristr($val, Infocom::getAmortTypeName(1))) {
                 $val = 1;
             } else {
                 if (stristr($val, Infocom::getAmortTypeName(2))) {
                     $val = 2;
                 }
             }
             if (is_int($val) && $val > 0) {
                 if ($nott) {
                     return $link . " (`{$table}`.`{$field}` <> '{$val}' " . $ADD . " ) ";
                 }
                 return $link . " (`{$table}`.`{$field}` = '{$val}' " . $ADD . " ) ";
             }
             break;
         case "glpi_contacts.completename":
             if (in_array($searchtype, array('equals', 'notequals'))) {
                 return " {$link} `{$table}`.`id`" . $SEARCH;
             }
             if ($_SESSION["glpinames_format"] == FIRSTNAME_BEFORE) {
                 $name1 = 'firstname';
                 $name2 = 'name';
             } else {
                 $name1 = 'name';
                 $name2 = 'firstname';
             }
             return $link . " (`{$table}`.`{$name1}` {$SEARCH}\n                            OR `{$table}`.`{$name2}` {$SEARCH}\n                            OR CONCAT(`{$table}`.`{$name1}`,' ',`{$table}`.`{$name2}`) {$SEARCH}) ";
         case "glpi_auth_tables.name":
             $user_searchopt = self::getOptions('User');
             return $link . " (`glpi_authmails" . $addtable . "_" . self::computeComplexJoinID($user_searchopt[31]['joinparams']) . "`.`name` {$SEARCH}\n                            OR `glpi_authldaps" . $addtable . "_" . self::computeComplexJoinID($user_searchopt[30]['joinparams']) . "`.`name` {$SEARCH} ) ";
         case "glpi_contracts.renewal":
             $valid = Contract::getContractRenewalIDByName($val);
             if ($valid > 0) {
                 return $link . " `{$table}`.`{$field}`" . "=" . "'{$valid}'";
             }
             return "";
         case "glpi_profiles.interface":
             if (stristr(Profile::getInterfaceName('central'), $val)) {
                 return $link . " `{$table}`.`{$field}`='central'";
             }
             if (stristr(Profile::getInterfaceName('helpdesk'), $val)) {
                 return $link . " `{$table}`.`{$field}`='helpdesk'";
             }
             return "";
         case "glpi_networkports.ip":
             $search = array("/\\&lt;/", "/\\&gt;/");
             $replace = array("<", ">");
             $val = preg_replace($search, $replace, $val);
             if (preg_match("/^\\s*([<>])([=]*)[[:space:]]*([0-9\\.]+)/", $val, $regs)) {
                 if ($nott) {
                     if ($regs[1] == '<') {
                         $regs[1] = '>';
                     } else {
                         $regs[1] = '<';
                     }
                 }
                 $regs[1] .= $regs[2];
                 return $link . " (INET_ATON(`{$table}`.`{$field}`) " . $regs[1] . " " . ip2long($regs[3]) . ") ";
             }
             return makeTextCriteria("`{$table}`.`{$field}`", $val, $nott, $link);
         case "glpi_tickets.status":
             $tocheck = array('new' => array('new'), 'notold' => array('new', 'plan', 'assign', 'waiting'), 'notclosed' => array('new', 'plan', 'assign', 'waiting', 'solved'), 'old' => array('solved', 'closed'), 'process' => array('plan', 'assign'), 'waiting' => array('waiting'), 'solved' => array('solved'), 'closed' => array('closed'), 'assign' => array('assign'), 'plan' => array('plan'));
             if (isset($tocheck[$val])) {
                 foreach ($tocheck[$val] as $key => $nval) {
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:67,代码来源:search.class.php


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