-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgenerate.php
73 lines (71 loc) · 2.26 KB
/
generate.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
<!DOCTYPE>
<html>
<head>
<title>Generate Qr</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
.border-container{
border: 1px solid #cfcfcf;
padding: 20px;
box-shadow: 10px 10px 10px #ececec;
margin-top: 40px;
}
</style>
</head>
<body>
<div class="container border-container">
<div class="page-header">
<h1>Create QR Code</h1>
</div>
<?php
$qr = $_POST['qr'];
if(!empty($qr)) {
echo'
<form class="form-horizontal" action="" method="POST">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Contents</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="qr" name="qr" value="'.$qr.'">
<span id="helpBlock" class="help-block">Enter URL, text, number, geolocation, or others</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Generate</button>
</div>
</div>
</form>
<br>
';
echo '<img class="img-responsive img-thumbnail" src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl='.$qr.'&choe=UTF-8" style="margin: 0 auto;display: block;">';
echo '<br><a href="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl='.$qr.'&choe=UTF-8"><button type="submit" class="btn btn-primary" style="margin: 0 auto;display: block;">Save</button></a>';
}else{
echo'
<form class="form-horizontal" action="" method="POST">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Contents</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="qr" name="qr" placeholder="Inside Qr">
<span id="helpBlock" class="help-block">Enter URL, text, number, geolocation, or others</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Generate</button>
</div>
</div>
</form>
<br>
';
}
?>
<br>
<hr>
<footer style="text-align:center;">
Copyright 2017 | <a href="http://abedputra.com">abedputra.com</a>
</footer>
</div>
</body>
</html>