Now we encounter a requirement to import employee data in batches.
The structure is:
Employee photo, Employee name, Employee position, Company
andOne employee is only allowed one employee photo, One employee belongs to one company, One employee is only allowed one position. The target data volume is 200. Now we need to use PHP to import this data into the database in batches and display it in the front desk.
I have tried to use PHPExcel to read xlsx table files before, but the pictures in xlsx do not belong to any cell, and the corresponding relationship between employee photos and employees cannot be determined. .
I hope you can help point out a suitable solution, thank you very much!
ajax can do it.
Encapsulate form data upload through the formData object (lower version browsers are not compatible, check compatibility at http://caniuse.com/#search=fo...)
First of all, the photos must be imported in the second step
Secondly, you can save the photos into a folder, but the photo names must correspond to the employees (for example, the photo of employee No. 1 in excel is 1.jpg, and the photo of No. 2 is 2.jpg ) No matter what method you use, there must be at least a corresponding relationship. If the picture is stored in excel, I think there should be this corresponding relationship.
The first step is to import other employee data to prevent errors in the corresponding relationship. You can also save the serial number in the database.
After importing, import the picture according to the corresponding relationship.
The third step is to delete the serial number field!
If I can do it, it’s just these steps anyway
There must be a corresponding relationship between the photos and employees