本文整理汇总了PHP中CVote::err_mess方法的典型用法代码示例。如果您正苦于以下问题:PHP CVote::err_mess方法的具体用法?PHP CVote::err_mess怎么用?PHP CVote::err_mess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVote
的用法示例。
在下文中一共展示了CVote::err_mess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Copy
public static function Copy($ID)
{
global $DB;
$err_mess = CVote::err_mess() . "<br>Function: Copy<br>Line: ";
$ID = intval($ID);
if ($ID <= 0) {
return false;
}
$rCurrentVote = CVote::GetByID($ID);
if (!($arCurrentVote = $rCurrentVote->Fetch())) {
return false;
}
unset($arCurrentVote["ID"]);
$arCurrentVote['ACTIVE'] = "N";
$newImageId = false;
if (intval($arCurrentVote['IMAGE_ID'] > 0)) {
$imageId = $arCurrentVote['IMAGE_ID'];
$newImageId = CFile::CopyFile($imageId);
$arCurrentVote["IMAGE_ID"] = NULL;
}
$newID = CVote::Add($arCurrentVote);
if ($newID === false) {
return false;
}
$DB->Update("b_vote", array("COUNTER" => "0"), "WHERE ID=" . $newID, $err_mess . __LINE__);
if ($newImageId) {
$DB->Update("b_vote", array("IMAGE_ID" => $newImageId), "WHERE ID=" . $newID, $err_mess . __LINE__);
}
$state = true;
$rQuestions = CVoteQuestion::GetList($ID, $by, $order, array(), $is_filtered);
while ($arQuestion = $rQuestions->Fetch()) {
$state = $state && CVoteQuestion::Copy($arQuestion['ID'], $newID) !== false;
}
if ($state == true) {
return $newID;
} else {
return $state;
}
}
示例2: GetPublicList
function GetPublicList($arFilter = array(), $strSqlOrder = "ORDER BY C.C_SORT, C.ID, V.DATE_START desc", $params = array())
{
global $DB, $USER;
$err_mess = CVote::err_mess() . "<br>Function: GetPublicList<br>Line: ";
$arSqlSearch = array();
$arFilter = is_array($arFilter) ? $arFilter : array();
$params = is_array($params) ? $params : array();
$left_join = "";
foreach ($arFilter as $key => $val) {
if (empty($val) || is_string($val) && $val === "NOT_REF") {
continue;
}
$key = strtoupper($key);
switch ($key) {
case "SITE":
$val = is_array($val) ? implode(" | ", $val) : $val;
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("CS.SITE_ID", $val, $match);
$left_join = "LEFT JOIN b_vote_channel_2_site CS ON (C.ID = CS.CHANNEL_ID)";
break;
case "CHANNEL":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
if (is_array($val)) {
$arr = array();
foreach ($val as $v) {
$v = trim($v);
if (!empty($v)) {
$arr[] = GetFilterQuery("C.SYMBOLIC_NAME", $v, $match);
}
}
if (!empty($arr)) {
$arSqlSearch[] = "((" . implode(") OR (", $arr) . "))";
}
} else {
$arSqlSearch[] = GetFilterQuery("C.SYMBOLIC_NAME", $val, $match);
}
break;
case "FIRST_SITE_ID":
case "LID":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("C.FIRST_SITE_ID", $val, $match);
break;
}
}
$strSqlSearch = GetFilterSqlSearch($arSqlSearch);
$is_admin = in_array(1, $USER->GetUserGroupArray());
$groups = $USER->GetGroups();
$iCnt = 0;
if (array_key_exists("bDescPageNumbering", $params) && $params["nTopCount"] <= 0 || $params["bCount"] === true) {
$strSql = "SELECT COUNT(V1.ID) CNT\n\t\t\t\tFROM (\n\t\t\t\t\tSELECT V.CHANNEL_ID, V.ID, " . ($is_admin ? "2" : "max(G.PERMISSION)") . " as MAX_PERMISSION\n\t\t\t\t\tFROM b_vote V\n\t\t\t\t\tINNER JOIN b_vote_channel C ON (C.ACTIVE = 'Y' AND C.HIDDEN = 'N' AND V.CHANNEL_ID = C.ID)\n\t\t\t\t\tLEFT JOIN b_vote_channel_2_group G ON (G.CHANNEL_ID = C.ID and G.GROUP_ID in ({$groups}))\n\t\t\t\t\t{$left_join}\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t{$strSqlSearch}\n\t\t\t\t\t\tAND V.ACTIVE = 'Y' AND V.DATE_START <= NOW()\n\t\t\t\t\tGROUP BY V.CHANNEL_ID, V.ID\n\t\t\t\t\t" . ($is_admin ? "" : "\n\t\t\t\t\tHAVING MAX_PERMISSION > 0") . "\n\t\t\t\t) V1";
$db_res = $DB->Query($strSql, false, $err_mess . __LINE__);
if ($db_res && ($res = $db_res->Fetch())) {
$iCnt = intval($res["CNT"]);
}
if ($params["bCount"] === true) {
return $iCnt;
}
}
$strSql = "\n\t\t\tSELECT C.TITLE CHANNEL_TITLE, V.*,\n\t\t\t\t" . $DB->DateToCharFunction("V.DATE_START") . "\tDATE_START,\n\t\t\t\t" . $DB->DateToCharFunction("V.DATE_END") . "\tDATE_END, \n\t\t\t\tV4.MAX_PERMISSION, V4.LAMP\n\t\t\tFROM (\n\t\t\t\tSELECT V.CHANNEL_ID, V.ID,\n\t\t\t\t\t" . ($is_admin ? "2" : "max(G.PERMISSION)") . " as MAX_PERMISSION, \n\t\t\t\t\tIF((C.VOTE_SINGLE = 'Y'), \n\t\t\t\t\t\t(IF(V.ID = VV.ACTIVE_VOTE_ID, 'green', 'red')), \n\t\t\t\t\t\t(IF(V.ACTIVE = 'Y' AND V.DATE_START <= NOW() AND NOW() <= V.DATE_END, 'green', 'red'))) LAMP \n\t\t\t\tFROM b_vote V\n\t\t\t\tINNER JOIN b_vote_channel C ON (C.ACTIVE = 'Y' AND C.HIDDEN = 'N' AND V.CHANNEL_ID = C.ID)\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\tSELECT VVV.CHANNEL_ID, MAX(VVV.ID) AS ACTIVE_VOTE_ID\n\t\t\t\t\tFROM b_vote VVV, b_vote_channel CCC\n\t\t\t\t\tWHERE VVV.CHANNEL_ID = CCC.ID AND CCC.VOTE_SINGLE='Y' AND VVV.ACTIVE = 'Y' \n\t\t\t\t\t\tAND NOW() >= VVV.DATE_START AND VVV.DATE_END >= NOW()\n\t\t\t\t\tGROUP BY VVV.CHANNEL_ID) VV ON (VV.CHANNEL_ID = V.CHANNEL_ID)\n\t\t\t\tLEFT JOIN b_vote_channel_2_group G ON (G.CHANNEL_ID = C.ID and G.GROUP_ID in ({$groups}))\n\t\t\t\t{$left_join}\n\t\t\t\tWHERE\n\t\t\t\t\t{$strSqlSearch}\n\t\t\t\t\tAND V.ACTIVE = 'Y' AND V.DATE_START <= NOW()\n\t\t\t\tGROUP BY V.CHANNEL_ID, V.ID\n\t\t\t\t" . ($is_admin ? "" : "\n\t\t\t\tHAVING MAX_PERMISSION > 0") . "\n\t\t\t) V4\n\t\t\tINNER JOIN b_vote V ON (V4.ID = V.ID)\n\t\t\tINNER JOIN b_vote_channel C ON (V4.CHANNEL_ID = C.ID) \n\t\t\t" . $DB->ForSql($strSqlOrder);
if (array_key_exists("bDescPageNumbering", $params) && $params["nTopCount"] <= 0) {
$db_res = new CDBResult();
$db_res->NavQuery($strSql, $iCnt, $params);
} else {
if ($params["nTopCount"] > 0) {
$strSql .= " LIMIT 0," . intval($params["nTopCount"]);
}
$db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
return $db_res;
}
示例3: GetPublicList
function GetPublicList($arFilter = array(), $strSqlOrder = "ORDER BY C.C_SORT, C.ID, V.DATE_START desc")
{
global $DB, $USER;
$err_mess = CVote::err_mess() . "<br>Function: GetPublicList<br>Line: ";
$arSqlSearch = array();
$strSqlSearch = "";
$arFilter = is_array($arFilter) ? $arFilter : array();
foreach ($arFilter as $key => $val) {
if (empty($val) || is_string($val) && $val === "NOT_REF") {
continue;
}
$key = strtoupper($key);
switch ($key) {
case "SITE":
$val = is_array($val) ? implode(" | ", $val) : $val;
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("CS.SITE_ID", $val, $match);
$left_join = "LEFT JOIN b_vote_channel_2_site CS ON (C.ID = CS.CHANNEL_ID)";
break;
case "CHANNEL":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
if (is_array($val)) {
$arr = array();
foreach ($val as $v) {
$v = trim($v);
if (strLen($v) > 0) {
$arr[] = GetFilterQuery("C.SYMBOLIC_NAME", $v, $match);
}
}
if (!empty($arr)) {
$arSqlSearch[] = "((" . implode(") OR (", $arr) . "))";
}
} else {
$arSqlSearch[] = GetFilterQuery("C.SYMBOLIC_NAME", $val, $match);
}
break;
case "FIRST_SITE_ID":
case "LID":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("C.FIRST_SITE_ID", $val, $match);
break;
}
}
$strSqlSearch = GetFilterSqlSearch($arSqlSearch);
$is_admin = $USER->IsAdmin();
$groups = $USER->GetGroups();
$strSql = "\n\t\t\tSELECT C.TITLE CHANNEL_TITLE, V.*,\n\t\t\t\t" . $DB->DateToCharFunction("V.DATE_START") . "\tDATE_START,\n\t\t\t\t" . $DB->DateToCharFunction("V.DATE_END") . "\tDATE_END, \n\t\t\t\tV4.MAX_PERMISSION, V4.LAMP\n\t\t\tFROM (\n\t\t\t\tSELECT V.CHANNEL_ID, V.ID,\n\t\t\t\t\t" . ($is_admin ? "2" : "max(G.PERMISSION)") . " as MAX_PERMISSION, \n\t\t\t\t\tIF((C.VOTE_SINGLE = 'Y'), \n\t\t\t\t\t\t(IF(V.ID = VV.ACTIVE_VOTE_ID, 'green', 'red')), \n\t\t\t\t\t\t(IF(V.ACTIVE = 'Y' AND V.DATE_START <= NOW() AND NOW() <= V.DATE_END, 'green', 'red'))) LAMP \n\t\t\t\tFROM b_vote V\n\t\t\t\tINNER JOIN b_vote_channel C ON (C.ACTIVE = 'Y' AND C.HIDDEN = 'N' AND V.CHANNEL_ID = C.ID)\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\tSELECT VVV.CHANNEL_ID, MAX(VVV.ID) AS ACTIVE_VOTE_ID\n\t\t\t\t\tFROM b_vote VVV, b_vote_channel CCC\n\t\t\t\t\tWHERE VVV.CHANNEL_ID = CCC.ID AND CCC.VOTE_SINGLE='Y' AND VVV.ACTIVE = 'Y' \n\t\t\t\t\t\tAND NOW() >= VVV.DATE_START AND VVV.DATE_END >= NOW()\n\t\t\t\t\tGROUP BY VVV.CHANNEL_ID) VV ON (VV.CHANNEL_ID = V.CHANNEL_ID)\n\t\t\t\tLEFT JOIN b_vote_channel_2_group G ON (G.CHANNEL_ID = C.ID and G.GROUP_ID in ({$groups}))\n\t\t\t\t{$left_join}\n\t\t\t\tWHERE\n\t\t\t\t\t{$strSqlSearch}\n\t\t\t\t\tAND V.ACTIVE = 'Y' AND V.DATE_START <= NOW()\n\t\t\t\tGROUP BY V.CHANNEL_ID, V.ID\n\t\t\t\t" . ($is_admin ? "" : "\n\t\t\t\tHAVING MAX_PERMISSION > 0") . "\n\t\t\t) V4\n\t\t\tINNER JOIN b_vote V ON (V4.ID = V.ID)\n\t\t\tINNER JOIN b_vote_channel C ON (V4.CHANNEL_ID = C.ID) \n\t\t\t" . $DB->ForSql($strSqlOrder);
$res = $DB->Query($strSql, false, $err_mess . __LINE__);
return $res;
}