Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating and reading barcode

I've built an e-shopping website for a big company which has country offices.

What i want to do is the following

  1. Generate barcode via PHP before sending package to country offices of company
  2. When the item will be arrived to country office, workers will login to their account, scan this barcode via barcode reader (which located on package) and website will automatically "approve" that item received.

Is it possible only with web interface? I mean without any local application. How to do that? PLease explain.

like image 978
heron Avatar asked Oct 25 '11 18:10

heron


3 Answers

so here is an approach that could work for you:

You need to put a record in a database like:

package_id |    name      |   status

  1234        My Package      shipped

Generate a barcode which contains the package_id, you have to decide what kind of barcode you want to use. You could also use a data matrix. Then you create the bar code as image so that you can print it. Data Matrix is very good for large custom data.

  • A jQuery Barcode Generator: http://barcode-coder.com/en/barcode-online-generator-2.html

Print the bar code, put it on your package

The package arrives at the office, the user logs on to your website, clicks on "Confirm Package Received" or whatever. Then there is a text-field, he focuses the text-field, scans the barcode/data matrix and your package ID "1234" will appear in the text-field

Submit the form, lookup the entry in the database, change it to:

 package_id |     name      |   status
  1234         My Package      delivered

A Tip If you use a QR Code it can be read by many mobile phones, so you don't need a real bar code scanner. You could write an app that reads the bar code and sends the package_id to your server.

like image 159
sled Avatar answered Oct 19 '22 08:10

sled


Tcpdf has a few classes for generating barcodes:

http://www.tcpdf.org/doc/code/classTCPDFBarcode.html

With good examples:

http://www.tcpdf.org/examples.php

For example the first:

// set the barcode content and type
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');

// output the barcode as HTML object
echo $barcodeobj->getBarcodeHTML(2, 30, 'black');
like image 42
Lajos Veres Avatar answered Oct 19 '22 07:10

Lajos Veres


Check larsjung.de/qrcode/‎

It's JQuery Pluggin, but works well with PHP.

As I see your scenario, you need more than just 1D Barcode. You need QR Code.

Hope this helps.

like image 42
JMS786 Avatar answered Oct 19 '22 08:10

JMS786