本文整理汇总了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("/\\</", "/\\>/");
$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":
示例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("/\\</", "/\\>/");
$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) {