diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 2dfbc65..3b6c96a 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -12,6 +12,17 @@ class votes { } return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; } + + public static function get_graph_bt_to_user_overall_by_time ($timespan = 84600,$returnasjson = true){ + $result = array(); + $res = \DBD\UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id)); + while ($row = $res->next()){ + $result[] = array( 0 => $row['day'], + 'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1), + 'class_mismatch' => $row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']+1)); + } + return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; + } public static function getAllVotesOfGroup($groupid){ return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));} diff --git a/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME.php b/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME.php new file mode 100644 index 0000000..70eea8b --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME.php @@ -0,0 +1,19 @@ + +
-
+