我想创建一个加载项,以便用户等到导入完成,这是导入的代码,不好的地方是直到最后都显示消息,并且没有任何反馈或类似的内容,对用户而言,我的英语非常抱歉只是一个学生
public function importsActivos()
{
if (isset($_FILES["file"]["name"])) {
$path = $_FILES["file"]["tmp_name"];
$object = PHPExcel_IOFactory::load($path);
foreach ($object->getWorksheetIterator() as $worksheet) {
$highestRow = $worksheet->getHighestRow();
$highestColumn = $worksheet->getHighestColumn();
for ($row=2; $row<=$highestRow; $row++) {
$plac = $worksheet->getCellByColumnAndRow(0, $row)->getValue();
$descripcion = $worksheet->getCellByColumnAndRow(1, $row)->getValue();
$this->db->where('placa', $plac);
$exists = $this->db->count_all_results('activos');
if ($exists > 0) {
$dataUpdate = array(
'placa'=>$plac,
'detalle'=> $descripcion,
);
$this->db->where('placa', $plac);
$this->db->update('activos', $dataUpdate);
}
else {
}
}
}
}
echo 'Message ';
}