-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
166 lines (148 loc) · 5.2 KB
/
admin.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CCET Chandigarh - Notices</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: #f7f7f7;
}
header {
background-color: #333;
color: #fff;
padding: 15px 0;
text-align: center;
}
nav {
background-color: #444;
text-align: center;
width: 20%;
height: 100vh;
padding-top: 15px;
}
nav a {
margin-bottom: 10px;
color: #fff;
text-decoration: none;
transition: color 0.3s ease;
display: block;
}
nav a:hover {
color: #ffd700;
}
.container {
display: flex;
width: auto;
margin: 0 auto;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding-bottom: 20px;
}
.content {
width: 80%;
padding: 20px;
background-color: #fff;
/* Add a background color for better visibility */
border-radius: 0 8px 8px 0;
/* Rounded border on the right side */
}
h2 {
color: #333;
padding-top: 20px;
}
h3 {
color: #333;
margin-top: 20px;
}
</style>
</head>
<body>
<header>
<h1>CCET Chandigarh - Notices</h1>
</header>
<div class="container">
<nav>
<a href="#" class="notices">NOTICES</a>
<a href="#" class="etender">E-TENDER</a>
<a href="#" class="proforma">PROFORMA</a>
<a href="logout.php">LOGOUT</a>
</nav>
<div class="content">
<h2>Welcome to the Admin Dashboard</h2>
<p>Here you can manage notices, edit them, delete them, and perform other administrative tasks.</p>
<h3>Instructions:</h3>
<ul>
<li>To edit a notice, click on the edit button next to the notice you want to modify.</li>
<li>To delete a notice, click on the delete button next to the notice you want to remove.</li>
<li>You can also add new notices by clicking on the "Add Notice" button.</li>
<li>For any assistance or queries, please contact the administrator.</li>
</ul>
</div>
</div>
</body>
<script>
// Corrected JavaScript
document.addEventListener('DOMContentLoaded', function () {
const result = document.querySelector('.content'); // Change to querySelector('.content')
const noticesLink = document.querySelector(".notices");
const etenderLink = document.querySelector(".etender");
const proformaLink = document.querySelector(".proforma");
// Function to fetch and display notices
function fetchNotices() {
fetch("noticeprint.php")
.then(response => response.text())
.then(data => {
result.innerHTML = data;
})
.catch(error => {
console.error('Error fetching notices:', error);
result.innerHTML = '<p>Error fetching notices. Please try again later.</p>';
});
}
// Function to fetch and display e-tender information
function fetchEtenders() {
fetch("printetender.php")
.then(response => response.text())
.then(data => {
result.innerHTML = data;
})
.catch(error => {
console.error('Error fetching e-tender information:', error);
result.innerHTML = '<p>Error fetching e-tender information. Please try again later.</p>';
});
}
// Function to fetch and display proforma information
function fetchProforma() {
fetch("printproforma.php")
.then(response => response.text())
.then(data => {
result.innerHTML = data;
})
.catch(error => {
console.error('Error fetching proforma information:', error);
result.innerHTML = '<p>Error fetching proforma information. Please try again later.</p>';
});
}
// Event listener for notices link
noticesLink.addEventListener('click', function (event) {
event.preventDefault(); // Prevent the default link behavior
fetchNotices();
});
// Event listener for e-tender link
etenderLink.addEventListener('click', function (event) {
event.preventDefault(); // Prevent the default link behavior
fetchEtenders();
});
// Event listener for proforma link
proformaLink.addEventListener('click', function (event) {
event.preventDefault(); // Prevent the default link behavior
fetchProforma();
});
});
</script>
</html>