private function myRequests()
{
$sth = $this->db->query("SELECT requests.id AS requestId, requests.request, requests.added, requests.filled, requests.p2p, requests.ersatt, requests.comment,requests.season, requests.imdbid, requests.typ, requests.slug, (SELECT COUNT(*) AS cnt FROM reqvotes WHERE reqid = requests.id) AS votes, (SELECT SUM(krydda) FROM reqvotes WHERE reqid = requests.id) AS krydda FROM requests WHERE requests.filled = 0 AND userid = " . $this->user->getId() . " ORDER BY requestId DESC");
$myRequests = array();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$arr = array();
$arr["id"] = $row["requestId"];
$arr["added"] = $row["added"];
$arr["filled"] = $row["filled"];
$arr["request"] = $row["request"];
$arr["p2p"] = $row["p2p"];
$arr["comment"] = $row["comment"];
$arr["comments"] = $row["comments"];
$arr["ersatt"] = $row["ersatt"];
$arr["slug"] = $row["slug"];
$arr["season"] = $row["season"];
$arr["imdbid"] = $row["imdbid"];
$arr["type"] = $row["typ"];
$arr["reward"] = $row["krydda"] += $this->getVoteTimeReward(strtotime($row["added"]));
$arr["votes"] = $row["votes"];
array_push($myRequests, $arr);
}
return $myRequests;
}