-
Notifications
You must be signed in to change notification settings - Fork 31
/
card.php
executable file
·166 lines (142 loc) · 4.98 KB
/
card.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
session_start();
include("db_connect.php");
require "vendor/autoload.php";
if(!isset($_COOKIE['adminid'])&&$_COOKIE['adminemail']){ header('location:index.php');
exit;}
$serial="0001";
$Bar = new Picqer\Barcode\BarcodeGeneratorHTML();
$code = $Bar->getBarcode($serial, $Bar::TYPE_CODE_128);
?>
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Card</title>
<style>
body{
background:#008080;
}
#bg {
width: 1000px;
height: 450px;
margin:60px;
float: left;
}
#id {
width:250px;
height:450px;
position:absolute;
opacity: 0.88;
font-family: sans-serif;
transition: 0.4s;
background-color: #FFFFFF;
border-radius: 2%;
}
#id::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: url('images/malawi.png');
background-repeat:repeat-x;
background-size: 250px 450px;
opacity: 0.2;
z-index: -1;
text-align:center;
}
.container{
font-size: 12px;
font-family: sans-serif;
}
.id-1{
transition: 0.4s;
width:250px;
height:450px;
background: #FFFFFF;
text-align:center;
font-size: 16px;
font-family: sans-serif;
float: left;
margin:auto;
margin-left:270px;
border-radius:2%;
}
</style>
</head>
<?php
include_once("db_connect.php");
$sqluse ="SELECT * FROM Inorg WHERE id=1 ";
$retrieve = mysqli_query($db,$sqluse);
$numb=mysqli_num_rows($retrieve);
while($foundk = mysqli_fetch_array($retrieve))
{
$profile= $foundk['pname'];
$name = $foundk['name'];
}
?>
<body>
<script type="text/javascript">
window.print();
</script>
<div id="bg">
<div id="id">
<table>
<tr> <td>
<?php if($numb!=0 ){
if($profile!=""){echo"<img src='media/$profile' width='70px' height='70px' alt=''>";}
else{
echo"<img src='images/love.png' alt='Avatar' width='70px' height='70px'>";
}
}else{
?>
<img src="images/love.png" alt="Avatar" width="70px" height="70px"> <?php }?>
</td>
<td><h3><b>THE STATE GOVERNMENT OF TANZANIA</b></h3></td>
</tr>
</table><center>
<?php
$idx = $_GET['id'];
$sqlmember ="SELECT * FROM Users WHERE id='$idx' ";
$retrieve = mysqli_query($db,$sqlmember);
$count=0;
while($found = mysqli_fetch_array($retrieve))
{
$title=$found['Mtitle'];$firstname=$found['Firstname'];$sirname=$found['Sirname'];$rank=$found['Rank'];
$id=$found['id'];$dept=$found['Department'];$contact=$found['Email'];
$count=$count+1; $get_time=$found['Time']; $time=time(); $pass=$found['Staffid'];
$names=$firstname." ".$sirname;
$profile= $found['Picname'];
}
if($profile!=""){
echo"<img src='images/$profile' height='175px' width='200px' alt='' style='border: 2px solid black;'>";
}
else{
echo"<img src='admin/images/profile.jpg' height='175px' width='200px' alt='' style='border: 2px solid black;'>";
}
?> </center> <div class="container" align="center">
<p style="margin-top:2%">NAME:</p>
<p style="font-weight: bold;margin-top:-4%"><?php if(isset($names)){ $namez=$title.' '.$names;echo$namez;} ?></p>
<p style="margin-top:-4%">RANK:</p>
<p style="font-weight: bold;margin-top:-4%"><?php if(isset($rank)){ echo$rank;} ?></p>
<p style="margin-top:-4%">STAFF ID:</p>
<p style="font-weight: bold;margin-top:-4%"><?php if(isset($pass)){ echo$pass;} ?></p>
<p style="margin-top:-4%">MINISTRY/DEPARTMENT:</p>
<p style="font-weight: bold;margin-top:-4%"><?php if(isset($dept)){ echo$dept;} ?></p>
<p style="margin-top:-4%">HOLDER SIGNATURE</p>
</div>
</div>
<div class="id-1">
<center><img src="images/malawi.png" alt="Avatar" width="200px" height="175px" >
<div class="container" align="center">
<p style="margin:auto">The bearer whose photograph appears overleaf is a staff of</p>
<h2 style="color:#00BFFF;margin-left:2%">THE STATE GOVERNMENT OF TANZANIA </h2>
<p style="margin:auto">If lost and found please return to the nearest police station</p>
<hr align="center" style="border: 1px solid black;width:80%;margin-top:13%"></hr>
<p align="center" style="margin-top:-2%">Authorised Signature</p>
<p> <?php if(isset($code)){ echo$code;}?>
</p>
<?php if(isset($name)){ echo"Property of ".$name;}?> </center>
</div>
</div>
</div>
</body>
</html>