-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.php
88 lines (60 loc) · 2.59 KB
/
notification.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
80
81
82
83
84
85
86
87
88
<?php
require_once 'conf/smarty-conf.php';
include 'functions/user_functions.php';
include 'functions/author_functions.php';
include 'functions/notifications_functions.php';
include 'functions/navigation_functions.php';
$module_no = 22;
if ($_SESSION['login'] == 1) {
if (check_access($module_no, $_SESSION['user_id']) == 1) {
if ($_REQUEST['job']=='notifications'){
$smarty->assign('page',"Notifications");
$smarty->display('notifications/notifications.tpl');
}
elseif ($_REQUEST ['job'] == "view_info") {
$product_id=$_SESSION['product_id']=$_REQUEST['product_id'];
$branch=$_SESSION['branch']=$_REQUEST['branch'];
$id=$_SESSION['id']=$_REQUEST['id'];
$smarty->assign ( 'product_id', $product_id );
$smarty->assign ( 'page', "Notification Info" );
$smarty->display ( 'notifications/notification_view.tpl' );
}
elseif ($_REQUEST ['job'] == "update_unseen") {
$product_id=$_SESSION['product_id']=$_REQUEST['product_id'];
$branch=$_SESSION['branch']=$_REQUEST['branch'];
$id=$_SESSION['id']=$_REQUEST['id'];
update_unseen_as_seen($product_id, $branch, $id);
$smarty->assign ( 'page', "Notification Info" );
$smarty->display ( 'notifications/notifications.tpl' );
}
elseif ($_REQUEST ['job'] == "view_not") {
$product_id=$_SESSION['product_id']=$_REQUEST['product_id'];
$branch=$_SESSION['branch']=$_REQUEST['branch'];
$id=$_SESSION['id']=$_REQUEST['id'];
update_unseen_as_seen($product_id, $branch, $id);
$smarty->assign ( 'product_id', $product_id );
$smarty->assign ( 'page', "Notification Info" );
$smarty->display ( 'notifications/notification_view.tpl' );
}
elseif ($_REQUEST ['job'] == "view_seen") {
$smarty->assign('page',"Notifications");
$smarty->display('notifications/notification_view_seen.tpl');
}
elseif ($_REQUEST ['job'] == "view_unseen") {
$smarty->assign('page',"Notifications");
$smarty->display('notifications/notification_view_unseen.tpl');
}
}
else {
$user_name = $_SESSION['user_name'];
$smarty->assign('user_name', "$_SESSION[user_name]");
$smarty->assign('error_report', "on");
$smarty->assign('error_message', "Dear $user_name, you don't have permission to access AUTHOR.");
$smarty->assign('page', "Access Error");
$smarty->display('user_home/access_error.tpl');
}
}
else {
$smarty->assign('error', "<p>Incorrect Login Details!</p>");
$smarty->display('login.tpl');
}