-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.default.php
executable file
·66 lines (61 loc) · 2.24 KB
/
action.default.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
59
60
61
62
63
64
65
<?php
if (!isset($gCms)) exit;
if(empty($params['eventid']))
{
$this->smarty->assign('message', $this->Lang('event_does_not_exist'));
echo $this->ProcessTemplate('message.tpl');
return false;
}
$eventid = $params['eventid'];
$db = $gCms->GetDb();
$sql = 'SELECT * FROM '.cms_db_prefix().'module_eventregistration_events WHERE id=?';
$Res = $db->Execute($sql, Array($eventid));
if($Res !== false)
{
if($row = $Res->FetchRow())
{
$sql = 'SELECT * FROM '.cms_db_prefix().'module_eventregistration_teams WHERE event_id=?';
$Res = $db->Execute($sql, Array($eventid));
if($Res !== false)
{
if($Res->RecordCount() < $row['maxteams'] || $row['maxteams'] == 0)
{
$this->smarty->assign('teamname', $this->Lang('teamname'));
$this->smarty->assign('phone', $this->Lang('phone'));
$this->smarty->assign('mail', $this->Lang('mail'));
$this->smarty->assign('password', $this->Lang('password'));
$this->smarty->assign('message', $params['message']);
$this->smarty->assign('teamnameinput', $this->CreateInputText($id, 'teamname', '', 20, 128));
$this->smarty->assign('phoneinput', $this->CreateInputText($id, 'phone', '', 20, 128));
$this->smarty->assign('mailinput', $this->CreateInputText($id, 'mail', '', 20, 128));
$this->smarty->assign('passwordinput', $this->CreateInputPassword($id, 'password', '', 20, 32));
$this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', $this->Lang('register')));
$this->smarty->assign('eventid', $this->CreateInputHidden($id, 'eventid', $params['eventid']));
$this->smarty->assign('startform', $this->CreateFormStart($id, 'register', $returnid));
$this->smarty->assign('endform', $this->CreateFormEnd());
echo $this->ProcessTemplate('form.tpl');
}
else
{
$this->smarty->assign('message', $this->Lang('event_is_full'));
echo $this->ProcessTemplate('message.tpl');
}
}
else
{
$this->smarty->assign('message', $this->Lang('error_database'));
echo $this->ProcessTemplate('message.tpl');
}
}
else
{
$this->smarty->assign('message', $this->Lang('event_does_not_exist'));
echo $this->ProcessTemplate('message.tpl');
}
}
else
{
$this->smarty->assign('message', $this->Lang('error_database'));
echo $this->ProcessTemplate('message.tpl');
}
?>