<?php
/** Error reporting */
error_reporting(E_ALL);
 
/** Include path **/
ini_set('include_path', ini_get('include_path').';../Classes/');
 
/** PHPExcel */
include '../../function/PHPExcel.php';
 
/** PHPExcel_Writer_Excel2007 */
include '../../function/PHPExcel/Writer/Excel2007.php';
 
$excel = new PHPExcel();
$excel->setActiveSheetIndex(0);
$worksheet = $excel->getActiveSheet();
 
$worksheet->SetCellValue('A1', 'No');
$worksheet->SetCellValue('B1', 'Nomor Surat Jalan');
$worksheet->SetCellValue('C1', 'Tanggal Surat Jalan');
$worksheet->SetCellValue('D1', 'No Aju');
$worksheet->SetCellValue('E1', 'Tanggal Aju');
$worksheet->SetCellValue('F1', 'Nama Penerima');
$worksheet->SetCellValue('G1', 'Jenis Dokumen');
$worksheet->SetCellValue('H1', 'Nomor Dokumen');
$worksheet->SetCellValue('I1', 'Tanggal Dokumen');
$worksheet->SetCellValue('J1', 'Nomor NPE');
$worksheet->SetCellValue('K1', 'Tanggal NPE');
$worksheet->SetCellValue('L1', 'Nomor Invoice');
$worksheet->SetCellValue('M1', 'Tanggal Invoice');
$worksheet->SetCellValue('N1', 'Nomor Faktur');
$worksheet->SetCellValue('O1', 'Kode Barang');
$worksheet->SetCellValue('P1', 'Nama Barang');
$worksheet->SetCellValue('Q1', 'Satuan Barang');
$worksheet->SetCellValue('R1', 'Jumlah');
$worksheet->SetCellValue('S1', 'Nilai Non IDR');
$worksheet->SetCellValue('T1', 'Nilai IDR');
$worksheet->SetCellValue('U1', 'Valuta');
$worksheet->SetCellValue('V1', 'Berat');
$worksheet->SetCellValue('W1', 'Nomor Urut');
$worksheet->SetCellValue('X1', 'Tujuan');
$worksheet->SetCellValue('Y1', 'No Kontrak');
$worksheet->SetCellValue('Z1', 'Tgl Kontrak');
$worksheet->SetCellValue('AA1', 'Tipe/Style');
$worksheet->SetCellValue('AB1', 'Ukuran Barang');
$worksheet->SetCellValue('AC1', 'No House BL');
$worksheet->SetCellValue('AD1', 'No Master BL');
$worksheet->SetCellValue('AE1', 'No Container');
$worksheet->SetCellValue('AF1', 'POS');
$worksheet->SetCellValue('AG1', 'No Manifes');
$worksheet->SetCellValue('AH1', 'Tgl Manifes');
$worksheet->SetCellValue('AI1', 'Pelabuhan');
$worksheet->SetCellValue('AJ1', 'Jumlah Kemasan');
$worksheet->SetCellValue('AK1', 'Harga Maklon');
$worksheet->SetCellValue('AL1', 'Harga FOB');
$worksheet->SetCellValue('AM1', 'Tipe Dokumen');

$worksheet->SetCellValue('A2', 'nomor baris....1,2,3...dst');
$worksheet->SetCellValue('B2', 'Nomor Surat Jalan');
$worksheet->SetCellValue('C2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('D2', 'format : 6 digit');
$worksheet->SetCellValue('E2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('F2', 'Nama Penerima');
$worksheet->SetCellValue('G2', 'format: BC 2.5, BC 2.6.1, BC 2.7, BC 3.0, BC 4.1');
$worksheet->SetCellValue('H2', 'format : 6 digit');
$worksheet->SetCellValue('I2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('J2', 'format : 6 digit');
$worksheet->SetCellValue('K2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('L2', 'no invoice');
$worksheet->SetCellValue('M2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('N2', 'no faktur');
$worksheet->SetCellValue('O2', 'Kode Barang');
$worksheet->SetCellValue('P2', 'nama Barang');
$worksheet->SetCellValue('Q2', 'satuan Barang');
$worksheet->SetCellValue('R2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('S2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('T2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('U2', 'Valuta: USD, IDR');
$worksheet->SetCellValue('V2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('W2', 'Nomor Urut..1,2,3...');
$worksheet->SetCellValue('X2', 'Kawasan Berikat/Gudang Berikat/Dipinjamkan...dll');
$worksheet->SetCellValue('Y2', 'Nomor Kontrak');
$worksheet->SetCellValue('Z2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('AA2', 'Tipe barang');
$worksheet->SetCellValue('AB2', 'Ukuran Barang');
$worksheet->SetCellValue('AC2', 'No House BL : BC 3.0');
$worksheet->SetCellValue('AD2', 'No Master BL : BC 3.0');
$worksheet->SetCellValue('AE2', 'No Container : BC 3.0');
$worksheet->SetCellValue('AF2', 'POS : BC 3.0');
$worksheet->SetCellValue('AG2', 'No Manifes : BC 3.0');
$worksheet->SetCellValue('AH2', 'Tgl Manifes : BC 3.0 : format : yyyy-mm-dd');
$worksheet->SetCellValue('AI2', 'Pelabuhan : BC 3.0');
$worksheet->SetCellValue('AJ2', 'Jumlah Kemasan : BC 3.0');
$worksheet->SetCellValue('AK2', 'Harga Maklon : format number, misal : 1000.00');
$worksheet->SetCellValue('AL2', 'Harga FOB : format number, misal : 1000.00');
$worksheet->SetCellValue('AM2', 'MAKLON/FOB');

$objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="template_upload_pengeluaran"'.date("dmyHis").'".xls"');
header('Cache-Control: max-age=0');
$objWriter->save('php://output');
$excel->disconnectWorksheets();
unset($excel); 
?>