-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
142 lines (123 loc) · 3.95 KB
/
Copy pathheader.php
File metadata and controls
142 lines (123 loc) · 3.95 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
<?php session_start(); ?>
<!DOCTYPE HTML>
<html>
<head>
<title>simplest</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<script src="2.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="1.js"></script>
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<div id="logo_text">
<!-- class="logo_colour", allows you to change the colour of the text -->
<h1><span class="logo_colour">COMPONENT MANAGEMENT SYSTEM</span></h1>
<!--h2>Simple. Contemporary. Website Template.-->
</div>
</div>
<div id="menubar">
<ul id="menu" class="nav navbar-nav navbar-right">
<!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
<li><a href="request2.php">Home</a></li>
<li class="selected"> <a href="header.php">View Dues</li>
<li><a href="contact.html">Contact Us</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="label label-pill label-danger count" style="border-radius:10px;"></span> <span class="glyphicon glyphicon-envelope" style="font-size:18px;"></span></a>
<ul class="dropdown-menu"></ul>
</li>
</ul>
</div>
</div>
<div id="content_header"></div>
<div id="site_content">
<div id="banner"></div>
<div id="sidebar_container">
<div class="sidebar">
<div class="sidebar_top"></div>
<div class="sidebar_item">
<!-- insert your sidebar items here -->
<center> <h3>AKANSH KUMAR</h3><hr>
<h4>B150398CS </h4> <br>
</center>
<?php
$servername = "localhost";
$username = "root";
$password = "time.org";
$dbname = "component_distribution";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql5 = "SELECT * FROM student WHERE rollno='B150895CS'";
$result = $conn->query($sql5);
$row = $result->fetch_assoc();
echo "<h5> Email-" .$row['email']. "</h5> <br>";
echo "<h5> Contact NO -" .$row['phone']. "</h5><br>";
$sql6 = "SELECT COUNT(DISTINCT RequestNo) AS COUNT FROM `request` WHERE rollno='B150895CS'";
$result = $conn->query($sql6);
$row = $result->fetch_assoc();
echo "<h5> Request Pending :-" .$row['COUNT']. "</h5><br><hr>";
$conn->close();?>
</div>
<div class="sidebar_base"></div>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
function load_unseen_notification(view = '')
{
$.ajax({
url:"fetch.php",
method:"POST",
data:{view:view},
dataType:"json",
success:function(data)
{
$('.dropdown-menu').html(data.notification);
if(data.unseen_notification > 0)
{
$('.count').html(data.unseen_notification);
}
}
});
}
load_unseen_notification();
$('#comment_form').on('submit', function(event){
event.preventDefault();
if($('#subject').val() != '' && $('#comment').val() != '')
{
var form_data = $(this).serialize();
$.ajax({
url:"insert.php",
method:"POST",
data:form_data,
success:function(data)
{
$('#comment_form')[0].reset();
load_unseen_notification();
}
});
}
else
{
alert("Both Fields are Required");
}
});
$(document).on('click', '.dropdown-toggle', function(){
$('.count').html('');
load_unseen_notification('yes');
});
setInterval(function(){
load_unseen_notification();;
}, 5000);
});
</script>