<?php

ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);

header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="item_upload_template.csv"');

$output = fopen("php://output", "w");

fputcsv($output, [
'category',
'item_type',
'product_name',
'brand',
'model',
'sku',
'cost_price',
'selling_price',
'description',
'track_inventory',
'stock_qty'
]);

fputcsv($output, [
'Electricity Meters',
'PRODUCT',
'Hexing HXE330',
'Hexing',
'HXE330',
'HXE330',
'1200',
'1900',
'3 Phase Prepaid Meter',
'1',
'25'
]);

fputcsv($output, [
'Services',
'SERVICE',
'Meter Installation',
'',
'',
'INSTALL-001',
'0',
'950',
'Standard installation service',
'0',
'0'
]);

fclose($output);
exit;