8 "reference_id" =>
array(0,1,2,3,4,5),
9 "reference" =>
array(
"radio",
"checkbox",
"dropdown",
"multiselect",
"text",
"textarea")
17 return $object->arType;
25 "reference_id" => array_keys($object->arType),
26 "reference" => array_values($object->arType)
31function GetVoteDataByID($VOTE_ID, &$arChannel, &$arVote, &$arQuestions, &$arAnswers, &$arDropDown, &$arMultiSelect, &$arGroupAnswers, $arAddParams =
"N")
33 $VOTE_ID = intval($VOTE_ID);
36 $arQuestions =
array();
38 $arDropDown =
array();
39 $arMultiSelect =
array();
40 $arAddParams = (is_array($arAddParams) ? $arAddParams :
array(
"bGetMemoStat" => $arAddParams));
42 $GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID] = (isset(
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID]) && is_array(
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID]) ?
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID] :
array());
44 if (empty(
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID]))
54 if (mb_strpos(
$key,
"CHANNEL_") === 0)
56 $arChannel[mb_substr(
$key, 8)] =
$res;
60 $arChannel[
"~".mb_substr(
$key, 9)] =
$res;
68 if (!empty($arQuestions))
71 array(
"C_SORT" =>
"ASC"),
72 array(
"VOTE_ID" => $VOTE_ID,
"ACTIVE" =>
"Y",
"@QUESTION_ID" => array_keys($arQuestions)));
75 $arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ID"]] =
$res;
77 $arAnswers[
$res[
"QUESTION_ID"]][] =
$res;
79 switch (
$res[
"FIELD_TYPE"])
82 $arDropDown[
$res[
"QUESTION_ID"]] = (is_array($arDropDown[
$res[
"QUESTION_ID"]]) ? $arDropDown[
$res[
"QUESTION_ID"]] :
84 $arDropDown[
$res[
"QUESTION_ID"]][
"reference"][] =
$res[
"MESSAGE"];
85 $arDropDown[
$res[
"QUESTION_ID"]][
"~reference"][] =
$res[
"~MESSAGE"];
86 $arDropDown[
$res[
"QUESTION_ID"]][
"reference_id"][] =
$res[
"ID"];
89 $arMultiSelect[
$res[
"QUESTION_ID"]] = (is_array($arMultiSelect[
$res[
"QUESTION_ID"]]) ? $arMultiSelect[
$res[
"QUESTION_ID"]] :
91 $arMultiSelect[
$res[
"QUESTION_ID"]][
"reference"][] =
$res[
"MESSAGE"];
92 $arMultiSelect[
$res[
"QUESTION_ID"]][
"~reference"][] =
$res[
"~MESSAGE"];
93 $arMultiSelect[
$res[
"QUESTION_ID"]][
"reference_id"][] =
$res[
"ID"];
97 $event_id = intval(isset($arAddParams[
"bRestoreVotedData"]) && $arAddParams[
"bRestoreVotedData"] ==
"Y" && isset($_SESSION[
"VOTE"][
"VOTES"][$VOTE_ID]) && !!$_SESSION[
"VOTE"][
"VOTES"][$VOTE_ID] ?
98 $_SESSION[
"VOTE"][
"VOTES"][$VOTE_ID] : 0);
102 array(
"bGetMemoStat" =>
"N",
"bGetEventResults" => $event_id));
107 if (isset($arQuestions[
$res[
"QUESTION_ID"]]) && is_array($arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ANSWER_ID"]]) && is_array(
$res))
109 $arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ANSWER_ID"]] +=
$res;
110 if ($event_id > 0 && !empty(
$res[
"RESTORED_ANSWER_ID"]))
112 switch ($arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ANSWER_ID"]][
"FIELD_TYPE"]):
115 $fieldName = ($arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ANSWER_ID"]][
"FIELD_TYPE"] == 0 ?
116 "vote_radio_" :
"vote_dropdown_").
$res[
"QUESTION_ID"];
121 $fieldName = ($arQuestions[
$res[
"QUESTION_ID"]][
"ANSWERS"][
$res[
"ANSWER_ID"]][
"FIELD_TYPE"] == 1 ?
122 "vote_checkbox_" :
"vote_multiselect_").
$res[
"QUESTION_ID"];
142 reset($arMultiSelect);
151 "M" => $arMultiSelect,
159 if ($arAddParams[
"bGetMemoStat"] ==
"Y" &&
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"GA"] ==
"N")
164 $arGroupAnswers[
$res[
'ANSWER_ID']][] =
$res;
166 $GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"G"] = $arGroupAnswers;
167 $GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"GA"] =
"Y";
170 $arVote =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"V"];
171 $arChannel =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"C"];
172 $arQuestions =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"Q"];
173 $arAnswers =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"A"];
174 $arMultiSelect =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"M"];
175 $arDropDown =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"D"];
176 $arGroupAnswers =
$GLOBALS[
"VOTE_CACHE_VOTING"][$VOTE_ID][
"QA"][
"G"];
177 return $arVote[
"ID"];
184 if (
$zr =
$z->Fetch())
190 if ($vr = $v->Fetch())
return $vr[
"ID"];
201 if (
$zr =
$z->Fetch())
208 while ($vr=$v->Fetch())
213 $VOTE_ID = $vr[
"ID"];
219 return intval($VOTE_ID);
225 $strSqlOrder = (is_string(
$params) ?
$params :
"ORDER BY C.C_SORT, C.ID, V.C_SORT, V.DATE_START desc");
227 if (array_key_exists(
"order",
$params))
228 $strSqlOrder =
$params[
"order"];
233 if (is_array($GROUP_SID) && !empty($GROUP_SID))
236 foreach ($GROUP_SID as $v)
244 elseif (!empty($GROUP_SID))
255 return \Bitrix\Vote\User::getCurrent()->isVotedFor($voteId);
263 if ($channel_id !==
null)
272 while (
$zr =
$z->Fetch())
276 if (intval(
$perm)>=2)
279 while ($vr = $v->Fetch())
287 return array_rand(array_flip(
$arResult));
298 $arReferenceId =
array();
299 $arReference =
array();
303 $path = COption::GetOptionString(
"vote",
"VOTE_TEMPLATE_PATH");
305 $path = COption::GetOptionString(
"vote",
"VOTE_TEMPLATE_PATH_VOTE");
307 $path = COption::GetOptionString(
"vote",
"VOTE_TEMPLATE_PATH_QUESTION");
314 while (
false!==($fname = readdir(
$handle)))
316 if (is_file(
$_SERVER[
"DOCUMENT_ROOT"].
$path.$fname) && $fname!=
"." && $fname!=
"..")
318 $arReferenceId[] = $fname;
319 $arReference[] = $fname;
325 $arr =
array(
"reference" => $arReference,
"reference_id" => $arReferenceId);
332 for ($key1=0; $key1<
$count; $key1++)
334 for ($key2=0; $key2<
$count; $key2++)
336 $sort1 = intval(
$arr[$key1][
"COUNTER"]);
337 $sort2 = intval(
$arr[$key2][
"COUNTER"]);
342 $arr_tmp =
$arr[$key1];
344 $arr[$key2] = $arr_tmp;
351 $arr_tmp =
$arr[$key1];
353 $arr[$key2] = $arr_tmp;
364 if (intval($CURRENT_VOTE_ID)>0)
ShowVote($CURRENT_VOTE_ID);
382 global $VOTING_LAMP, $VOTING_OK, $USER_ALREADY_VOTE, $USER_GROUP_PERMISSION,
$APPLICATION;
384 $VOTING_LAMP = ($VOTING_LAMP ==
"green") ? $VOTING_LAMP :
"red";
385 $VOTING_OK = ($VOTING_OK ==
"Y") ? $VOTING_OK :
"N";
386 $USER_ALREADY_VOTE = ($USER_ALREADY_VOTE ==
"Y") ? $USER_ALREADY_VOTE :
"N";
387 $USER_GROUP_PERMISSION = intval($USER_GROUP_PERMISSION);
388 if ($USER_GROUP_PERMISSION > 2) $USER_GROUP_PERMISSION = 0;
390 $VOTE_ID =
GetVoteDataByID($VOTE_ID, $arChannel, $arVote, $arQuestions, $arAnswers, $arDropDown, $arMultiSelect, $arGroupAnswers,
"N");
391 if (intval($VOTE_ID)>0)
397 if (intval(
$perm)>=2)
399 $template = ($arVote[
"TEMPLATE"] ==
'') ?
"default.php" : $arVote[
"TEMPLATE"];
400 require_once (
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/vote/include.php");
402 $path = COption::GetOptionString(
"vote",
"VOTE_TEMPLATE_PATH");
403 if ($template1 <>
'')
$template = $template1;
408 if (CModule::IncludeModule(
"fileman"))
411 "URL" =>
"/bitrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID.
"&site=".
SITE_ID.
"&full_src=Y&path=". urlencode(
$path.$template),
412 "SRC" =>
"/bitrix/images/vote/panel/edit_template.gif",
413 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_TEMPLATE")
415 $arrUrl = parse_url(
$_SERVER[
"REQUEST_URI"]);
417 "URL" =>
"/bitrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID.
"&site=".
SITE_ID.
"&full_src=Y&path=". urlencode($arrUrl[
"path"]),
418 "SRC" =>
"/bitrix/images/vote/panel/edit_file.gif",
419 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_HANDLER")
423 "URL" =>
"/bitrix/admin/vote_edit.php?lang=".LANGUAGE_ID.
"&ID=".$VOTE_ID,
424 "SRC" =>
"/bitrix/images/vote/panel/edit_vote.gif",
425 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_SETTINGS")
442 $VOTE_ID =
GetVoteDataByID($VOTE_ID, $arChannel, $arVote, $arQuestions, $arAnswers, $arDropDown, $arMultiSelect, $arGroupAnswers,
"Y");
443 if (intval($VOTE_ID)>0)
446 global $VOTE_PERMISSION;
451 if (intval(
$perm)>=1)
453 $template = ($arVote[
"RESULT_TEMPLATE"] ==
'') ?
"default.php" : $arVote[
"RESULT_TEMPLATE"];
454 require_once (
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/vote/include.php");
456 $path = COption::GetOptionString(
"vote",
"VOTE_TEMPLATE_PATH_VOTE");
457 if ($template1 <>
'')
$template = $template1;
461 if (CModule::IncludeModule(
"fileman"))
465 "URL" =>
"/bitrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID.
"&site=".
SITE_ID.
"&full_src=Y&path=". urlencode(
$path.$template),
466 "SRC" =>
"/bitrix/images/vote/panel/edit_template.gif",
467 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_TEMPLATE")
469 $arrUrl = parse_url(
$_SERVER[
"REQUEST_URI"]);
472 "URL" =>
"/bitrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID.
"&site=".
SITE_ID.
"&full_src=Y&path=". urlencode($arrUrl[
"path"]),
473 "SRC" =>
"/bitrix/images/vote/panel/edit_file.gif",
474 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_HANDLER")
479 "URL" =>
"/bitrix/admin/vote_edit.php?lang=".LANGUAGE_ID.
"&ID=".$VOTE_ID,
480 "SRC" =>
"/bitrix/images/vote/panel/edit_vote.gif",
481 "ALT" =>
GetMessage(
"VOTE_PUBLIC_ICON_SETTINGS")
497 global $diameter, $centerX, $centerY, $im, $radius;
498 $radius = $diameter/2;
499 imagearc($im, $centerX, $centerY, $diameter, $diameter,
$start, $end+1, $color);
500 imageline($im, $centerX, $centerY, $centerX + cos(deg2rad(
$start)) * $radius, $centerY + sin(deg2rad(
$start)) * $radius, $color);
501 imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $radius, $centerY + sin(deg2rad($end)) * $radius, $color);
502 $x = $centerX + $radius * 0.5 * cos(deg2rad(
$start+($end-
$start)/2));
503 $y = $centerY + $radius * 0.5 * sin(deg2rad(
$start+($end-
$start)/2));
504 imagefill ($im, $x, $y, $color);
509 if (mb_substr($hex, 0, 1) !=
"#") $hex =
"#".$hex;
510 $dec1 = hexdec(mb_substr($hex, 1, 2));
511 $dec2 = hexdec(mb_substr($hex, 3, 2));
512 $dec3 = hexdec(mb_substr($hex, 5, 2));
517 if (mb_substr($hex, 0, 1) !=
"#") $hex =
"#".$hex;
518 $dec = hexdec(mb_substr($hex, 1, 6));
524 $hex = sprintf(
"%06X",$dec);
528function GetNextColor(&$color, &$current_color, $total, $start_color=
"0000CC", $end_color=
"FFFFCC")
530 if (mb_substr($start_color, 0, 1) ==
"#") $start_color = mb_substr($start_color, 1, 6);
531 if (mb_substr($end_color, 0, 1) ==
"#") $end_color = mb_substr($end_color, 1, 6);
532 if (mb_substr($current_color, 0, 1) ==
"#") $current_color = mb_substr($current_color, 1, 6);
533 if ($current_color ==
'') $color =
"#".$start_color;
536 $step = round((hexdec($end_color)-hexdec($start_color))/$total);
537 if (intval($step)<=0) $step =
"1500";
538 $dec =
DecColor($current_color)+intval($step);
539 if ($dec<hexdec($start_color)) $dec = $start_color;
540 elseif ($dec>hexdec($end_color)) $dec = $end_color;
541 elseif ($dec>hexdec(
"FFFFFF")) $dec =
"000000";
545 $current_color = $color;
static GetListEx($arOrder=array("ID"=> "ASC"), $arFilter=array())
static GetGroupPermission($channel_id, $arGroups=false, $params=array())
static GetList($by='s_id', $order='desc', $arFilter=[])
static UserGroupPermission($CHANNEL_ID)
static GetList($VOTE_ID, $by='s_c_sort', $order='asc', $arFilter=[])
static GetUserAnswerStat($arSort=array(), $arFilter=array(), $arParams=array())
static GetPublicList($arFilter=Array(), $strSqlOrder="ORDER BY C.C_SORT, C.ID, V.DATE_START desc", $params=array())
static GetList($by='s_id', $order='desc', $arFilter=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
if(!is_array($deviceNotifyCodes)) $access
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Rel2Abs($curdir, $relpath)
GetMessage($name, $aReplace=null)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
$GLOBALS['_____370096793']