-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.php
248 lines (219 loc) · 5.65 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Developer Ravi | QR Code Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="description" content="QR Code Generator Developed By Developer Ravi Khadka .It's Free Online QR Code Generator to make your own QR Codes.No sign-up required. Create unlimited non-expiring free QR codes for a website URL, YouTube video etc.">
<meta name="keywords" content="qr code,QR CODE,QR,CODE,HTML, CSS, XML, JavaScript,php,mysql,bootstrap">
<meta name="author" content="Developer Ravi Khadka ">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
/* Full-width input fields */
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Set a style for all buttons */
input[type=submit]{
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
text-align: center;
text-decoration: none;
}
input[type=submit]:hover {
opacity: 0.8;
}
/* Extra styles for the cancel button */
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
/* Center the image and position the close button */
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* The Modal (background) */
.modal {
/* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
/* Add Zoom Animation */
.animate {
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
#qrSucc
{
width: 90%;
margin: auto;
text-align: center;
}
#qrSucc a
{
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
text-align: center;
text-decoration: none;
}
</style>
</head>
<body>
<?php
include "meRaviQr/qrlib.php";
include "config.php";
if(isset($_POST['create']))
{
$qc = $_POST['qrContent'];
$qrUname = $_POST['qrUname'];
$qrImgName = "meravi".rand();
if($qc=="" && $qrUname=="")
{
echo "<script>alert('Please Enter Your Name And Msg For QR Code');</script>";
}
elseif($qc=="")
{
echo "<script>alert('Please Enter QR Code Msg');</script>";
}
elseif($qrUname=="")
{
echo "<script>alert('Please Enter Your Name');</script>";
}
else
{
$dev = " ...Develop By Ravi Khadka";
$final = $qc.$dev;
$qrs = QRcode::png($final,"userQr/$qrImgName.png","H","3","3");
$qrimage = $qrImgName.".png";
$workDir = $_SERVER['HTTP_HOST'];
$qrlink = $workDir."/qrcode".$qrImgName.".png";
$insQr = $meravi->insertQr($qrUname,$final,$qrimage,$qrlink);
if($insQr==true)
{
echo "<script>alert('Thank You $qrUname. Success Create Your QR Code'); window.location='index.php?success=$qrimage';</script>";
}
else
{
echo "<script>alert('cant create QR Code');</script>";
}
}
}
?>
<?php
if(isset($_GET['success']))
{
?>
<div id="qrSucc">
<div class="modal-content animate container">
<?php
?>
<img src="userQr/<?php echo $_GET['success']; ?>" alt="">
<?php
$workDir = $_SERVER['HTTP_HOST'];
$qrlink = $workDir."/qrcode/userQr/".$_GET['success'];
?>
<input type="text" value="<?php echo $qrlink; ?>" readonly>
<br><br>
<a href="download.php?download=<?php echo $_GET['success']; ?>">Download Now</a>
<br>
<br><br>
<a href="index.php">Go Back To Generate Again</a>
</div></div>
<?php
}
else
{
?>
<div id="id01" class="modal">
<form class="modal-content animate" method="post" enctype="multipart/form-data">
<div class="container">
<h2 align="center">You Are Welcome To Developer Ravi QR Code Generator</h2>
<label for="uname"><b>Your Name</b></label>
<input type="text" name="qrUname" value="<?php if(isset($_POST['create'])){ echo $_POST['qrUname']; } ?>">
<label for="psw"><b> Website URL or Text For QR Code</b></label>
<input type="text" name="qrContent" value="<?php if(isset($_POST['create'])){ echo $_POST['qrContent']; } ?>">
<input type="submit" value="Generate Your Own QR Code" name="create">
</div>
</form>
<?php
}
?>
</div>
</body>
</html>