<?php require_once('../auth/auth.php');require_once('../auth/function.php'); ?>
<?php
if(!empty($_FILES['csv_file']['name']))
{
 $file_data = fopen($_FILES['csv_file']['tmp_name'], 'r');
 $column = fgetcsv($file_data);
 while($row = fgetcsv($file_data))
 {
  $row_data[] = array(
   'outlet_id'  => $row[0],
   'ac_name'  => $row[1],
   'ac_display'  => $row[2],
   'ac_number'  => $row[3],
   'ac_address'  => $row[4],
   'ac_route'  => $row[5],
   'ac_balance'  => $row[6],
   'ac_nid'  => $row[7],
   'ac_genarel'  => $row[8],
   'invoice'  => invoice("OP")
  );
 }
 $output = array(
  'column'  => $column,
  'row_data'  => $row_data
 );
 echo json_encode($output);

}
?>
