When submitting the form, the data is received in a file called nuevo. This file has the following code:. As you can see, we are not doing any validation and we are inserting the data as it comes from the form. In case everything goes well, we redirect to Listar. Right there we include the buttons that are used to edit and delete the product , which are nothing more than links to another page. By the way, we also put a button to add a new product; It is also a link that leads to the form.
When we click on the edit button, it redirects us to another file. Then, we make a query to the database where the id is the one we read. If the product does not exist, we indicate it. In case it exists, then we draw the same form but now we fill it with the value attribute of the input tag. For the textarea it is different, since the content must go between the tags, not as an attribute. Please note that to know the id that we are editing with which we will do the where I am saving it in a hidden input.
There are two buttons. One of them submits the form; the other is simply a link to Listar. The point of all this is to provide the user with navigation buttons. Above we saw the form to edit.
Is this:. It is Very similar to the form for inserting a new one, but this one edits. If everything goes well, it takes us to Listar. Please note that it does not ask for confirmation, so you have to do it carefully.
This was the part that I liked the most. It only works with arrays and sessions, but I liked the result. The interface Shows a table, which will be of the products that make up the sale.
It also shows the total , which at the beginning is 0. And at the bottom 2 buttons that are to finish selling or to cancel the sale. Note that it has an input, that is to read the barcode. It is actually an input within a form. When this form is sent, it goes to the file that we will see below. I repeat that this is the part that I liked the most. We start by checking the existence of the product, if it does not exist, we return to vender. In case the product does not exist that is, it does not exist, not that its existence is 0 we send status 4.
But assuming that everything is fine and that the product exists, we log in and go through the cart array to see if we had already added that product before. In case we have added it, then we only change the amount. Better we show one and indicate that its quantity is 2 , and so on. If it does not exist in the cart, then we add it to the array and put its quantity, which by default is 1.
Also, by default, its total will be the sale price. It is not necessary to do multiplication. Then, if it already exists, we calculate its total , which is the result of multiplying its sale price by the quantity in the cart.
The code is very easy to understand:. Oh, and we go back to vender. It is a simple file that will insert into the database the products sold, as well as the sale, its date and its total. It looks like this:.
We subtract stock of products , we take the server time and save the sale. Then we clean the cart. If you ask me for beginTransaction and commit , it is to although it is not noticeable speed up the process. It consists of two things: listing sales and being able to delete them. Login menu Login with username and password for protection pos app online login.
Product Based You can product databased in product menu, support with barcode code and expire date features if you needed. Point of Sale POS Point of sale transaction feature ,for fast transaction you can use scanner barcode or searching product, and then click payment.
Report Details After all point of sale transaction you can check report detail in report menus for profit income you bussiness. All in one hanlded by axcorapos app online point of sale free download with source code for you. Fork It. After create new databased mysql you must import axcorapos. If Progress databased is success you can confgure the connection bellow chek in axcorapos folder and edit connect.
Visit menu product create and regsiter you product in here.
0コメント