Carregar o Excel e armazená-lo no banco de dados?

Quero fazer upload de um arquivo do Excel em nossa página da Web e, em seguida, os dados correspondentes o armazenam no banco de dados. E então eu quero recuperar todos os dados e exibi-los no formato de tabela. Eu tenho um código, mas usando isso, não consigo carregar todos os arquivos do Excel. Somente um único formato pode ser carregado.

Abaixo está a função. Mas há alguma restrição.

 public function check_excel($filename)
        {   
            $path='./assets/uploads/excel/'.$filename;
            $this->load->library('excel');  
            $inputFileType = PHPExcel_IOFactory::identify($path);
            $objReader = PHPExcel_IOFactory::createReader($inputFileType);
            $objPHPExcel = PHPExcel_IOFactory::load($path);
            $sheet = $objPHPExcel->getSheet(0); 
            $highestRow = $sheet->getHighestRow();
            $highestColumn = $sheet->getHighestColumn();
            $xf[]='';
            $result[]='';
            $first_check='';
            $var_check=0;

            for ($row = 13; $row <= $highestRow; $row++)
            {           
                $xf[$row]=$objPHPExcel->getActiveSheet()->getCell('A'.$row)->getXfIndex(); // Get sheet index value
                if($row>13 && $row<16) //This block check first kpi data expand or not
                { 
                    if($xf[$row-1]==$xf[$row]) //check parent and child sheet index value same 
                        $first_check='false';
                    if ($row==15) 
                    {
                        if($xf[$row]==$xf[$row-1] || $xf[$row]==$xf[$row-2]) // check the grand-child sheet index value same in parent and child
                            $first_check='false';
                        else
                        {   
                            $first_check='true';
                            $a=$row-2;
                            $b=$row-1;
                            $check_kpi=$objPHPExcel->getActiveSheet()->getCell('A'.$a)->getXfIndex(); 
                            $check_unit=$objPHPExcel->getActiveSheet()->getCell('A'.$b)->getXfIndex(); 
                            $check_sub_unit=$objPHPExcel->getActiveSheet()->getCell('A'.$row)->getXfIndex(); 
                        }
                    }       
                }
                if($first_check=='true') //This block check second kpi to upto last kpi data expand or not 
                {
                    if($row>15)
                    {
                        if($var_check==1) // This block check the child data expand or not
                        {
                            if($check_unit!=$objPHPExcel->getActiveSheet()->getCell('A'.$row)->getXfIndex())
                            {
                                $result[$row]='false';
                                break;
                            }
                        }
                        if($var_check==2) // this block check the grand - child data expand or not
                        {
                            if($check_sub_unit!=$objPHPExcel->getActiveSheet()->getCell('A'.$row)->getXfIndex())
                            {
                                $result[$row]='false';
                                break;                          
                            }
                        }
                        if($xf[$row]!=$check_sub_unit)
                        {
                            if($xf[$row]!=$check_unit)
                                $var_check=1; // var_check value is one, the kpi is present
                            else
                                $var_check=2; // var_check value is two, the unit is present
                        }
                        else
                            $var_check=0; // var_check value is zero, the sub_unit is present
                    }   
                }
                else if($first_check=='false')
                {
                    $result[$row]='false';
                    break;
                }           
            }
            $return='true';
            for ($row = 13; $row <= $highestRow; $row++)
            {
                if(!empty($result[$row]))
                {
                    if($result[$row]=='false'){
                        $return='false';
                        break;
                    }                   
                }
            }
            return $return;
        }

questionAnswers(4)

yourAnswerToTheQuestion