<?php require_once('../auth/auth.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(
   'group'    => $row[0],
   'category' => $row[1],
   'brand'    => $row[2],
   'name'     => $row[3],
   'code'     => $row[4],
   'qty'      => $row[5],
   'pmrp'     => $row[6],
   'mnrp'     => $row[7],
   'mxrp'     => $row[8],
   'details'  => $row[9],
   'locat'    => $row[10],
   'sku'      => $row[11],
   'utype'    => $row[12],
   'ptax'     => $row[13],
   'stax'     => $row[14],
   'batch'    => $row[15],
   'notice'   => $row[16],
   'weight'   => $row[17],
   'disc'     => $row[18]
  );
 }
 $output = array(
  'column'  => $column,
  'row_data'  => $row_data
 );
 echo json_encode($output);

}
?>
