Hello...
How can I make the app that I build with AppGini do the barcode ...?
I would like to have something like in the attached image ...
My question is how do I make the code or how is the process ... ???
Thanks....
how to make QR code
- D Oliveira
- AppGini Super Hero
- Posts: 348
- Joined: 2018-03-04 09:30
- Location: David
Re: how to make QR code
edit desired template_DV html file, output a QR code in a <div> and you're all set
Re: how to make QR code
hello
you need to download library name : PHP QR Code
you can download from here :
http://phpqrcode.sourceforge.net/
This my code to make QR Code
please check
you need to download library name : PHP QR Code
you can download from here :
http://phpqrcode.sourceforge.net/
This my code to make QR Code
Code: Select all
<?php
$currDir = dirname(__FILE__);
include("$currDir/defaultLang.php");
include("$currDir/language.php");
include("$currDir/lib.php");
include_once("$currDir/header.php");
/* grant access to all users who have access to the Collectors table */
$boxs_from = get_sql_from('Boxs');
if(!$boxs_from) exit(error_message('Access denied!', false));
/* get invoice */
$box_id = intval($_REQUEST['ID']);
if(!$box_id) exit(error_message('Invalid Box ID!', false));
$res = sql("select * from boxs where ID={$box_id}", $eo);
while($row = db_fetch_assoc($res)){
$items[] = $row;
}
//var_dump($items);
//Photo Number Kind Lnumber Location Start_Date End_Date Area Project Street Building Unit Status Notes
foreach($items as $i => $item){
$ID = $item['ID'];
$Area = $item['Area'];
$Street = $item['Street'];
$Building = $item['Building'];
$FF = "box".$ID.$Area.$Street.$Building;
//$filepath = 'QR/'.$FF.'.png';
//echo $filepath;
}
require_once("phpqrcode/qrlib.php");
$filepath = 'QR/'.$FF.'.png';
$file = $FF.'.png';
$logopath = 'img/qsrn.png';
// qr code content
echo $item['Location'];
$codeContents = 'Line one'."\n";
$codeContents .= 'Project Info : '.$item['Project']."\n";
$codeContents .= 'Number : '.$item['Number']."\n";
$codeContents .= 'Kind: '.$item['Kind']."\n";
$codeContents .= 'Lnumber : '.$item['Lnumber']."\n";
$codeContents .= 'Start_Date : '.$item['Start_Date']."\n";
$codeContents .= 'End_Date: '.$item['End_Date']."\n";
$codeContents .= 'Location : '.$item['Location']."\n";
$codeContents .= 'Building : '.$item['Building'].' - Street : '.$item['Street'].' - Zone : '.$item['Zone'].' - Unit : '.$item['Unit']."\n";
// Create the file in the providen path
// Customize how you want
QRcode::png($codeContents,$filepath , QR_ECLEVEL_H, 3);
//QRcode::png($codeContents,$filepath_dv , QR_ECLEVEL_H, 2);
//QRcode::png($codeContents,$filepath_tv , QR_ECLEVEL_H, 1);
// Start DRAWING LOGO IN QRCODE
$QR = imagecreatefrompng($filepath);
// START TO DRAW THE IMAGE ON THE QR CODE
$logo = imagecreatefromstring(file_get_contents($logopath));
$QR_width = imagesx($QR);
$QR_height = imagesy($QR);
$logo_width = imagesx($logo);
$logo_height = imagesy($logo);
// Scale logo to fit in the QR Code
$logo_qr_width = $QR_width/3;
$scale = $logo_width/$logo_qr_width;
$logo_qr_height = $logo_height/$scale;
imagecopyresampled($QR, $logo, $QR_width/3, $QR_height/3, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
// Save QR code again, but with logo on it
imagepng($QR,$filepath);
// End DRAWING LOGO IN QR CODE
sql("update Boxs set Photo= '{$file}' where ID={$box_id}", $eo);
// Ouput image in the browser
//echo '<p align="center"><img src="img/center.jpg" />';
echo '<p align="center"><img src="'.$filepath.'" />';
include_once("$currDir/footer.php");
?>