<?php

/**
 * Copyright 2009, 2010 AEGEE-Europe
 *
 * This file is part of AEGEE-Europe Online Membership System.
 *
 * AEGEE-Europe Online Membership System is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * AEGEE-Europe Online Membership System is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AEGEE-Europe Online Membership System.  If not, see
 * <http://www.gnu.org/licenses/>.
 */


include("./include/include.php");
require_once(FILESYSTEMROOTPATH."jc/include/classes/DefaultLayout.php");
require_once(FILESYSTEMROOTPATH."include/list/ListPager.php");

$layout = new DefaultLayout("JC_MANAGE", "./jc/");

$layout->init();
$layout->AddJavascript('js/visibility.js');
$agora_id = $_SESSION['JC_MODULE']['AgoraId'];

//list of rollcalls
$layout->echoln('Create and Manage voting for non-Proposal entities (Roll Calls, Reports, Motions...)<br /><br />');

$rService = $GLOBALS['ClassFactory']->getRollcallsService();

$data = $rService->loadByAgora($agora_id);

$pager = new ListPager("Votings");
$pager->addColumn(new TextColumn('title', 'Title'));
$pager->addColumn(new TextColumn('description','Description'));
$pager->addColumn(new TextColumn('open','Voting Start'));
$pager->addColumn(new TextColumn('close','Voting End'));
$pager->addColumn(new TextColumn('percentage','%'));
$pager->addColumn(new TextColumn('result','Result'));
$pager->addColumn(new TextColumn('published','Public'));
$pager->addColumn(new TextColumn('edit', 'Edit'));
$pager->addColumn(new TextColumn('results', 'Results'));
$layout->echoln($pager->display($data)); 
//create roll call
$layout->echoln('<br /><br /><a href="rollcall2.php">Create New</a>');

$layout->page_footer();

?>