This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
67 lines (58 loc) · 1.83 KB
/
search.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
<?php
if ($already_initialized != 1)
{
require("./inc/script_inicialization.php");
require_once("./inc/nrp_api.php");
}
if (!isset($num_errors))
$num_errors = 0;
if (!isset($num_alerts))
$num_alerts = 0;
if (Validate_Session($complete_sess_id, $_SERVER['REMOTE_ADDR'], $bd))
{
Get_Account_Id($sess_id, $account_id, $bd);
$master_session = Get_Crypt_Master_Session($sess_id, $bd);
if (!$master_session)
$owner = $account_id;
else
Get_Account_Id($master_session, $owner, $bd);
$query = "SELECT * FROM accounts WHERE account_id = '$account_id'";
$result = $bd->Query($query);
$role = $bd->FetchResult($result, 0, 'role');
$var_type = $role . '_type';
$var_color = $role . '_color';
$var_image = $role . '_icon';
$array_type = $cfg[$var_type];
$array_color = $cfg[$var_color];
$array_image = $cfg[$var_image];
if (!empty($_POST['search']))
{
$apps1 = Search_Appointments($account_id, $_POST['key'], $cfg['time'], $array_type,
$array_color, $array_image, $cfg['days'], $bd);
$apps2 = Search_Weekly_Appointments($account_id, $_POST['key'], $cfg['time'], $array_type,
$array_color, $array_image, $cfg['days'], $bd);
$apps = array_merge($apps1, $apps2);
$result_xsl = "xsl/" . $cfg['default_xsl'] . "/search_res.xsl";
}
else
{
$result_xsl = "xsl/" . $cfg['default_xsl'] . "/search.xsl";
}
}
else
{
$error[$num_errors++] = "Invalid Session ID";
include "logout.php";
exit;
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpMainErrors", $error);
$smarty->assign("nrpMainAlerts", $alert);
$smarty->assign("nrpSessId", $complete_sess_id);
$smarty->assign("nrpMainApp", $apps);
$smarty->assign("nrpUserId", $account_id);
$smarty->assign("nrpMasterSession", $master_session);
$result_xml = $smarty->fetch("xml/main.xml");
require("./inc/proc_transform.php");
// Calls the commands do procede the XSLT transformation
?>