QRC in admin

By Toledoh - January 20, 2016

Hey guys.

How would I go about creating a QR Code in the admin.  ie.  I want to be able to create a record in a multi record section, and have a QR Code created for that record and displayed in the admin for the administrator to print out and use.

It can be random or based on the num of the record etc - but has to be unique.

Cheers,

Tim (toledoh.com.au)

By gregThomas - January 22, 2016

Hey Tim, 

The simplest way to implement this feature is to create a separator and add custom HTML and PHP that displays a QR Code. The QR code gets the num of the record from the URL and uses that variable to create a unique ID. This QR code will appear after the first time they save the record.

Here is the code I added to the separator: 

<?php
if(@$_REQUEST['num']){
   echo qrCode(array(
      'type' => 'text',
      'text' => 'Hello world! ' . @$_REQUEST['num'],
    ));
   }
?>

I've attached a screenshot that shows how I implemented this code into the separator. 

The user would be able to print this by right clicking on the QR code and clicking 'open in new tab'. From here they could print the code without the other page content. 

Let me know if you have any questions. 

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com
Attachments:

seperator example.png 118K

By Toledoh - January 22, 2016

Thanks Greg.

I've implemented the following:

<tr><td>
<?php
if(@$_REQUEST['num']){
echo qrCode(array(
'type' => 'text',
'text' => @$_REQUEST['examplecode'],
));
}
?>
</td></tr>

And this in the front-end page

<div class="col-xs-3 qrc">
<?php
echo qrCode(array(
'type' => 'text',
'text' => $record['items.examplecode']
));
?>
</div>

However, they create different QRC's as attached.  The one from the front-end can be read, but the one from the admin can't.  Any ideas?

Cheers,

Tim (toledoh.com.au)
Attachments:

cmsb.png 1K

front.png 1K