* @copyright Copyright (c) 2020-2021 * @license https://opensource.org/licenses/MIT MIT License * @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code * @version 1.0 */ session_start(); require_once 'config/config.php'; require_once BASE_PATH.'/includes/auth_validate.php'; // Dynamic qrcode class require_once BASE_PATH . '/lib/Static_Qrcode/Static_Qrcode.php'; $static_qrcode = new Static_Qrcode(); // Serve POST method, After successful insert, redirect to static_qrcodes.php page. if ($_SERVER['REQUEST_METHOD'] === 'POST'){ switch($_GET['type']){ case 'text': $static_qrcode->textQrcode($_POST['text']); break; case 'email': $static_qrcode->emailQrcode($_POST['email'], $_POST['subject'], $_POST['message']); break; case 'phone': $static_qrcode->phoneQrcode($_POST['country_code'], $_POST['phone_number']); break; case 'sms': $static_qrcode->smsQrcode($_POST['country_code'], $_POST['phone_number'],$_POST['message']); break; case 'whatsapp': $static_qrcode->whatsappQrcode($_POST['country_code'], $_POST['phone_number'],$_POST['message']); break; case 'skype': $static_qrcode->skypeQrcode($_POST['skype_username']); break; case 'location': $static_qrcode->locationQrcode($_POST['latitude'], $_POST['longitude']); break; case 'vcard': $static_qrcode->vcardQrcode($_POST['full_name'], $_POST['nickname'], $_POST['email'], $_POST['website'], $_POST['phone'], $_POST['home_phone'], $_POST['work_phone'], $_POST['company'], $_POST['role'], $_POST['categories'], $_POST['note'], $_POST['photo'], $_POST['address'], $_POST['city'], $_POST['post_code'], $_POST['state']); break; case 'event': $static_qrcode->eventQrcode($_POST['title'], $_POST['start'], $_POST['end'], $_POST['location'], $_POST['description'], $_POST['url']); break; case 'bookmark': $static_qrcode->bookmarkQrcode($_POST['url'], $_POST['title']); break; case 'wifi': $static_qrcode->wifiQrcode($_POST['encryption'], $_POST['ssid'], $_POST['password']); break; case 'paypal': $static_qrcode->paypalQrcode($_POST['payment_type'], $_POST['email'], $_POST['item_name'], $_POST['item_id'], $_POST['amount'], $_POST['currency'], $_POST['shipping'], $_POST['tax_rate']); break; case 'bitcoin': $static_qrcode->bitcoinQrcode($_POST['address'], $_POST['amount'], $_POST['label'], $_POST['message']); break; } } ?>