looking for advise on importing excel into mysql with php - php

Alright, see if I can pick your brains from you all.
I'm currently working on a project where all the information comes from different clients, the only thing in common is that the received data is done with excel. The excel spread sheet that they present is just a bunch of references and codes, and the problem than I'm facing is that I need the references and codes to be entered in certain format in order for the website to work.
The perfect situation will be to go to each client and teach how I would need the data, but I can't do that because of the large number of clients, and more importantly I will be interrupting their work flow. Each client has its own codes and reference model and they are not willing to change their process
The good news is that there is a standard pattern for the codes, but I'm talking close to 200 thousand codes with a bunch of combination.
They way that we are currently solving the problem is that we have a person who checks each excel sheet received, runs a few macros, and manually fixes those codes in which the macro was not able to fix.
The person that is doing this, is already burn out and frustrated and I would like to automatize this process with php.
Suggestions?

There's a nice class called PHPExcel that allows you to write and read from a variety of document types:
http://www.codeplex.com/PHPExcel
You need to enable the php_zip extension for Excel 2007 documents

you can use dbTube.org to solve your problem. You can configure the mapping
in graphical editor. The import definition can be saved and reused. It is
not neccessary to change the excel sheet.
Greetings Andreas

Related

How to export data to Excel template, retaining VBA code and data validation, using PHP?

I need to export data to an Excel template that contains VBA code and data validation in PHP.
I tried using PHPExcel library but it is removing the VBA code and data validations from the template.
I tried using PHPReport library, didn't get proper solution.
The template contains multiple worksheets and they are interdependent.
E.g.: Worksheet 1 contains employee data, then worksheet 2 contains salary with respect to employee name.
I have spent a great deal of time working on this problem, and the problem of memory consumption for large data sets. All of the PHP libs I have found keep all of the cells in memory, which is not viable for anything more than a small sheet.
What I ended up doing was writing a set of Java utilities using Apache POI and packaged them with PHP/Java Bridge so I can call them from PHP. This will allow you to create a new workbook based upon a template, keeping the macros intact. You can also use POI's streaming API, so you can handle massive data sets without crashing your server.
If you have Java chops, I highly recommend going this route, it's really the only way to do brain surgery on Excel files from PHP.
If you have any questions about how to do this or would like some example code, I'll be glad to help.

PHP to MySQL and Google sheet?

A few months ago, my supervisor needed me to create a form to collect some data - at the time, the most sensible thing to do was just to whip together a Google Form, no problem. Now it turns out that the data collection program needs to expand, and it makes more sense to direct the form to a MySQL database (using PHP) instead - again, no problem, already done. However, for reasons I won't elaborate on here, my supervisor still wants that data to go to the original Google Sheet as well.
My question - is it possible to submit form data to two separate sheets when one is a MySQL table and the other is a Google Sheet?
Thanks!
I know that feel bro ;)
There's some resources to handle boss requests:
PHPExcel Class is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, HTML...
You will need an script to process the outputs.
Excel / CSV > MySQL
MySQL > Excel / CSV
If you need directly to work with Google Docs, you will have to follow the previous steps and play with the following project:
php-google-spreadsheet-client is a library that provides a simple interface to the Google Spreadsheet API.
You will need to store data in MySQL and pass it to Google.
Second idea:
If your boss neet it NOW, you can give a chance to Zapier and do it fast. If you don't need a very fast sync time, it can be a good free option.
I hope it helps :)

How to programmatically build an org-chart and export to a PowerPoint file?

Most of the question is in the title.
A client is asking me to build a form with dynamic hierarchical fields from which to build a sort of org-chart that must be exported to PPT (OpenOffice Impress is an option).
I've found many libraries that allows to do that, but all of them only allows to export to images, HTML5 or other non editable charts.
I'd really like to use Google Chart Tools (even though I'm afraid of Google tendency of discontinuing their products), but also this tool doesn't have any mean to export to PowerPoint.
Also PHPPowerPoint seems a possible solution, but there is no documentation as far as I can see and I don't know if the autoarrange requirement is available.
Being dynamically built, the library must also take care of automatically arranging all items (unless anyone knows a way to do that programmatically).
Does anyone ever had this need or know a possible approach?
The main point is that the generated file must be editable.

fill in PDF form using data in MySQL database

I am working on an online time card system to replace the paper time cards. What I have done is create a webpage in PHP that takes the time in and out along with job description and other values the user inputs and stores them in a MySQL database. Everything is working just fine.
What I would like to work on next is to take the information from the database for the specific user and week and have it fill in a PDF template file I have created from scanning the old paper time card and making it into a PDF form. I dont know if this is possible I have been researching it online and all I can come up with is how to generate a new PDF file. I am hoping someone here can point me to a source of information on how to do this.
Here is an example of exactly what I want to do http://try.fillpdf-service.com/
Hi congratulation for you about done the 1st step in time,
You can use very complete pdf generator php class TCPDF
It started in 2002, TCPDF is now one of the world's most active Open Source projects, used daily by millions of users and included in thousands of CMS and Web applications.
http://www.tcpdf.org/ for genarating your pdf what kind your want this class has very useful documnet and simple to use
Cheers,
Farzam
Take a look ath this
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
It can be invoked as a command line tool and among the other functions let fill form fields, (on an already existing PDF you supply).
Maybe FPDF is quite old, but still good to handle for PDF generation. Just take a Template PDF (create as you like) and put the informations you want on it. You will have to place your data on the specific positions, see the tutorial section for a better understanding.
Another popular solution is to use Zend_PDF from well known Zend Framework, but I think FPDF would be a tick easier to work with if you are not very experienced.

Parsing PDF file using PHP to submit values to MySQL

I want to know if it is possible to view a PDF file in a webapp of some kind, then be able to trace over lines in the PDF file and submit the lengths to an MySQL database.
Basically import a PDF file, trace around a shape in that PDF file and save those values.
I work with House plans and this would make my job a lot easier.
Is it possible? and can someone point me in the right direction on where to read more.
I know its possible to pull text from a PDF file, I've seen heaps of info on how to do that using various libraries, but nothing on a Vector shape (house plan).
If it's not possible in PHP which language should I look into, the only reason I ask is because I have basic skills in PHP and have already written some simple apps that help me out, this would just be the final touch to make my job easier.
Thanks
Parsing PDFs is a world of pain... And PHP is probably as good language to jump into this as any other.
I would recommend you to start your research with GhostScript, it has a CLI interface which could be accessed by php

Categories