Generate unique QRs per Document Generated

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
joshianjvj83
Posts: 21
Joined: 2024-05-12 10:13

Generate unique QRs per Document Generated

Post by joshianjvj83 » 2024-05-21 01:27

I need assistance with my document tracking system. Specifically, I would like to integrate a feature that generates QR codes for each document. This way, when documents are printed, users can easily scan the QR codes for quick access and tracking.

Any guidance or recommendations on how to implement this would be greatly appreciated, I'm kinda confused on how the 2 previous discussions about them integrating QR.

Huge Thanks to people helping out first-time users here.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1202
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Generate unique QRs per Document Generated

Post by onoehring » 2024-05-22 07:20

Hi,

a) which other 2 discussions are you talking about (URLS to threads)?
b) what is your problem? Do you want other to create code for you or do you have a more specific question?
c) for me it's unclear what the QR code should reference to. Should it encode the URL of your AG application, directly linking to the record?

Olaf

joshianjvj83
Posts: 21
Joined: 2024-05-12 10:13

Re: Generate unique QRs per Document Generated

Post by joshianjvj83 » 2024-05-27 06:18

Hello, a late reply from me and thank you for the assistance,

a) I'm referring to the other 2 topic here within the forum with the same integration of QR Code, that I'm struggling to understand
b and c) I would like to generate a QR code when a user creates a "New Document" and be visible within the document details

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1202
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Generate unique QRs per Document Generated

Post by onoehring » 2024-05-27 06:41

Hi

still unclear
a) can you please point out the URLs you are referring to?
b) What is a "new document"? Are you talking about a new RECORD in the table ("add new"-button)? Or when a new file is added to an existing record? Or something else?
c) Ok, so the QR code should be a link to the DETAILS page of the record (not the uploaded document itself)

The more details you provide, the better your chances for distinct help. Sorry for now.

Olaf

miwalder
Posts: 10
Joined: 2013-02-11 20:36
Location: Switzerland
Contact:

Re: Generate unique QRs per Document Generated

Post by miwalder » 2024-07-10 16:06

Hi, have you solved you QR-Project? I did something similar. I created a Mobile Device Managment System for our school. One feature is to print labels with a link to the dataset of this device. Let me know if you need assistance.

Michael

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1202
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Generate unique QRs per Document Generated

Post by onoehring » 2024-07-11 06:57

Hi,

just a quick suggestions: If you are using a windows server, check out these two free tools that both allow creating QR (and barcodes) by commandline and are very easy to use:

from nirsoft SimpleCodeGenerator: https://www.nirsoft.net/utils/qr_code_generator.html

and another, I belive even more powerful, ZINT: https://sourceforge.net/projects/zint/

Olaf

miwalder
Posts: 10
Joined: 2013-02-11 20:36
Location: Switzerland
Contact:

Re: Generate unique QRs per Document Generated

Post by miwalder » 2024-07-12 19:58

Hi
You can use https://phpqrcode.sourceforge.net/ and copy it to the hooks folder of your project. With the following code you can generate QR-Codes which links to a dataset of your database. The QR-images will be stored in the folder QRs and will have the ID of your dataset as filename.

Code: Select all

<?php
    define('PREPEND_PATH', '../../');
    $hooks_dir = dirname(__FILE__);
    include("$hooks_dir/../../defaultLang.php");
    include("$hooks_dir/../../language.php");
    include("$hooks_dir/../../lib.php");
    include_once("$hooks_dir/../../header.php");
    include("$hooks_dir/phpqrcode/qrlib.php");
     
    /* grant access to the groups 'Admins' and 'Data entry' */
    $mi = getMemberInfo();
    if(!in_array($mi['group'], array('Admins'))){
        echo "Access denied";
        exit;
    }
 
    //echo "Success";
    $sqldevicequery = sql("SELECT d_id FROM device", $eo);
      $path = 'QRs/';
        while ($devicerow = db_fetch_assoc($sqldevicequery)) {
            $d_id = $devicerow["d_id"];
            echo $d_id."</br>";
            $qrcode = $path.$d_id.".png";
            QRcode::png("https://yoursite.com/device_view.php?SelectedID=".$d_id, $qrcode);
            echo "<img src='".$qrcode."'>";
        }

Post Reply