-
Notifications
You must be signed in to change notification settings - Fork 21
/
ajaxPosition.php
79 lines (64 loc) · 2.33 KB
/
ajaxPosition.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/*
* As a work of the United States government, this project is in the public domain within the United States.
*/
/*
Index for everything
Date: September 11, 2007
*/
error_reporting(E_ERROR);
require_once getenv('APP_LIBS_PATH') . '/loaders/Leaf_autoloader.php';
$oc_login->loginUser();
if ($oc_login)
{
}
$position = new Orgchart\Position($oc_db, $oc_login);
$action = isset($_GET['a']) ? $_GET['a'] : '';
switch ($action) {
case 'getForm':
$t_form = new Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
$t_form->assign('form', $position->getAllData((int)$_GET['pID']));
$t_form->assign('uid', (int)$_GET['pID']);
$t_form->assign('categoryID', $position->getDataTableCategoryID());
$t_form->display('print_subindicators.tpl');
break;
case 'getFormContent':
if (is_numeric($_GET['indicatorID']))
{
$t_form = new Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
if (is_numeric($_GET['indicatorID']) && is_numeric($_GET['pID']))
{
$t_form->assign('uid', (int)$_GET['pID']);
$t_form->assign('categoryID', $position->getDataTableCategoryID());
$indicator = $position->getAllData($_GET['pID'], $_GET['indicatorID']);
$t_form->assign('indicator', $indicator[$_GET['indicatorID']]);
$t_form->display('print_subindicators_ajax.tpl');
}
}
break;
case 'getindicator':
$t_form = new Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
$t_form->assign('form', $position->getAllData((int)$_GET['pID'], (int)$_GET['indicatorID']));
$t_form->assign('UID', (int)$_GET['pID']);
$t_form->assign('categoryID', $position->getDataTableCategoryID());
$t_form->assign('CSRFToken', $_SESSION['CSRFToken']);
$t_form->display('ajaxForm.tpl');
break;
default:
/*
echo "Action: $action<br /><br />Catchall...<br /><br />POST: <pre>";
print_r($_POST);
echo "</pre><br /><br />GET:<pre>";
print_r($_GET);
echo "</pre><br /><br />FILES:<pre>";
print_r($_FILES);
echo "</pre>";
*/
break;
}