I am using PHP Point of Sale, and I need a simple function added to the sales form.

REF: PHP Point Of Sale

In the file /sales/sale_ui.php

I need to add a date/time function to post to the MySQL database. And then print or echo so that the information is physically printable for the EU, but also saved in the DB.

Something for these type of variables:


I am a nuub. So I am looking for how to add the PHP code, and how to create the MySQL database table.

Basically the this function will need to log when I customer starts the transaction, and when the customer ends the transaction.
So there is really going to need to be two fields, and two functions. Start and stop time of the transaction.

I am just learning PHP, but I understand HTML and CSS very well.

Please help, Im stuck. Thanks!


This is something that I found, that seems like it would work. But I can not get it to work for me:


$datefromdb = $guest['guest_time'];
$year = substr($datefromdb,0,4);
$mon = substr($datefromdb,4,2);
$day = substr($datefromdb,6,2);
$hour = substr($datefromdb,8,2);
$min = substr($datefromdb,10,2);
$sec = substr($datefromdb,12,2);
$orgdate = date("l F dS, Y h:i A",mktime($hour,$min,$sec,$mon,$day,$year));
Date: <? Echo $orgdate; ?>