-
Notifications
You must be signed in to change notification settings - Fork 2
/
notices.php
executable file
·184 lines (166 loc) · 5.87 KB
/
notices.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
session_start();
error_reporting(0);
include'connect.php';
if(isset($_SESSION['stuid'])==false){
$stuid='Unknown';
}else{
$stuid=$_SESSION['stuid'];
}
$ip=$_SERVER['REMOTE_ADDR'];
$today=date('Y-m-d');
$currentDate = time();
$dat=date("Y-m-d H:i:s", $currentDate);
$visits=mysqli_query($con,"SELECT * FROM page_logs where dates='$today' and stuid='$stuid' and page='Notices'");
$cm=mysqli_num_rows($visits);
if($cm<=0){
mysqli_query($con,"INSERT INTO page_logs(ip,enter_time,no_of_times,dates,page,hub,stuid) VALUES('$ip','$dat','1','$today','Notices','Cygnus','$stuid')");
mysqli_query($con,"INSERT INTO page_logs_log(ip,enter_time,no_of_times,dates,page,hub,stuid) VALUES('$ip','$dat','1','$today','Notices','Cygnus','$stuid')");
}else{
mysqli_query($con,"UPDATE page_logs SET no_of_times=no_of_times+1 where dates='$today' and page='Notices' and stuid='$stuid'");
mysqli_query($con,"INSERT INTO page_logs_log(ip,enter_time,no_of_times,dates,page,hub,stuid) VALUES('$ip','$dat','1','$today','Notices','Cygnus','$stuid')");
}
?>
<!DOCTYPE html>
<html class="index" lang="en" xml:lang="en" >
<head>
<meta charset='utf-8'>
<meta content='true' name='HandheldFriendly'>
<meta content='320' name='MobileOptimized'>
<meta content='initial-scale=1.0' name='viewport'>
<meta content='on' http-equiv='cleartype'>
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no,shrink-to-fit=no' name='viewport'>
<link href="index.php" rel="canonical">
<title>Notices | Cygnus'19</title>
<?php include_once ('css.php') ?>
<style type="text/css">
.hi{
color:#fff !important;
background-color:#000 !important;
width:60% !important;
}
.notice-modal .modal{background:rgba(2,4,8,0.95)}.notice-modal .modal-content{margin:9rem 1.5rem 3rem;text-align:center}.notice-modal h3{line-height:3rem;margin-bottom:3rem;text-transform:none;font-family:gilroyextrabold,lato,"Helvetica Neue",Helvetica,Helvetica,Arial,sans-serif;letter-spacing:0;color:#fff}
th{
font-size:20px;
font-family:Malgun Gothic;
/*font-style: italic;*/
}
@media screen and (max-width: 720px) {
.hide {
display:none;
}
.auto{
width:100% !important;
height:auto !important;
}
}
@media screen and (min-width: 1500px) {
.auto{
width:100% !important;
}
}
</style>
<script src="assets/js/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(document).on('click', '#getnotice', function(e){
e.preventDefault();
var uid = $(this).data('id');
$('#dynamic-content').html('');
$('#modal-loader').show();
$.ajax({
url: 'getnotice.php',
type: 'POST',
data: 'id='+uid,
dataType: 'html'
})
.done(function(data){
$('#dynamic-content').html('');
$('#dynamic-content').html(data);
$('#modal-loader').hide();
})
.fail(function(){
$('#dynamic-content').html('<i class="fa fa-info-sign"></i> Something went wrong, Please try again...');
$('#modal-loader').hide();
});
});
});
function updatecount(cou){
$.ajax({
url : "updatecount.php",
type: "POST",
data:"cou="+cou,
success:function(data){},
cache:false
});
}
</script>
</head>
<body class="index">
<?php include_once('header.php');?>
<?php include 'notice_modal.php' ?>
<div class="tournaments-page">
<section class="schedule-section">
<div class="heading" style="margin-left:40%;">
<center>
<div class="copy">
<h3>Notices</h3>
</div>
</center>
</div>
<table class="table table-bordered table-stripped" style="width:100% !important;">
<thead>
<tr>
<th style="width:10%;" class="hide">Sno</th>
<th style="width:70%;">Title</th>
<th style="width:15%;" class="hide">Posted</th>
<th style="width:5%;" class="hide">Visits</th>
</tr>
</thead>
<tbody>
<?php
$qu=mysqli_query($con,"SELECT * FROM notifications WHERE visibility='1' ORDER BY nid DESC limit 20");
while ($quf=mysqli_fetch_array($qu,MYSQLI_BOTH)) {
?>
<tr>
<td class="hide"> <a class="button green-border nav-anchor" style="width:25vh;height:10vh;padding:0rem 0rem;">
<span class="solo-vertical-align">
<?php echo $quf['nid'];?>
</span>
</a></td>
<td class="auto">
<a data-modal="notice-modal" href="#" class="button green-border nav-anchor auto" style="width:110vh;height:10vh;padding:auto;"
data-id="<?php echo $quf['nid']; ?>" id="getnotice" onclick='updatecount("<?php echo $quf['nid'];?>")'>
<span class="solo-vertical-align"><?php echo $quf['title'];?>
<?php
$today=date('m-d-Y');
$not=$quf['added_date'];
if($not==$today){
echo'<img src="images/new1.gif" style="width:50px;height:30px;">' ;
}
?>
</span>
</a>
</td>
<td class="hide"><a class="button green-border nav-anchor" style="width:35vh;height:10vh;padding:0rem 0rem;">
<span class="solo-vertical-align">
<?php echo $quf['time'];?>
</span>
</a></td>
<td class="hide"><a class="button green-border nav-anchor" style="width:25vh;height:10vh;padding:0rem 0rem;">
<span class="solo-vertical-align">
<?php echo $quf['views'];?>
</span>
</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</section>
</div>
<?php include 'title.php' ?>
</div>
<?php include 'login_modal.php' ?>
<?php include 'event_modal.php' ?>
<?php include 'footer.php' ?>