-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb-notifications.php
166 lines (126 loc) · 8.13 KB
/
db-notifications.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
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
161
162
163
164
165
166
<?php
include "header.php";
if (file_exists('config/user_authentication.php')) {
include('config/user_authentication.php');
}
include "dashboard_left_pane.php";
$session_user_id = $_SESSION['user_id'];
$user_notification = "select *
from " . TBL . "listing_likes as s, " . TBL . "reviews as b, " . TBL . "enquiries as c
where b.listing_user_id = s.listing_user_id and b.listing_user_id = c.listing_user_id AND b.listing_user_id = '$session_user_id' AND c.listing_user_id = '$session_user_id' AND s.listing_user_id = '$session_user_id' ORDER BY c.enquiry_cdt,b.review_cdt DESC LIMIT 5 ";
$user_notification_query = mysqli_query($conn, $user_notification);
$user_notification_query_count = mysqli_num_rows($user_notification_query);
?>
<!--CENTER SECTION-->
<div class="ud-main">
<div class="ud-main-inn ud-no-rhs">
<div class="ud-cen">
<div class="log-bor"> </div>
<span class="udb-inst"><?php echo $Zitiziti['DB-NOTIFICATION-NOTIFICATIONS']; ?></span>
<?php include('config/user_activation_checker.php'); ?>
<div class="ud-cen-s2">
<h2><?php echo $Zitiziti['DB-NOTIFICATION-ALL-NOTIFICATIONS']; ?></h2>
<div class="db-noti">
<ul>
<?php
while ($user_notification_row = mysqli_fetch_array($user_notification_query)) {
$enquiry_sender_id = $user_notification_row['enquiry_sender_id'];
$enquiry_listing_id = $user_notification_row['listing_id'];
$enquiry_message = $user_notification_row['enquiry_message'];
$enquiry_cdt = $user_notification_row['enquiry_cdt'];
$review_user_id = $user_notification_row['review_user_id'];
$review_message = $user_notification_row['review_message'];
$review_listing_id = $user_notification_row['listing_id'];
$review_cdt = $user_notification_row['review_cdt'];
$listing_likes_id = $user_notification_row['listing_likes_id'];
$listing_likes_user_id = $user_notification_row['user_id'];
$listing_likes_listing_id = $user_notification_row['listing_id'];
$listing_likes_cdt = $user_notification_row['listing_likes_cdt'];
?>
<!-- // Enquiry Section starts-->
<?php
if ($enquiry_sender_id != NULL) {
$enquiry_user = getUser($enquiry_sender_id); // To Fetch user data
$enquiry_listing = getIdListing($enquiry_listing_id); //To Fetch listing data
?>
<li>
<div>
<a target="_blank" href="<?php echo $PROFILE_URL.urlModifier($enquiry_user['user_slug']); ?>"><?php echo $enquiry_user['first_name']; ?></a><?php echo $Zitiziti['DB-NOTIFICATION-SEND-LISTING-ENQUIRY'];?>
<a href="<?php echo $LISTING_URL.urlModifier($enquiry_listing['listing_slug']); ?>"><?php echo $enquiry_listing['listing_name']; ?></a>.
</div>
<p><?php echo $enquiry_message; ?></p>
<span><?php echo timeFormatconverter($enquiry_cdt) ?><?php echo $Zitiziti['DB-NOTIFICATION-ON']; ?> <?php echo dateFormatconverter($enquiry_cdt); ?></span>
</li>
<?php
}
?>
<!-- // Enquiry Section ends-->
<!-- // Reviews Section starts-->
<?php
if ($review_user_id != NULL) {
$review_user = getUser($review_user_id); // To Fetch user data
$review_listing = getIdListing($review_listing_id); //To Fetch listing data
?>
<li>
<div><a target="_blank"
href="<?php echo $PROFILE_URL.urlModifier($review_user['user_slug']); ?>"><?php echo $review_user['first_name']; ?></a><?php echo $Zitiziti['DB-NOTIFICATION-WRITE-REVIEW']; ?>
<a href="<?php echo $LISTING_URL.urlModifier($review_listing['listing_slug']); ?>"><?php echo $review_listing['listing_name']; ?></a>.
</div>
<p><?php echo $review_message; ?></p>
<span><?php echo timeFormatconverter($review_cdt) ?><?php echo $Zitiziti['DB-NOTIFICATION-ON']; ?> <?php echo dateFormatconverter($review_cdt); ?></span>
</li>
<?php
}
?>
<!-- // Reviews Section ends-->
<!-- // Likes Section Starts-->
<?php
if ($listing_likes_id != NULL) {
$listing_likes_user = getUser($listing_likes_user_id); // To Fetch user data
$listing_likes_listing = getIdListing($listing_likes_listing_id); //To Fetch listing data
?>
<li>
<div>
<a href="<?php echo $PROFILE_URL.urlModifier($listing_likes_user['user_slug']); ?>"><?php echo $listing_likes_user['first_name']; ?></a>
<?php echo $Zitiziti['DB-NOTIFICATION-LIKE-LISTING']; ?>
</div>
<span><?php echo timeFormatconverter($listing_likes_cdt) ?><?php echo $Zitiziti['DB-NOTIFICATION-ON']; ?> <?php echo dateFormatconverter($listing_likes_cdt); ?></span>
</li>
<?php
}
?>
<?php
}
?>
<?php
$user_followers_array = explode(",", $user_details_row['user_followers']);
foreach ($user_followers_array as $user_followers) {
$user_followers_row = getUser($user_followers); // To Fetch particular User Data
?>
<li>
<div><a href="<?php echo $PROFILE_URL.urlModifier($user_followers_row['user_slug']); ?>" target="_blank">
<?php echo $user_followers_row['first_name']; ?></a> <?php echo $Zitiziti['DB-NOTIFICATION-START-FOLLOWING']; ?>
</div>
</li>
<?php
}
?>
<li>
<div><?php echo $Zitiziti['DB-NOTIFICATION-THANK-YOU-MESSAGE']; ?> "<?php echo $footer_row['website_address']; ?>"
<?php echo $Zitiziti['DB-NOTIFICATION-PORTAL']; ?>.
</div>
<span><?php echo timeFormatconverter($user_details_row['user_cdt']) ?><?php echo $Zitiziti['DB-NOTIFICATION-ON']; ?> <?php echo dateFormatconverter($user_details_row['user_cdt']); ?></span>
</li>
<li>
<div><?php echo $Zitiziti['DB-NOTIFICATION-WELCOME-MESSAGE']; ?> "<?php echo $footer_row['website_address']; ?>"
<?php echo $Zitiziti['DB-NOTIFICATION-PORTAL']; ?>.
</div>
<span><?php echo timeFormatconverter($user_details_row['user_cdt']) ?><?php echo $Zitiziti['DB-NOTIFICATION-ON']; ?> <?php echo dateFormatconverter($user_details_row['user_cdt']); ?></span>
</li>
</ul>
</div>
</div>
</div>
<?php
include "dashboard_right_pane.php";
?>