รายละเอียดของการตอบ ::
<?php
include 'dbconnect.php';
echo $uploadfile=$_FILES['uploadfile']['name'];
require 'PHPExcel/Classes/PHPExcel.php';
require_once 'PHPExcel/Classes/PHPExcel/IOFactory.php';
$objExcel=PHPExcel_IOFactory::load($uploadfile);
foreach($objExcel->getWorksheetIterator() as $worksheet)
{
echo $highestrow=$worksheet->getHighestRow();
for($row=0;$row<=$highestrow;$row++)
{
echo $id=$worksheet->getCellByColumnAndRow(0,$row)->getValue();
echo $fname=$worksheet->getCellByColumnAndRow(1,$row)->getValue();
echo $jobtitle=$worksheet->getCellByColumnAndRow(2,$row)->getValue();
echo $checkin=$worksheet->getCellByColumnAndRow(3,$row)->getValue();
echo $checkout=$worksheet->getCellByColumnAndRow(4,$row)->getValue();
if($id!='')
{
$insertqry="INSERT INTO 'team'('id','fname','jobtitle','checkin','checkout') VALUE ('$id','$fname','$jobtitle','$checkin','$checkout')";
$insertres=mysqli_query($connect,$insertqry);
}
header('location:index.php');
}
}
?>