<?php
/**
 * Created by PhpStorm.
 * User: jaskokoyn
 * Date: 4/26/2015
 * Time: 2:00 PM
 */

require('../../inc/db.php');
include('../../inc/functions.php');

$params                         =   getParams();
$output                         =   array('status' => 1);

if(!isset($_SESSION['loggedin'])){
    dj($output);
}

$pollsQuery                     =   $db->prepare("SELECT * FROM polls WHERE uid = :uid");
$pollsQuery->execute(array(
    ":uid"                      =>  $_SESSION['uid']
));

$output['status']               =   2;
$output['polls']                =   $pollsQuery->fetchAll(PDO::FETCH_ASSOC);
dj($output);