Link to home
Start Free TrialLog in
Avatar of v2Media
v2MediaFlag for Australia

asked on

PHP / MySQL POS Solution Incorporating Barcode Scanner into Website Form Input (Australian Solution)

Looking for advice from php/MySQL devs who have experience in integrating barcode scanners into php product ordering systems.

The scanners are intended to be used by website staff for point of sale on location. The user navigates to the new order page, scans the item and the order form populates all fields with the item's details.

This psudo POS system is for an Australian business. So any hardware, has to be available in AU. The entire system must be php/mysql based, so solutions such as myob will be ignored.

Thanks in advance for taking any time composing replies.
SOLUTION
Avatar of psimation
psimation
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of v2Media

ASKER

The project is completed; the client wants this as an additional feature. My ignorance of how scanners work is the problem, and finding some off-the-shelf code to integrate them into a website.

There's a massive hole in the advice given so far. I realise that scanners are basic input devices that translate barcodes into numeric sequences and a trailing \r\n. However in order for this input to work, there's several processes that have to be completed to get to that stage:

Modify product labels to feature barcodes
Inventory scan to associate a barcode with a product

These are the processes which obviously require additional forms for data entry, item selection and scripting for item barcode printing. From what the both of you have posted, the scanner is nothing more than emulated keyboard entry. So that leaves incorporating the barcode into the product label printing.

So, the forms/processing required would be something along these lines yes?

1. Barcode generation (prolly pdf)

2. Product selection to printer form for printing the required number of barcodes for each item selected (all items for initial print run).

3. Forms for scanning in the initial code to product associations (auto submits and iterates to next item).

There's probably a bunch of other things that these systems use to minimise labour, such as printing a catalog of item thumbnails over barcodes for manual scanning when label cannot be scanned....

I realise this whole concept of barcode scanning is simple, but from my experience, the devil is in the detail...



Hi,
1. PDF yes it will need to be so that when it is printed it will be clear. (I have php code for this as well) as we generate barcodes so that they can be put on our product.

2. I'm guessing this is selecting a product that you want to print barcodes for and php will print out a form full of labels (barcodes) to stick on the product?

3. Would this be a form that would bring up all your product items that do not currently have a barcode associated?  If so, then you find the product the page is asking for and then scan the barcode that's on the item and associate the barcode in your system with that product code?
To add have a look at PHP-Barcode which can create html images from php

eg. this is all the code you would need with their include file:


require("php-barcode.php");
 
$code='123456789012';
 
$code = (get_magic_quotes_gpc()) ? stripslashes(getvar('code')) : getvar('code');
 
// encoding - this will guess EAN or UPC
$e="ANY";
 
// scale
$s=2;
// mode (type)
$m='png';
 
barcode_print($code,$e,$s,$m);

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of v2Media

ASKER

Thx for ur help tagit. I get the impression there's nothing available in a nice, neat package that will do it all, which is what I was really hoping for. This will more than likely be a one-time project. I really didn't want to have to put together all the different pieces into a coherent whole that's usable via a website gui. It seems that's what's required tho.
this is a command line barcode generator for creating eps files:

http://gnuwin32.sourceforge.net/packages/barcode.htm
here is the code i use to create the eps:
		echo "$code<br>";
		$res = barcode_encode_ean($code);
		if ($res["valid"]) {
			// Outputs all the result of the shellcommand, and returns
			// the last output line into $last_line. Stores the return value
			// of the shell command in $retval.
			// 931618812345
			$ean=substr($code,0,12);
			$eansum=barcode_gen_ean_sum($ean);
			$ean.=$eansum;
			//create the directory
			if (!is_dir("eps")) {
				mkdir("./eps/",0777, true);
			}
			if (!is_dir("./eps/$sid")) {
				mkdir("./eps/$sid",0777, true);
			}
			if (!strcmp($encoding,"any")==0) {
				$last_line = system("barcode -o .\\eps\\$sid\\$ean.eps -b $ean -u mm -E -e $encoding -g $w" . "x" . "$h+10+10 -p $w" . "x$h", $retval);
			}
			else {
				$last_line = system("barcode -o .\\eps\\$sid\\$ean.eps -b $ean 0u mm -E -g $w" . "x$h", $retval);
			}
			if (false) {
				echo "$retval -> $last_line<br>";
			}
 
			/*
			echo "
			</pre>
			<br>
			Created EPS barcode file: <a href=\"eps/$sid/$ean.eps\">$ean.eps</a>
			<br>
			";
			*/
		}

Open in new window