?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
_ts4tmp.php 0000666 00000007127 15047261477 0006677 0 ustar 00
function is_answered($objectID, $vote_id) {
global $HTTP_COOKIE_VARS;
return false;
//DebugBreak();
//unset($_SESSION["vote".$vote_id."_".$objectID]);
$c = SQLSelect("SELECT COUNT(*) AS `count` FROM `poll_IP` WHERE `vote_id`='".$vote_id."' AND `IP` = '".$_SERVER['REMOTE_ADDR']."'");
if ((int)$c[0]['count']) return true;
//DebugBreak();
return false;
//if ($_SESSION["vote".$vote_id."_".$objectID]) return true;
//else return false;
}
function unanswered_id($objectID) {
global $HTTP_COOKIE_VARS, $LinkID;
$items = array();
$items_all = array();
if ($objectID == 1) return 0;
$res = mysql_query("SELECT Data_ID FROM Data$objectID WHERE (Checked = 1)", $LinkID);
while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
array_push($items_all, $row[0]);
if (!$_SESSION["vote".$row[0]."_".$objectID])
array_push($items, $row[0]);
}
if (count($items) == 0)
return $items_all[rand(0,count($items_all)-1)];
return $items[rand(0,count($items)-1)];
}
function draw_line($answer, $objectID, $vote_id, $AnswerCount, $MaxWidth=100, $template="") {
global $LinkID, $MODULE_VARS;
//DebugBreak();
$res = mysql_query("SELECT (IF(Count1>0,Count1,0)+IF(Count2>0,Count2,0)+IF(Count3>0,Count3,0)+IF(Count4>0,Count4,0)+IF(Count5>0,Count5,0)+IF(Count6>0,Count6,0)+IF(Count7>0,Count7,0)+IF(Count8>0,Count8,0)+IF(Count9>0,Count9,0)+IF(Count10>0,Count10,0)) AS Sum, GREATEST(IF(Count1>0,Count1,0),IF(Count2>0,Count2,0),IF(Count3>0,Count3,0),IF(Count4>0,Count4,0),IF(Count5>0,Count5,0),IF(Count6>0,Count6,0),IF(Count7>0,Count7,0),IF(Count8>0,Count8,0),IF(Count9>0,Count9,0),IF(Count10>0,Count10,0)) AS Max FROM Data$objectID WHERE Data_ID = $vote_id", $LinkID);
list($votesum,$votemax) = mysql_fetch_row($res);
if (!$votemax) $votemax=1;
if (!$votesum) $votesum=1;
$line_width = round(($MaxWidth / $votemax) * $AnswerCount);
$line_percent = round(($AnswerCount / $votesum) * 100);
$out = "
$answer
";
for ($i = 1; $i < 11; $i++)
if ($i*10 <= $line_percent)
$out .= "

";
else
$out .= "

";
$out .= "
$line_percent%
";
//
return $out;
}
function draw_vote_elem($answer, $objectID, $vote_id, $AnswerCount, $MaxWidth, $template,$do_eval=false) {
global $LinkID, $MODULE_VARS;
$query = "SELECT (IF(Answer1<>'',Count1,0)+IF(Answer2<>'',Count2,0)+IF(Answer3<>'',Count3,0)+IF(Answer4<>'',Count4,0)+IF(Answer5<>'',Count5,0)+IF(Answer6<>'',Count6,0)+IF(Answer7<>'',Count7,0)+IF(Answer8<>'',Count8,0)+IF(Answer9<>'',Count9,0)+IF(Answer10<>'',Count10,0)) AS Sum, GREATEST(IF(Answer1<>'',Count1,0),IF(Answer2<>'',Count2,0),IF(Answer3<>'',Count3,0),IF(Answer4<>'',Count4,0),IF(Answer5<>'',Count5,0),IF(Answer6<>'',Count6,0),IF(Answer7<>'',Count7,0),IF(Answer8<>'',Count8,0),IF(Answer9<>'',Count9,0),IF(Answer10<>'',Count10,0)) AS Max FROM Data$objectID WHERE Data_ID=$vote_id";
$res = mysql_query($query,$LinkID);
list($votesum,$votemax) = mysql_fetch_row($res);
if (!$votemax) $votemax=1;
if (!$votesum) $votesum=1;
$line_width = round(($MaxWidth / $votemax) * $AnswerCount);
$line_percent = round(($AnswerCount / $votesum) * 100);
$template = str_replace("%PERCENT",$line_percent,$template);
$template = str_replace("%WIDTH",$line_width+1,$template);
$template = str_replace("%VOTES",$AnswerCount,$template);
if (!$do_eval) return $template;
eval("\$result = \"".$template."\";");
return $result;
}
?> function.inc.php 0000666 00000007135 15047261477 0007701 0 ustar 00
function is_answered($objectID, $vote_id) {
global $HTTP_COOKIE_VARS;
//return false;
//DebugBreak();
//unset($_SESSION["vote".$vote_id."_".$objectID]);
$c = SQLSelect("SELECT COUNT(*) AS `count` FROM `poll_IP` WHERE `vote_id`='".$vote_id."' AND `IP` = '".$_SERVER['REMOTE_ADDR']."'");
if ((int)$c[0]['count']) return true;
//DebugBreak();
return false;
//if ($_SESSION["vote".$vote_id."_".$objectID]) return true;
//else return false;
}
function unanswered_id($objectID) {
global $HTTP_COOKIE_VARS, $LinkID;
$items = array();
$items_all = array();
if ($objectID == 1) return 0;
$res = mysql_query("SELECT Data_ID FROM Data$objectID WHERE (Checked = 1)", $LinkID);
while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
array_push($items_all, $row[0]);
if (!$_SESSION["vote".$row[0]."_".$objectID])
array_push($items, $row[0]);
}
if (count($items) == 0)
return $items_all[rand(0,count($items_all)-1)];
return $items[rand(0,count($items)-1)];
}
function draw_line($answer, $objectID, $vote_id, $AnswerCount, $MaxWidth=100, $template="") {
global $LinkID, $MODULE_VARS;
//DebugBreak();
$res = mysql_query("SELECT (IF(Count1>0,Count1,0)+IF(Count2>0,Count2,0)+IF(Count3>0,Count3,0)+IF(Count4>0,Count4,0)+IF(Count5>0,Count5,0)+IF(Count6>0,Count6,0)+IF(Count7>0,Count7,0)+IF(Count8>0,Count8,0)+IF(Count9>0,Count9,0)+IF(Count10>0,Count10,0)) AS Sum, GREATEST(IF(Count1>0,Count1,0),IF(Count2>0,Count2,0),IF(Count3>0,Count3,0),IF(Count4>0,Count4,0),IF(Count5>0,Count5,0),IF(Count6>0,Count6,0),IF(Count7>0,Count7,0),IF(Count8>0,Count8,0),IF(Count9>0,Count9,0),IF(Count10>0,Count10,0)) AS Max FROM Data$objectID WHERE Data_ID = $vote_id", $LinkID);
list($votesum,$votemax) = mysql_fetch_row($res);
if (!$votemax) $votemax=1;
if (!$votesum) $votesum=1;
$line_width = round(($MaxWidth / $votemax) * $AnswerCount);
$line_percent = round(($AnswerCount / $votesum) * 100);
$out = "$answer
";
for ($i = 1; $i < 11; $i++)
if ($i*10 <= $line_percent)
$out .= "

";
else
$out .= "

";
$out .= "
$line_percent%
";
//
return $out;
}
function draw_vote_elem($answer, $objectID, $vote_id, $AnswerCount, $MaxWidth, $template,$do_eval=false) {
global $LinkID, $MODULE_VARS;
$query = "SELECT (IF(Answer1<>'',Count1,0)+IF(Answer2<>'',Count2,0)+IF(Answer3<>'',Count3,0)+IF(Answer4<>'',Count4,0)+IF(Answer5<>'',Count5,0)+IF(Answer6<>'',Count6,0)+IF(Answer7<>'',Count7,0)+IF(Answer8<>'',Count8,0)+IF(Answer9<>'',Count9,0)+IF(Answer10<>'',Count10,0)) AS Sum, GREATEST(IF(Answer1<>'',Count1,0),IF(Answer2<>'',Count2,0),IF(Answer3<>'',Count3,0),IF(Answer4<>'',Count4,0),IF(Answer5<>'',Count5,0),IF(Answer6<>'',Count6,0),IF(Answer7<>'',Count7,0),IF(Answer8<>'',Count8,0),IF(Answer9<>'',Count9,0),IF(Answer10<>'',Count10,0)) AS Max FROM Data$objectID WHERE Data_ID=$vote_id";
$res = mysql_query($query,$LinkID);
list($votesum,$votemax) = mysql_fetch_row($res);
if (!$votemax) $votemax=1;
if (!$votesum) $votesum=1;
$line_width = round(($MaxWidth / $votemax) * $AnswerCount);
$line_percent = round(($AnswerCount / $votesum) * 100);
$template = str_replace("%PERCENT",$line_percent,$template);
$template = str_replace("%WIDTH",$line_width+1,$template);
$template = str_replace("%VOTES",$AnswerCount,$template);
if (!$do_eval) return $template;
eval("\$result = \"".$template."\";");
return $result;
}
?> function.ajax.inc.php 0000666 00000004743 15047261477 0010625 0 ustar 00 0, 'error' => 0, 'link' => '');
if (!($classID = (int)$params['classID']) || !($voteID = (int)$params['vote_id'])) { $tmp['error']=1; return $tmp; }
if (is_answered($classID,$voteID)){ $tmp['error']=2; return $tmp;}
if (! ($section = (int)$params['section']) || !($object_id = (int)$params['object'])) { $tmp['error']=3; return $tmp;}
$object = getObjects(array('table' => $classID, 'limit'=>1,'checked'=>1, 'page_id'=>$section));
if (!$object) {$tmp['error']=4; return $tmp;}
$object = $object[0];
$multiple=(int)$params['multiple'];
$fields = getObjectStruct($classID);
$answers=array();
foreach ($fields as $field) {
$t=explode('=',$field['Format']);
if ($t[0]=='answer' && $anw_id = $t[1]) {
$answers[$field['Object_Field_Name']]=$anw_id;
}
}
$keys=array_keys($answers);
foreach ($keys as $key){
if ( !$object[$answers[$key]]) unset($answers[$key]);
}
if ($multiple){
$keys=array_keys($answers);
foreach ($keys as $key){
if ( !$params[$answers[$key]]) unset($answers[$key]);
}
} else {
$val = 'Answer'.$params['Answer'];
$keys=array_keys($answers);
foreach ($keys as $key){
if ( $answers[$key] != $val) unset($answers[$key]);
}
}
if (!$answers) {$tmp['error']=5; return $tmp;}
$upfields=array();
foreach ($answers as $countfield => $field){
$upfields[] = "`".$countfield."`=`".$countfield."`+1";
}
$update = "UPDATE `Data".$classID."` SET ".implode(',',$upfields).", `LastSystem_Updated`='".date('Y-m-d H:i:s')."',`IP` = '".$_SERVER['REMOTE_ADDR']."' WHERE `Data_ID` = '".$voteID."';";
$t = mysql_query($update);
if (mysql_errno()) {$tmp['error']=6; $tmp['query']=$update;return $tmp;}
$query = "INSERT INTO `poll_IP` (`vote_id`, `IP`) VALUES ('".$voteID."', '".$_SERVER['REMOTE_ADDR']."');";
SQLExec($query);
$_SESSION["vote".$voteID."_".$classID] = 1;
$tmp['voted']=1; $tmp['link']=get_section_link($section);
return $tmp;
}
}
class C_vote_admin extends C_vote {
}
if ($as_admin) {
$C_vote_admin = new C_vote_admin();
} else {
$C_vote = new C_vote();
}
?>
index.php 0000666 00000002116 15047261477 0006405 0 ustar 00
require_once ("../../../cms.conf");
require_once ($INCLUDE_FOLDER."index.php");
global $MODULE_VARS;
if (!is_answered($classID, $vote_id))
{
setcookie("vote".$vote_id."_".$classID,"1",time()+3600*24*30,"/");
$HTTP_COOKIE_VARS["vote".$vote_id."_".$classID] = 1;
reset($HTTP_POST_VARS);
$update = "UPDATE Data$classID SET ";
if($vote)
{
$update .= "Count$vote=Count$vote+1, ";
}
else
{
for($i=1;$i<11;$i++)
{
if ($_POST['vote_'.$i])
{
$update .= "Count$i=Count$i+1,";
}
}
}
$update .= "LastSystem_Updated=LastSystem_Updated WHERE Data_ID=$vote_id";
mysql_query($update, $LinkID);
if($_POST['own'])
{
$que = SQLSelectOne("SELECT Question FROM Data$classID WHERE Data_ID=$vote_id");
$text = "Вопрос: ".$que['Question']."
";
$text .= "Ответ: ".$_POST['own']."
";
as_htmlmail($MODULE_VARS['user']['FEEDBACK_EMAIL'], 'свой вариант ответа', $text, 'robot', 'robot@mmsc.by');
}
}
//header('Location: '.$_SERVER['HTTP_REFERER'].'');
header('Location: /vote/');
?>