/** * Output a QRCode containing the URL of the Jorani instance and the e-mail of the connected user * @author Benjamin BALET <*****@*****.**> */ public function qrCode() { require_once APPPATH . 'third_party/QRCode.php'; $this->load->model('users_model'); $user = $this->users_model->getUsers($this->user_id); $qr = new QRCode(); $qr = QRCode::getMinimumQRCode(base_url() . '#' . $user['login'] . '#' . $user['email'], QR_ERROR_CORRECT_LEVEL_L); echo $qr->printHTML(); }
<?php require_once '../lib/lib.everything.php'; require_once '../lib/lib.qrcode.php'; enforce_master_on_off_switch($_SERVER['HTTP_ACCEPT_LANGUAGE']); /**** ... ****/ $url = 'http://' . get_domain_name() . get_base_dir() . '/atlas.php?id=' . urlencode($_GET['print']); $qrc = QRCode::getMinimumQRCode($url, QR_ERROR_CORRECT_LEVEL_Q); $img = $qrc->createImage(16, 0); header('Content-type: image/png'); header("X-Content: {$url}"); imagepng($img); imagedestroy($img);
<?php require_once "qrcode.php"; $qr = QRCode::getMinimumQRCode("QRƒR�[ƒh", QR_ERROR_CORRECT_LEVEL_L); header("Content-type: text/xml"); print "<qrcode>"; for ($r = 0; $r < $qr->getModuleCount(); $r++) { print "<line>"; for ($c = 0; $c < $qr->getModuleCount(); $c++) { print $qr->isDark($r, $c) ? "1" : "0"; } print "</line>"; } print "</qrcode>";
$content = $vcard->card; if (isset($_GET['debug'])) { echo "<pre>"; print_r($vcard->data); echo "</pre>"; exit; } //include require_once $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/qr/qrcode.php"; //error correction level //QR_ERROR_CORRECT_LEVEL_L : $e = 0; //QR_ERROR_CORRECT_LEVEL_M : $e = 1; //QR_ERROR_CORRECT_LEVEL_Q : $e = 2; //QR_ERROR_CORRECT_LEVEL_H : $e = 3; //get the qr object $qr = QRCode::getMinimumQRCode($content, QR_ERROR_CORRECT_LEVEL_L); } //show the vcard as an png image if ($_GET['type'] == "image") { header("Content-type: image/png"); $im = $qr->createImage(5, 10); imagepng($im); imagedestroy($im); } //show the vcard in an html qr code if ($_GET['type'] == "html") { $qr->make(); $qr->printHTML(); } } /*