-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.php
95 lines (86 loc) · 2.72 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
session_start();
// Include qrcode.php file.
include "controller/qrcode.php";
//creating conditional statments to store the data
if($_POST['url']){
$url = $_POST['url'];
$imageName = "url.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->URL($url);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}
elseif ($_POST['email'] && $_POST['email_subject'] && $_POST['email_message']) {
$email = $_POST['email'];
$emailSubject = $_POST['email_subject'];
$emailMessage = $_POST['email_message'];
$imageName = "email.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->EMAIL($email, $emailSubject, $emailMessage);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}
elseif ($_POST['phone']) {
$phone = $_POST['phone'];
$imageName = "phone.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->PHONE($phone);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}
elseif ($_POST['tel'] && $_POST['sms']) {
$phone = $_POST['tel'];
$sms_text = $_POST['sms'];
$imageName = "sms.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->SMS($phone, $sms_text);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}
elseif ($_POST['text']) {
$message = $_POST['text'];
$imageName = "text.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->TEXT($message);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}
elseif ($_POST['name'] && $_POST['address'] && $_POST['contact_phone'] && $_POST['contact_email']) {
$name = $_POST['name'];
$address = $_POST['address'];
$phone = $_POST['contact_phone'];
$email = $_POST['contact_email'];
$imageName = "contact.png";
// Create object
$qc = new QRCODE();
// Create Text Code
$qc->CONTACT($name, $address, $phone, $email);
// Save QR Code
$qc->QRCODE(400,$imageName);
//passing image name to session
$_SESSION['QR_IMAGE'] = $imageName;
}else {
echo "Invalid Data";
}
?>