-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
print.php
249 lines (204 loc) · 6.92 KB
/
print.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!-- favicon -->
<link rel="shortcut icon" type="image/jpg" href="studentphoto\Stu_Reg.png"/>
<?php
session_start();
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Student Enrollment Print</title>
<style>
.invoice-box{
max-width:800px;
margin:auto;
padding:20px;
border:1px solid #eee;
box-shadow:0 0 10px rgba(0, 0, 0, .15);
font-size:16px;
line-height:18px;
font-family:'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
color:#555;
}
.invoice-box table{
width:100%;
line-height:inherit;
text-align:left;
}
.invoice-box table td{
padding:5px;
vertical-align:top;
}
.invoice-box table tr td:nth-child(2){
text-align:right;
}
.invoice-box table tr.top table td{
padding-bottom:10px;
}
.invoice-box table tr.top table td.title{
font-size:45px;
line-height:30px;
color:#333;
}
.invoice-box table tr.information table td{
padding-bottom:20px;
}
.invoice-box table tr.heading td{
background:#eee;
border-bottom:1px solid #ddd;
font-weight:bold;
}
.invoice-box table tr.details td{
padding-bottom:20px;
}
.invoice-box table tr.item td{
border-bottom:1px solid #eee;
}
.invoice-box table tr.item.last td{
border-bottom:none;
}
.invoice-box table tr.total td:nth-child(2){
border-top:2px solid #eee;
font-weight:bold;
}
@media only screen and (max-width: 600px) {
.invoice-box table tr.top table td{
width:100%;
display:block;
text-align:center;
}
.invoice-box table tr.information table td{
width:100%;
display:block;
text-align:center;
}
}
</style>
</head>
<script>
(function(){
window.print();
setTimeout(function(){
window.close()
},500)
})();
</script>
<body>
<div class="invoice-box">
<?php
$cid=intval($_GET['id']);
$sql=mysqli_query($bd, "select course.courseName as courname,course.courseCode as ccode,course.courseUnit as cunit,session.session as session,department.department as dept,year.year as year,courseenrolls.enrollDate as edate,semester.semester as sem ,students.studentName as studentname,students.studentPhoto as photo,students.cgpa as scgpa,students.creationdate as studentregdate from courseenrolls join course on course.id=courseenrolls.course join session on session.id=courseenrolls.session join department on department.id=courseenrolls.department join year on year.id=courseenrolls.year join students on students.StudentRegno=courseenrolls.StudentRegno join semester on semester.id=courseenrolls.semester where courseenrolls.studentRegno='".$_SESSION['login']."' and courseenrolls.course='$cid'");
$cnt=1;
while($row=mysqli_fetch_array($sql))
{?>
<table cellpadding="0" cellspacing="0">
<tr class="top">
<td colspan="2">
<table>
<tr>
<td class="title">
<?php if($row['photo']==""){ ?>
<img src="studentphoto/noimage.png" width="200" height="200"><?php } else {?>
<img src="studentphoto/<?php echo htmlentities($row['photo']);?>" width="200" height="200">
<?php } ?>
</td>
<td>
<b> Reg No: </b><?php echo htmlentities($_SESSION['login']);?><br>
<b> Student Name: </b> <?php echo htmlentities($row['studentname']);?><br>
<b> Student Reg Date:</b> <?php echo htmlentities($row['studentregdate']);?><br>
<b> Student Course Enroll Date:</b> <?php echo htmlentities($row['edate']);?><br>
</td>
</tr>
</table>
</td>
</tr>
<tr class="heading">
<td>
Course Details
</td>
<td>
</td>
</tr>
<tr class="details">
<td>
Course Code
</td>
<td>
<?php echo htmlentities($row['ccode']);?>
</td>
</tr>
<tr class="details">
<td>
Course Name
</td>
<td>
<?php echo htmlentities($row['courname']);?>
</td>
</tr>
<tr class="details">
<td>
Course unit
</td>
<td>
<?php echo htmlentities($row['cunit']);?>
</td>
</tr>
<tr class="heading">
<td>
Other Details
</td>
<td>
</td>
</tr>
<tr class="item">
<td>
Session
</td>
<td>
<?php echo htmlentities($row['session']);?>
</td>
</tr>
<tr class="item">
<td>
Department
</td>
<td>
<?php echo htmlentities($row['dept']);?>
</td>
</tr>
<tr class="item">
<td>
Year
</td>
<td>
<?php echo htmlentities($row['year']);?>
</td>
</tr>
<tr class="item">
<td>
CGPA
</td>
<td>
<?php echo htmlentities($row['scgpa']);?>
</td>
</tr>
<tr class="item last">
<td>
Semester
</td>
<td>
<?php echo htmlentities($row['sem']);?>
</td>
</tr>
</table>
<?php } ?>
</div>
</body>
</html>
<?php } ?>