Solved

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

Posted on 2007-12-04
9
4,898 Views
Last Modified: 2013-12-12
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.
0
Comment
Question by:v2Media
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 17

Assisted Solution

by:psimation
psimation earned 100 total points
ID: 20409369
Hi
I havn't worked with barcode scanners for quite a while, but "back in the day", the barcode scanners we used to work with were merely "keyboard" interfaces - ie. the barcode scanner would "convert" the barcode into characters and then simply send it via the keyboard interface as if it were typed in in the first place.
I am guessing that most barcode scanners will come with software (or firmaware) that will already be capable of "understanding" most standards already , and the bundled software will allow you to further add/edit onto the standard values if you require.

Thus, if things still work the same, you won't need to do any coding in order to use a barcode scanner on your website, but you may need to do some coding if you want to add some extra descriptions to the standard barcode values ( usually they are only number sequence printed below barcodes as you see them on packages) - but this should be pretty straigh forward; you could simply create a lookup table holding your descriptions paired with the numerical values, and when you scan something, you replace the numbers with the description.
0
 
LVL 43

Assisted Solution

by:Rob
Rob earned 400 total points
ID: 20414818
Hi,
TO add to psimation, I see this as 3 parts, the webpage, the database, and the user input.  
The webpage (php form) is where the user puts a barcode into a textbox and submits the form.
The barcode is used in a database lookup to return the other information.  How the barcode is entered shouldn't matter (ie user input or barcode scanner).
Most barcode scanners these days have the scanner send escape keys such as newline after a barcode is scanned, so whether the user types the barcode manually and presses enter or a barcode is scanned, the form won't know the difference.
I know these guys sell a quality barcode scanner: www.vendorconnect.com.au but there are heaps of different options such as bluetooth wireless but I reckon you only need the basic scanner as long as it can send the escape codes (prevent the user having to press enter after every scan).
Where are you up to in the project and what part in particular do you require advice?
cheers,
Rob
0
 
LVL 19

Author Comment

by:v2Media
ID: 20415360
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...



0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 43

Expert Comment

by:Rob
ID: 20415429
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?
0
 
LVL 43

Expert Comment

by:Rob
ID: 20415456
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

0
 
LVL 43

Accepted Solution

by:
Rob earned 400 total points
ID: 20415537
PHP-Barcode 0.3pl1

PHP-Barcode generates
  - Barcode-Images using libgd (png, jpg,gif),
  - HTML-Images (using 1x1 pixel and html-table)
  - silly Text-Barcodes

PHP-Barcode encodes using
  - a built-in EAN-13/ISBN Encoder
  - genbarcode (by Folke Ashberg), a command line
    barcode-encoder which uses GNU-Barcode
    genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c),
    I25, 128RAW, CBR, MSI, PLS
    genbarcode is available at www.ashberg.de/bar 

(C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>

The newest version can be found at http://www.ashberg.de/bar
0
 
LVL 19

Author Comment

by:v2Media
ID: 20415732
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.
0
 
LVL 43

Expert Comment

by:Rob
ID: 20415736
this is a command line barcode generator for creating eps files:

http://gnuwin32.sourceforge.net/packages/barcode.htm
0
 
LVL 43

Expert Comment

by:Rob
ID: 20415756
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

0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question