root/dev/common/campaigns.php @ 195

Revision 190, 1.1 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2require_once('common/includes/class.page.php');
3require_once('common/includes/class.contract.php');
4
5$page = new Page('Campaigns');
6
7switch ($_GET['view'])
8{
9    case '':
10        $activelist = new ContractList();
11        $activelist->setCampaigns(true);
12        $activelist->setActive('yes');
13        $page->setTitle('Active campaigns');
14        $table = new ContractListTable($activelist);
15        $table->paginate(10, $_GET['page']);
16        $html .= $table->generate();
17        break;
18    case 'past':
19        $pastlist = new ContractList();
20        $pastlist->setCampaigns(true);
21        $pastlist->setActive('no');
22        $page->setTitle('Past campaigns');
23        $table = new ContractListTable($pastlist);
24        $table->paginate(10, $_GET['page']);
25        $html .= $table->generate();
26        break;
27}
28
29$menubox = new Box('Menu');
30$menubox->setIcon('menu-item.gif');
31$menubox->addOption('link', 'Active campaigns', '?a=campaigns');
32$menubox->addOption('link', 'Past campaigns', '?a=campaigns&view=past');
33
34$page->addContext($menubox->generate());
35$page->setContent($html);
36$page->generate();
37?>
Note: See TracBrowser for help on using the browser.