當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CVote::err_mess方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:39,代碼來源:vote.php

示例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;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:70,代碼來源:vote.php

示例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;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:50,代碼來源:vote.php


注:本文中的CVote::err_mess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。