-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.defaultadmin.php
executable file
·59 lines (48 loc) · 2.04 KB
/
action.defaultadmin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
if (!isset($gCms)) exit;
if (!$this->CheckPermission('Use EventRegistration'))
{
echo $this->ProcessTemplate('accessdenied.tpl');
return false;
}
if (!empty($params['active_tab'])) {
$tab = $params['active_tab'];
} else {
$tab = '';
}
$text = '';
$text .= $this->StartTabHeaders();
$text .= $this->SetTabHeader('overview',$this->Lang('tab_title_overview'), ('overview' == $tab)?true:false);
$text .= $this->SetTabHeader('settings', $this->Lang('tab_title_settings'), ('settings' == $tab)?true:false);
$text .= $this->EndTabHeaders();
$text .= $this->StartTabContent();
$text .= $this->StartTab('overview', $params);
$text .= $this->CreateFormStart($id, 'createevent');
$text .= $this->Lang('eventname').':'.$this->CreateInputText($id, 'eventname', '', 20, 128);
$text .= $this->Lang('max_teams_create').':'.$this->CreateInputText($id, 'maxteams', '0', 20, 20);
$text .= $this->CreateInputSubmit($id, 'submit', $this->Lang('createevent'));
$text .= $this->CreateFormEnd();
$text .= '<h3>'.$this->Lang('events').'</h3>';
$text .= '<ul>';
$db = $gCms->GetDb();
$Res = $db->Execute('SELECT * FROM '.cms_db_prefix().'module_eventregistration_events ORDER BY id');
if($Res !== false)
{
while($row = $Res->FetchRow())
{
$text .= '<li>'.$this->CreateLink($id, 'viewevent', '', $row['eventname'].' ('.$row['id'].')', Array('eventid'=>$row['id'])).'</li>';
}
}
$text .= '</ul>';
$text .= $this->EndTab();
$text .= $this->StartTab('settings', $params);
$text .= $this->CreateFormStart($id, 'setadminprefs', $returnid);
$text .= $this->Lang('fromuser').':'.$this->CreateInputText( $id, 'input_fromuser', $this->GetPreference('fromuser'), 50, 128);
$text .= $this->Lang('from').':'.$this->CreateInputText( $id, 'input_from', $this->GetPreference('from'), 50, 128);
$text .= $this->CreateInputSubmit($id, 'submit', $this->Lang('save'));
$text .= $this->CreateFormEnd();
$text .= $this->EndTab();
$text .= $this->EndTabContent();
$this->smarty->assign('text', $text);
echo $this->ProcessTemplate('adminpanel.tpl');
?>