-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgroup.php
43 lines (38 loc) · 1.21 KB
/
group.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
<?php
/**
* Handles Group creation process.
*/
/**
* Get all required libraries.
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/group.lib.php';
require_once 'libraries/swiftmailer/lib/swift_required.php';
require_once 'libraries/mailConstants.inc.php';
//Process the form if submitted
if (isset($_POST['create_group'])) {
$response = HAA_Response::getInstance();
if(! HAA_saveGroupRecord($_POST)) {
$response->addJSON('message', HAA_generateErrorMessage($GLOBALS['error']));
$response->addJSON('save', false);
} else {
$response->addJSON('message', $GLOBALS['message']);
$response->addJSON('redirect_url', 'index.php');
$response->addJSON('save', true);
}
$response->response();
exit;
}
// Display Group creation form.
$response = HAA_Response::getInstance();
$header = $response->getHeader();
$header->addFile('minified/group.js', 'js');
$header->addFile('jquery/jquery-uniform.js', 'js');
$header->addFile('jquery/jquery.maskedinput.min.js', 'js');
$header->addFile('minified/group.css', 'css');
$header->setTitle('Group');
$html_output = '';
$html_output .= HAA_getHtmlGroupForm();
$response->addHTML($html_output);
$response->response();
?>