Opening a till (cash drawer) via PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Opening a till (cash drawer) via PHP

Post by robster »

Hi everyone,

I'm writing some POS software for my wifes business and we're having issues with money dissapearing from our cashbox. So I've decided we have to have a cash drawer that only opens when instructed from the PC. Our software I've written for POS is in PHP with MySQL as the database. It all works well and records which employee does the transaction.

What I now need is to get the cash drawer to open when instructed.

The question is, how can I get PHP to do this? (please note the machine is an imac running OSX 10.x)

Here are the cash drawer styles I'm looking at:
http://www.downtown.com.au/hsc1081.htm
http://www.vantex.com.au/product.asp?pID=9325&cID=1538
and the usb version http://www.vantex.com.au/product.asp?pID=9331&cID=1540

Obviously there are many variants but you get the idea.

If anyone could point me in the direction of interfacing hardware, or even better, if you've worked with cash drawer opening via PHP before, I'd really appreciate any help.

Thanks for your time...

Rob

EDIT: I am using PHP 4.x on the mac
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post by jwalsh »

PHP would need to be installed on the computer that directly controls the cash drawer. You could probably create a batch program to open the door from shell, then run that from php... Only option I can think of offhand.

Josh
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

sorry yes, I forgot to mention, the whole machine (imac) is just there on the counter, it does its thing and will be connected to the drawer.

I see what you're saying, write an app in another language (perhaps applescript or some other batch processing language) and then call that from php (as i've seen php can run external apps).

Sounds like i've got my answer.

I guess the other question is, USB or seriel (and the mac has no seriel port, but they say you can get a dongle/converter). Does anyone know anything about this kind of thing?

Thanks again :)

Rob
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post by jwalsh »

I run a mac myself, and have used such a converter, but I would always take the USB approach over a serial conversion. USB is more than fine for this type of use.

If the company is growing, I'd suggest running the switch on a seperate computer acting as a server. Then use a switch to control input from multiple cash registers.

This project sounds like fun... perked my interest.
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

The company is growing, but still very small in reality and we only need the one machine. (This is a hair salon).

My only concern with the USB device (drawer) is the need for a driver, and if so, how to open it. It appears that the seriel ones open just from recieving data from the seriel port, whereas the USB one seems to need more than this. I guess it's whether or not there is a USB drawer with a mac driver, and an app I can call (or make an app I can call) from PHP.

It is interesting, and it will be fun to see my PHP code, in the browser, open the till (in real life!).

;)

Thanks everyone for the help, but don't feel you have to stop, if you can think of anything/find anything out there I'm of course very grateful. I'll also keep anyone interested up to date with how the project goes.


Rob
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post by jwalsh »

I would assume buying a cash register with a USB port, would come with the appropriate software to open the till... no?

AppleScript the open through their software (running in background), then run that script from PHP. Remove all confusion by letting their code do it.

Although, the software they send may do exactly what your php script is doing... but then again, maybe not, I've never used one.
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

I think you're right. I'll get back when it's ready to roll with a little page of how I did it.

:)
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post by Trenchant »

Another thing you might want to invest in is a decent quality security cammera. My family fast food business was having the same problem as you with money walking away. We bought a security system and ran it through the computer/cash register. Ever since we rarely have money missing where as before it use to be as much as $120/day going missing.

A fake camera might even work. Its all about them knowing your watching.

Just my 2 cents.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

Web Dummy wrote:A fake camera might even work. Its all about them knowing your watching.
Elementary, My dear Watson :!: :lol:
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

i could get it to grab for X seconds when till opens or similar, just run a shell command to run a cam capture utility. I like it, thanks again :)

Rob
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

You could get one of those new cameras that connect to your network and send data wirelessly.

I bet if you worked at it you could get PHP to snap a photo (or video) as soon as the drawer was open and then log all that data for viewing by management at the end of the day. :)
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

it's almost evil!!!



:twisted:
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

the real question is do they catch you scratching your rear with this camera.... hehe . sorry for the off topic post but i had to some amusement in someones life:-D
chevi99
Forum Newbie
Posts: 1
Joined: Thu Jan 26, 2017 12:10 pm

Re: Opening a till (cash drawer) via PHP

Post by chevi99 »

I'm in the same trouble here. Has anyone gotten the solution to this? I have developed my POS already, now my client came to me that he has purchased a till machine and now he wants me to integrate it in the app. I wrote the app using PHP. Waiting for answers THANKS
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Opening a till (cash drawer) via PHP

Post by Celauran »

This is a post from 2005. Please create a new thread explaining your problem in detail.
Locked