PHP masterminds please assist

Lord-Nikon

Expert Member
Joined
Jul 22, 2008
Messages
2,511
Reaction score
0
I need some help regarding some coding in PHP and some ideas or suggestions.

I am busy creating a POS (point of sales) program using PHP. The reason I'm using PHP is because then I can access the same db anywhere in the world and only have one installation of the program :D I know, it's lazy, but I have that to my usage etc. etc.

The thing I'm battling with is where you add items to an invoice for instance. How can I create a sort of a multi-line invoice system where I don't have to determine before hand how many items I want to add to the invoice / quote. Basically almost something like a spreadsheet and then add as many item lines as needed and then calculate once "process invoice" has been clicked or something similar. Any suggestions? Ideas?

:p
 
Just use one input form and submit the values via AJAX, then you can add multiple items without apparent page reloads
 
Don't know AJAX or ASP.NET that good...

Any suggestions using only PHP?
 
I would have a quantity text input or a + or - quantity buttons which call a javascript function to add the item id and item quantity to a shopping cart class hold in a session variable. You could use AJAX to save page re-loads and process the storing of the item in the background but also have the form submit to the same script just in case the user doesn't have javascript enabled.

If you're looking for examples, I'd recommend googling 'php shopping cart class' and 'ajax tutorials'; you'll find plenty of examples. I'd also recommend using a pre-built javascript library such as prototype or jQuery as it can make javascript programming a whole lot easier.
 
I've started fiddling with AJAX and it is basically a JavaScript based communication. I'm currently trying to incorporate AJAX with php and see if I can get results run from my PHP scripts to post back to AJAX...
 
Yep. That's the idea. AJAX is just a way of using Javascript to use the HTTP handler and communicate with the server without needing to do a full postback. Aren't there any AJAX wrappers available for PHP?
 
I need some help regarding some coding in PHP and some ideas or suggestions.

I am busy creating a POS (point of sales) program using PHP. The reason I'm using PHP is because then I can access the same db anywhere in the world and only have one installation of the program :D I know, it's lazy, but I have that to my usage etc. etc.

So the POS program is going to be dependent on a active working (low latency) internet connection?
 
Put all the items in an array? Maybe in the form:
Code:
array(
itemcode => itemcost,
itemcode => itemcost,
etc
)
You can then use the array to create the final item list upon checkout.
 
So the POS program is going to be dependent on a active working (low latency) internet connection?

That is correct. At the moment only one user will be using it as the shop only opened this week. In a months time a few more shops will open scattered across Gauteng / Cape Town / Durban.
 
That is correct. At the moment only one user will be using it as the shop only opened this week. In a months time a few more shops will open scattered across Gauteng / Cape Town / Durban.

Single point of failure and rotating additional cost per installation. (bandwidth)

No offense, but why not use a proven solution? There are open source ones available.
 
Single point of failure and rotating additional cost per installation. (bandwidth)

No offense, but why not use a proven solution? There are open source ones available.

Because that takes the fun out of doing it myself and learning whilst doing so :D

I've got few setups that runs like that at the moment (not POS though) and so far no probs... As for bandwidth we run uncapped 4mb lines at all the offices :D So no hassle there :D
 
Top
Sign up to the MyBroadband newsletter
X