// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Quiz grading report version information. * * @package quiz * @subpackage papercopy * @copyright 2012 Binghamton Universtiy * @author Kyle J. Temkin <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ include 'phpqrcode/qrlib.php'; // Only run if we have the necessary params. if (empty($_GET['quba']) || empty($_GET['q']) || empty($_GET['qa'])) { die('Missing params.'); } // Generate a QR Code with the relevant information. QRCode::png($_GET['quba'] . '|' . $_GET['q'] . '|' . $_GET['qa'], false, 'Q', 5);
function generarQR($url) { $tempDir = __DIR__ . '/../img/'; $fileName = "qrcode.png"; $pngAbsoluteFilePath = $tempDir . $fileName; QRCode::png($url, $pngAbsoluteFilePath, 'L', '4', '4'); return $pngAbsoluteFilePath; }
function createQRCode($str) { require dirname(__FILE__) . '/ext/phpqrcode/qrlib.php'; $rn = strtotime(date("Y-m-d H:i:s")); QRCode::png($str, $rn . '.png', "large", 10, 3); header("Content-type: image/png"); readfile($rn . '.png'); unlink($rn . '.png'); exit(0); }
function Authenticatron_QR($URL, $Size = 4, $Margin = 0, $Level = 'M') { // Require the PHPQRCode Library global $PHPQRCode; // If the required functions are not loaded, fail. // If the file we are about to require doesn't exist or isn't readable, fail. if (!extension_loaded('gd') || !function_exists('gd_info') || !is_readable($PHPQRCode)) { return false; // Otherwise proceed with PHPQRCode } else { // We've checked the file exists, so we can require instead of include. // Something has gone horribly wrong if this doesn't work. require_once $PHPQRCode; // Use the object cache to capture the PNG without outputting it. // Kind of hacky but the best way I can find without writing a new QR Library. ob_start(); QRCode::png($URL, null, constant('QR_ECLEVEL_' . $Level), $Size, $Margin); $QR_Base64 = base64_encode(ob_get_contents()); ob_end_clean(); // Return it as a Base64 PNG return 'data:image/png;base64,' . $QR_Base64; } }
public function createPatientQrCode($pid, $fullname) { $data = '{"name":"' . $fullname . '","pid":' . $pid . ',"ehr": "GaiaEHR"}'; include ROOT . '/lib/phpqrcode/qrlib.php'; ob_start(); QRCode::png($data, false, 'Q', 2, 2); $imageString = base64_encode(ob_get_contents()); ob_end_clean(); return 'data:image/jpeg;base64,' . $imageString; }
/** * Output a QR Code image * * @since 3.1 */ public function onAjax_renderQRCode() { $input = $this->app->input; $this->setId($input->getInt('element_id')); $this->loadMeForAjax(); $this->getElement(); $url = 'index.php'; $this->lang->load('com_fabrik.plg.element.field', JPATH_ADMINISTRATOR); if (!$this->canView()) { $this->app->enqueueMessage(FText::_('PLG_ELEMENT_FIELD_NO_PERMISSION')); $this->app->redirect($url); exit; } $rowId = $input->get('rowid', '', 'string'); if (empty($rowId)) { $this->app->redirect($url); exit; } $listModel = $this->getListModel(); $row = $listModel->getRow($rowId, false); if (empty($row)) { $this->app->redirect($url); exit; } $elName = $this->getFullName(true, false); $value = $row->{$elName}; /* require JPATH_SITE . '/components/com_fabrik/libs/qrcode/qrcode.php'; // Usage: $a=new QR('234DSKJFH23YDFKJHaS');$a->image(4); $qr = new QR($value); $img = $qr->image(4); */ if (!empty($value)) { require JPATH_SITE . '/components/com_fabrik/libs/phpqrcode/phpqrcode.php'; ob_start(); QRCode::png($value); $img = ob_get_contents(); ob_end_clean(); } if (empty($img)) { $img = file_get_contents(JPATH_SITE . '/media/system/images/notice-note.png'); } // Some time in the past header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header('Accept-Ranges: bytes'); header('Content-Length: ' . strlen($img)); //header('Content-Type: ' . 'image/gif'); // Serve up the file echo $img; // And we're done. exit; }
<?php defined("_V") || die("Direct access not allowed!"); $new = $b[$_SESSION['wallet']]->getnewaddress($_SESSION['btaccount']); $file = "cache/" . $new . ".png"; if (isset($phpqrcode)) { include $phpqrcode; if (!file_exists($file)) { QRCode::png($new, $file); } } echo $new;
imagerectangle($im, 599, 0, 899, 299, $black); imagettftext($im, 10, 0, 690, 290, $black, $font, 'IMAGE ROTATION'); /**/ // -------------------------------------------------- // // MIDDLE AXE // -------------------------------------------------- // //imageline($im, $x, 0, $x, 250, $red); //imageline($im, 0, $y, 250, $y, $red); // -------------------------------------------------- // // BARCODE BOUNDARIES // -------------------------------------------------- // //for($i=1; $i<5; $i++){ // drawCross($im, $blue, $data['p'.$i]['x'], $data['p'.$i]['y']); //} // -------------------------------------------------- // // GENERATE // -------------------------------------------------- // header('Content-type: image/gif'); imagepng($im); imagedestroy($im); } else { if (isset($_REQUEST['QRCODE'])) { require_once DIR_LIB . "phpqrcode/qrlib.php"; QRCode::png($_REQUEST['QRCODE']); } else { $HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : ''; $server->service($HTTP_RAW_POST_DATA); exit; } } }
public function actionPrint($id) { if (preg_match('/^[0-9]+$/', $id)) { $voucher = Voucher::model()->findByPk($id); if ($voucher) { if (!is_dir(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id)) { mkdir(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id); } if (!is_dir(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->id)) { mkdir(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->id); } //if(!is_dir(Yii::app()->params['VOUCHERS_EXPORT_PATH'].DIRECTORY_SEPARATOR.$voucher->distributionVoucher->subdistribution->distribution->id)){ // mkdir(Yii::app()->params['VOUCHERS_EXPORT_PATH'].DIRECTORY_SEPARATOR.$voucher->distributionVoucher->subdistribution->distribution->id); //} $export_path = Yii::app()->params['VOUCHERS_EXPORT_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR; //$qr_path = Yii::app()->params['VOUCHERS_QR_PATH'].DIRECTORY_SEPARATOR.$voucher->distributionVoucher->subdistribution->distribution->id.DIRECTORY_SEPARATOR.$voucher->distributionVoucher->subdistribution->id; //Yii::app()->createUrl('//Utility/QrGenerate',array("qrdata"=>$voucher->code, 'qrfilename' => $voucher->ben->registration_code . "_".$voucher->distributionVoucher->value, 'qrfilepath'=> $qr_path)); $qr_path = Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->id . DIRECTORY_SEPARATOR; QRCode::png($voucher->code, $qr_path . $voucher->code . ".png", QR_ECLEVEL_M, 4, 1); if (!headers_sent()) { header('Content-Type: text/html; charset=utf-8'); } $html_output = "<style type=\"text/css\">\n table { page-break-inside:avoid }\n .printing tr { text-align: center;}\n tr { page-break-inside:avoid; page-break-after:auto; text-align: center;}\n thead { display:table-header-group }\n tfoot { display:table-footer-group }\n </style>"; $ar_text = $voucher->distributionVoucher->subdistribution->distribution->title_ar ? $voucher->distributionVoucher->subdistribution->distribution->title_ar : $voucher->distributionVoucher->type->arabic_text; $en_text = $voucher->distributionVoucher->subdistribution->distribution->title_en ? $voucher->distributionVoucher->subdistribution->distribution->title_en : $voucher->distributionVoucher->type->english_text; $html_output .= '<table align="center" class="printing" style=" empty-cells: show; border: 1px solid; text-align:center"> <tr> <td rowspan="2" colspan="2"><span style="font-size: 17pt; text-align: center;">' . $en_text . '<br />' . $ar_text . '</span></td> <td rowspan="2" style="border-left: 2px dashed; padding: 5px 10px 0px; vertical-align:top;" align="top"><img style="height: 70px;" src="' . Yii::app()->params['ASSET_PATH'] . 'logo.gif"></img></td> <td rowspan="2" style="width: 200px;"><span style="font-size: 17pt; text-align: center; ">' . $en_text . '<br />' . $ar_text . '</span></td> <td style="height: 70px; padding-top: 5px;">' . CHtml::image(Yii::app()->baseUrl . ".." . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->donor->logo_path, "", array("style" => "width:100px;")) . '</td> </tr> <tr> <td><span style="font-size: 6pt; text-align: center;"> ' . $voucher->distributionVoucher->subdistribution->distribution->donor->slogan_en . '<br /> ' . $voucher->distributionVoucher->subdistribution->distribution->donor->slogan_ar . ' </span></td> </tr> <tr> <td style="padding-left: 5px;font-size: 14pt; vertical-align: bottom;">ID#: ' . $voucher->ben->registration_code . '</td> <td style="text-align: center; padding: 30px 14px 0px;" rowspan="3">' . CHtml::image(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->id . DIRECTORY_SEPARATOR . $voucher->code . ".png") . '<br />' . $voucher->code . '</td> <td style="border-left: 2px dashed;" rowspan="3"> </td> <td style="font-size: 16pt; vertical-align: bottom;">ID#: ' . $voucher->ben->registration_code . '</td> <td style="text-align: center; padding-top: 30px;" rowspan="3">' . CHtml::image(Yii::app()->params['VOUCHERS_QR_PATH'] . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->distribution->id . DIRECTORY_SEPARATOR . $voucher->distributionVoucher->subdistribution->id . DIRECTORY_SEPARATOR . $voucher->code . ".png") . '<br />' . $voucher->code . '</td> </tr> <tr> <td style="font-size: 16pt; vertical-align: top;">Value: $' . $voucher->distributionVoucher->value . '</td> <td style="font-size: 16pt; vertical-align: top;">Value: $' . $voucher->distributionVoucher->value . '</td> </tr> <tr> <td style="padding-left: 10px; vertical-align: bottom; text-align: right;">Exp: ' . date("d/m/Y", strtotime($voucher->distributionVoucher->subdistribution->end_date)) . '</td> <td style="vertical-align: bottom; text-align: right;">Exp: ' . date("d/m/Y", strtotime($voucher->distributionVoucher->subdistribution->end_date)) . '</td> </tr> </table><br /><br />'; return $html_output; } else { header('Content-type: application/json', true, 200); echo CJSON::encode(['error' => 'No Voucher With the number ' . $id]); } } else { header('Content-type: application/json', true, 200); echo CJSON::encode(['error' => 'Invalid Request']); } }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require_once '../../config.php'; //require_once($CFG->dirroot .'/course/lib.php'); //require_once($CFG->libdir .'/filelib.php'); require_once '../../lib/phpqrcode/qrlib.php'; //require_once($CFG->dirroot .'/lib/datalib.php'); //global $USER; //print_object($USER); //die('abc'); //QRcode::png('Phuong123sdfkjsdkfjdskfjsjfkjdskjskjdfksjdkfjdskjfkdsjkfjskjfkdsj'); //$s = $USER->id;// $USER->firstname.'|'.$USER->lastname.'|'.$USER->id.'|'.$USER->username; //$param = $_GET['link']; //die ($param); $q = $_REQUEST["link"]; //$s = $CFG->wwwroot."/rec_code/".$USER->id."?redirect=".$q; QRCode::png($q); //QRcode::png($USER->id.'|'.$USER->username."|".$q); // how to save PNG codes to server
<?php } ?> </select> <img src="icon/arrow.png" border="0" title="Switch to selected account" style="cursor: pointer;" onclick="document.location.href='index.php?f=switchAccount&id=' + document.getElementById('active_account').options[document.getElementById('active_account').options.selectedIndex].value" alt="Switch to selected account"> <img src="icon/book--pencil.png" border="0" title="Edit accounts" style="cursor: pointer;" onclick="document.location.href='index.php?f=accounts'" alt="Edit accounts"> </div> <?php for ($x = 0; $x < count($coin_list); $x++) { if ($coin_code[$x] == $activeCoin) { $address = $b[$x]->getaccountaddress($_SESSION['btaccount']); $file = "cache/" . $address . ".png"; if (isset($phpqrcode)) { include $phpqrcode; if (!file_exists($file)) { QRCode::png($address, $file); } echo "<table><tr><td><img id='btimage' src='" . $file . "' alt='QR Code'></td><td>"; } echo "<h3>{$coin_list[$x]}</h3>" . PHP_EOL; echo "<div class='infoLine'>" . PHP_EOL; echo " <label>" . $coin_list[$x] . " Network</label>" . PHP_EOL; $cBlock = $b[$x]->getblockcount(); echo " Blocks: " . $cBlock; echo " Connection:"; $cons = $b[$x]->getconnectioncount(); if ($cons >= 9) { $cons = 9; } switch ($cons) { case 0: