-2

I have been trying to find a way to read data from phpspreadsheet and populate it into a textbox in html using the autocomplete plugin in jquery. I have been trying to do it in codeigniter and I am relatively new to it. Can anyone tell me the steps to go through this process? I

1 Answers1

0

I believe you can do this by having the spreadsheet data loaded on one page and then redirect them to a second page and include the data from the spreadsheet.

This all pseudo-code to show the idea that I'm trying to explain.

function index() {
    use PhpOffice\PhpSpreadsheet\IOFactory;
    use PhpOffice\PhpSpreadsheet\Reader\IReadFilter;
    use PhpOffice\PhpSpreadsheet\Spreadsheet;
    $spreadsheet = IOFactory::load($inputFileName);
    $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, false, true);
    $_SESSION['sheetdata'] = $sheetData;
    redirect('secondpage');
}
function secondpage() {
    $data['sheetdata'] = $_SESSION['sheetdata'];
    // use this for the autocomplete
    // templaste stuff here
}
Johnish
  • 81
  • 6