root/dev/common/campaigns.php @ 459

Revision 459, 1.0 KB (checked in by kovell, 13 years ago)

Fixes: headers for uncached page set correctly, summary additions evaluated with isset instead of intval, ctr_id and scl_id explicitly set as int. unused pages removed.

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