-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotification.php
More file actions
160 lines (146 loc) · 4.76 KB
/
Copy pathnotification.php
File metadata and controls
160 lines (146 loc) · 4.76 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
session_start();
$member_ID = $_SESSION['login_user_id'];
/*$messageDisplayRes = mysql_query($messageDisplayQry);
$messageDisplayNum = mysql_num_rows($messageDisplayRes);*/
$qry = "SELECT `login_user_name` FROM `alacut_member` WHERE member_id='$member_ID' AND active = '1'";
$ses_sql = mysql_query($qry);
$row = mysql_fetch_array($ses_sql);
$login_session = $row['login_user_name'];
?>
<script>
$(document).ready(function () {
$(".slide1").click(function () {
$("#div_slide_content1").slideToggle("fast");
$("#div_slide_content2").hide();
$("#div_slide_content3").hide();
$("#div_slide_content4").hide();
});
$(".slide2").click(function () {
$("#div_slide_content2").slideToggle("fast");
$("#div_slide_content1").hide();
$("#div_slide_content3").hide();
$("#div_slide_content4").hide();
});
$(".slide3").click(function () {
$("#div_slide_content3").slideToggle("fast");
$("#div_slide_content1").hide();
$("#div_slide_content2").hide();
$("#div_slide_content4").hide();
});
$(".slide4").click(function () {
$("#div_slide_content4").slideToggle("fast");
$("#div_slide_content1").hide();
$("#div_slide_content2").hide();
$("#div_slide_content3").hide();
});
getNotification();
});
function getNotification()
{
getFriendRequests();
getMessages();
getPosts();
}
function getFriendRequests()
{
$.ajax({
type: "POST",
url: 'ajax/getFriendRequests.php',
success: function(data) {
$('#dv_frnd').html(data);
},
error: function(e) {
$('#dv_frnd').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
function getMessages()
{
$.ajax({
type: "POST",
url: 'ajax/getMessages.php',
success: function(data) {
$('#dv_emails').html(data);
},
error: function(e) {
$('#dv_emails').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
function getPosts()
{
$.ajax({
type: "POST",
url: 'ajax/getPosts.php',
success: function(data) {
$('#dv_posts').html(data);
},
error: function(e) {
$('#dv_posts').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
function confirmFriend(fromID,toID,src)
{
if($(src).attr("rtype"))
{
var ur='fromID='+fromID+'&toID='+toID+'&rtype='+$(src).attr("rtype");
$.ajax({
type: "POST",
url: 'ajax/confirmfriendInAjax.php',
data: ur,
success: function(data) {
$(src).parent().parent().html('<strong>Accpeted</strong>');
$(src).parent().siblings().remove();
},
error: function(e) {
alert("There is somme error in the network. Please try later.");
}
});
}
}
function ignoreFriend(fromID,toID,src)
{
if($(src).attr("rtype"))
{
var ur='fromID='+fromID+'&toID='+toID+'&rtype='+$(src).attr("rtype");
$.ajax({
type: "POST",
url: 'ajax/confirmfriendInAjax.php',
data: ur,
success: function(data) {
$(src).parent().parent().html('<strong>Rejected</strong>');
$(src).parent().siblings().remove();
},
error: function(e) {
alert("There is somme error in the network. Please try later.");
}
});
}
}
</script>
<div class="notification">
<div class="slide3" ><a href="javascript:void(0);"><img src="images/note_1.jpg" alt="" width="30" height="30" /></a></div>
<div id="div_slide_content3">
<div class="arrow"> </div>
<div class="note" id="dv_posts">
<h1>Posts</h1>
<div style="margin-top: 80px;"><img src='ajax-loader.gif' alt='Loading...' style="width:200px;"/></div>
</div>
<div class="note" id="dv_frnd">
<h1>New Friends</h1>
<div style="margin-top: 80px;"><img src='ajax-loader.gif' alt='Loading...' style="width:200px;"/></div>
</div>
<div class="note_last" id="dv_emails">
<h1>New Emails</h1>
<div style="margin-top: 80px;"><img src='ajax-loader.gif' alt='Loading...' style="width:200px;"/></div>
</div>
</div>
<div class="user slide4"><a href="javascript:void(0);"><?php echo $login_session;?></a></div>
<div id="div_slide_content4">
<div class="user_option"><a href="myProfile.php">My Profile</a></div>
<div class="user_option"><a href="logout.php">Logout</a></div>
<div class="user_option"><a id="grabButton" title="alacut" href="javascript:void((function(){var e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://www.alacut.com/js/alacutpinscript.js?r='+Math.random()*99999999);document.body.appendChild(e)})());" onclick="alert('Drag me to the bookarks bar'); return false;">alacut</a></div>
</div>
</div>