At the beginning I think I need to output excel files by my program, so I searched a php function for spreadsheet manupulation.
Today I really need to write that part to output a form from the database, but I found that the format I need is OpenCalc (sxc) format... which is basically a zip archive containing some xml files.
After a brief search and no result, I decided to unzip the empty form and make a "template" so that I can use simple search and replace method to fill in the required field, and seems I've done most of the difficult part now!
Missing part is to delete record from database, and a simple UI for querying the data, like by time, by vender, by product, etc.
Happy new year!