function show_qr($size = 128) { global $post; $permalink = get_permalink($post->ID); $qr = new qrcode(); $qr->link($permalink); echo '<a href="', $permalink, '" class="qr-anchor"><img src="', $qr->get_link(intval($size)), '" class="qr-img" title="', $post->post_title, '"/></a>'; }
break; case "contactinfo": $qr->contact_info($_POST["contact_name"], $_POST["contact_address"], $_POST["contact_phone"], $_POST["contact_email"]); break; case "email": $qr->email($_POST["email_address"], $_POST["email_subject"], $_POST["email_txt"]); break; case "geo": $qr->geo($_POST["geo_lat"], $_POST["geo_lon"], $_POST["geo_above"]); break; case "wifi": $qr->wifi($_POST["wifi_aut"], $_POST["wifi_ssid"], $_POST["wifi_pass"]); break; } //here we specify inputted size and get link to image echo "<p><img src='" . $qr->get_link($_POST['size']) . "' border='0'/></p>"; //to download image //$link = $qr->get_link(); //$qr->download_image($link); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>QR-codes</title> <script type="text/javascript"> //this is a javascript function that changes div elements, based on which type is selected //to make this function work you need to make sure that //value of select option element matches ID of div element //for example <option value="link">Link</option> value link matches <div id='link'> //and all that divs must be in a <div id='forms'> div element
<?php /** * Created by PhpStorm. * User: lasithniro * Date: 1/10/16 * Time: 12:59 AM */ include "qrcode.php"; $qr = new qrcode(); $transID = "easyID_002"; $studentName = "Lasith"; $paymentType = "Repeat exam fee"; $paymentStatus = "Completed"; $amount = '100.00'; $index = '13000829'; $str = "Transaction ID = {$transID} \n Student Index Number = {$index} \n Payment type = {$paymentType} \n Amount = {$amount} \n Payment Status = {$paymentStatus} \n "; $qr->text($str); echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
</div> <center><h2>WiFi clear-guest password QRCode</h2></center> <center> <?php include "qrcode.php"; $qr = new qrcode(); //bookmark $title = "antdz"; $url = "https://webauth-redirect.oracle.com/login.html?"; $password = trim(shell_exec('cat pass')); $param = "username=guest&password="******"&buttonClicked=4"; $url = $url . $param; $qr->bookmark($title, $url); //.......URL echo "<img src='" . $qr->get_link() . "'>"; //here is the way to output image //header("Content-type:image/png"); //echo $qr->get_image(); //and here is the way to force image download //$file = $qr->get_image(); //$qr->download_image($file) ?> </center> <br/> <center><?php echo shell_exec('cat pass'); ?> </center> </body>
public function generarHtmlCertificado($imprimir, $codigoGenerado, $tituloCurso, $duracionEdicion, $fechaEdicion, $nombreFacilitador) { //Instanciando Librería para hacer el codigo QR. $GBD = new baseDatosGestor(); $miFondo = 'background: url("recursos/certificados/' . $this->_fondo . '") no-repeat'; $valorLogoExtra = $this->dameLogoExtra(); $qr = '<div id="qr"></div>'; if ($valorLogoExtra != 'ninguno') { $miLogoExtra = '<div class="logo"><img src="recursos/certificados/' . $this->_logoExtra . '"></img></div>'; } else { $miLogoExtra = ''; } $firmasExtras = $this->dameFirmasExtras(); if (empty($firmasExtras)) { $numeroDeFrimas = 1; } else { $numeroDeFrimas = count(explode('(#=P=#)', $firmasExtras)) + 1; } $tamanoTdFirma = 1000 / $numeroDeFrimas; $tamanoTdFirma = floor($tamanoTdFirma); $colFirmantes = explode('(#=P=#)', $firmasExtras); $tdFirmantes = ''; $tdFirmantesCargos = ''; $firmaFacilitador = $this->dameFirmaFacilitador(); list($calificativoFacilitador, $cargoFacilitador) = explode('(#=D=#)', $firmaFacilitador); $tdFirmantes .= '<td class="firmante">' . $calificativoFacilitador . ' ' . $nombreFacilitador . '</td>'; $tdFirmantesCargos .= '<td class="firmante">' . $cargoFacilitador . '</td>'; foreach ($colFirmantes as $firma) { list($calificativo, $nombre, $cargo) = explode('(#=D=#)', $firma); $tdFirmantes .= '<td class="firmante">' . $calificativo . ' ' . $nombre . '</td>'; $tdFirmantesCargos .= '<td class="firmante">' . $cargo . '</td>'; } foreach ($imprimir as $persona) { $nombre = $persona['nombre']; $documento = $persona['documento']; $tipo = $persona['tipo']; $idPersona = $persona['id']; if ($tipo == 'facilitador') { $datoTipo = 'COMO FACILITADOR'; } else { if ($tipo == 'participacion') { $datoTipo = 'POR SU PARTICIPACIÓN'; } elseif ($tipo > 59) { $datoTipo = 'POR APROBACIÓN'; } elseif ($tipo < 60 and $tipo > 0) { $datoTipo = 'POR PARTICIPACIÓN'; } elseif ($tipo == 0) { //NADA } else { exit("ERROR: NINGUN TIPO DE CERTIFICADO COINCIDE"); } } if ($tipo != 0 or $tipo == 'facilitador' or $tipo == 'participacion') { //link $explode = $GBD->dameURL(); $enlace = explode("?", $explode); $linkk = $enlace[0] . "verificacionCod.php?id=" . $codigoGenerado . "-" . $idPersona; qrcode::link($linkk); $link = qrcode::get_link(); $cuerpoRepetitivo .= '<div class="cuerpoCompleto"> <table class="cabesera"> <tr> <td class="lado" align="center"> <div class="logo"> <img src="recursos/logoUPTA.jpeg"></img> </div> </td> <td class="centro"> <p style="font-size: 20px; margin: 0px;" > REPÚBLICA BOLIVARIANA DE VENEZUELA<br/> MINISTERIO DEL PODER POPULAR PARA LA EDUCACIÓN UNIVERSITARIA<br/> UNIVERSIDAD POLITÉCNICA TERRITORIAL DEL ESTADO ARAGUA "FEDERICO BRITO FIGUEROA" <br/> </td> <td class="lado" align="center"> ' . $miLogoExtra . '</td> </tr> <tr> <td class="lado"> </td> <td class="centro" style="font-size: 22px;"> <br/><br/> <div class="tituloCurso"> OTORGA EL PRESENTE CERTIFICADO<br/> ' . $datoTipo . ' A: <br/><br/> <p style="font-size: 36px; margin: 0px;" >' . $nombre . ' </p> <p style="font-size: 32px; margin: 0px;" >' . $documento . '</p><br/> <p style="font-size: 32px; margin: 0px;">' . $tituloCurso . '</p> </div><br/> <p style="font-size: 20px; margin: 0px;">Venezuela - Estado Aragua<br/> DURACIÓN: ' . $duracionEdicion . '<br/> ' . $fechaEdicion . '</p> </td> <td class="lado"> </td> </tr> </table> <table class="firmas" style="font-size: 22px;"> <tr> ' . $tdFirmantes . ' </tr> <tr> ' . $tdFirmantesCargos . ' </tr> </table> <div class="codigoQR"> <img src=' . $link . ' border="0"/> </div> <table class="codigoGenerado"><tr><td><p style="font-size: 20px; margin: 0px;">Código Verificación: ' . $codigoGenerado . '-' . $idPersona . '</p></td></tr></table> </div>'; } } $htmlPDF = ' <html> <head> <script type="text/javascript" src="media/js/jquery/qrcode.js"></script> <style type="text/css"> body * { overflow: hidden; font-family: kartika; font-weight: bold; } @page { margin: 0px; } body { margin: 0px; ' . $miFondo . ' } div.cuerpoCompleto { margin: 0px; width: 1000px; height: 700px; } table { width: 1000px; padding: 50px; } div.tituloCurso { font-size: 16; } table.cabesera { position:absolute; left:0px; top:0px; } table.firmas { position:absolute; left:0px; top:600px; } div.logo { width: 150px; height: 120px; } table td.lado { padding-top:30px; width: 150px; height: 120px; } table td.centro { width: 700px; height: 100px; text-align: center; } table td.firmante { width: ' . $tamanoTdFirma . 'px; text-align: center; vertical-align: text-top; } table.codigoGenerado { position: absolute; top: 700px; left: 0px; width: 1100px; } div.codigoQR img{ position: absolute; top: 680px; float: right; right: 40%; } table.codigoGenerado td { text-align: center; } </style> </head> <body onload="update_qrcode()"> ' . $html1 . $cuerpoRepetitivo . ' </body> </html>'; return $htmlPDF; }