當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。