<?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 Masuk');
$worksheet->SetCellValue('C1', 'Tanggal Masuk');
$worksheet->SetCellValue('D1', 'No Aju');
$worksheet->SetCellValue('E1', 'Tanggal Aju');
$worksheet->SetCellValue('F1', 'Nama Pemasok');
$worksheet->SetCellValue('G1', 'Jenis Dokumen');
$worksheet->SetCellValue('H1', 'Nomor Dokumen');
$worksheet->SetCellValue('I1', 'Tanggal Dokumen');
$worksheet->SetCellValue('J1', 'Nomor Invoice');
$worksheet->SetCellValue('K1', 'Tanggal Invoice');
$worksheet->SetCellValue('L1', 'Nomor SPPB');
$worksheet->SetCellValue('M1', 'Tanggal SPPB');
$worksheet->SetCellValue('N1', 'Kode Barang');
$worksheet->SetCellValue('O1', 'Nama Barang');
$worksheet->SetCellValue('P1', 'Satuan Barang');
$worksheet->SetCellValue('Q1', 'Jumlah');
$worksheet->SetCellValue('R1', 'Nilai Non IDR');
$worksheet->SetCellValue('S1', 'Nilai IDR');
$worksheet->SetCellValue('T1', 'Valuta');
$worksheet->SetCellValue('U1', 'Berat');
$worksheet->SetCellValue('V1', 'Nomor Urut');
$worksheet->SetCellValue('W1', 'Tujuan');
$worksheet->SetCellValue('X1', 'No Kontrak');
$worksheet->SetCellValue('Y1', 'Tgl Kontrak');
$worksheet->SetCellValue('Z1', 'Tipe/Style');
$worksheet->SetCellValue('AA1', 'Ukuran Barang');
$worksheet->SetCellValue('AB1', 'No Dokumen Asal BC 2.6.2');
$worksheet->SetCellValue('AC1', 'Tanggal Dokumen Asal BC 2.6.2');
$worksheet->SetCellValue('AD1', 'No Kontainer');
$worksheet->SetCellValue('AE1', 'Tipe Kontainer');
$worksheet->SetCellValue('AF1', 'Ukuran Kontainer');

$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 Pemasok');
$worksheet->SetCellValue('G2', 'format: BC 2.3, BC 2.6.2, BC 2.7, BC 4.0 ');
$worksheet->SetCellValue('H2', 'format : 6 digit');
$worksheet->SetCellValue('I2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('J2', 'nomor invoice');
$worksheet->SetCellValue('K2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('L2', 'format : 6 digit');
$worksheet->SetCellValue('M2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('N2', 'Kode Barang');
$worksheet->SetCellValue('O2', 'Nama Barang');
$worksheet->SetCellValue('P2', 'Satuan Barang');
$worksheet->SetCellValue('Q2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('R2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('S2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('T2', 'Valuta : USD, IDR');
$worksheet->SetCellValue('U2', 'format number, misal : 1000.00');
$worksheet->SetCellValue('V2', 'Nomor Urut..1,2,3...');
$worksheet->SetCellValue('W2', 'Kawasan BerikatGudang Berikat/Diperbaiki...dll');
$worksheet->SetCellValue('X2', 'Nomor Kontrak');
$worksheet->SetCellValue('Y2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('Z2', 'Tipe barang');
$worksheet->SetCellValue('AA2', 'Ukuran Barang');
$worksheet->SetCellValue('AB2', 'format : 6 digit');
$worksheet->SetCellValue('AC2', 'format : yyyy-mm-dd');
$worksheet->SetCellValue('AD2', 'Nomor Kontainer');
$worksheet->SetCellValue('AE2', 'Tipe Kontainer');
$worksheet->SetCellValue('AF2', 'Ukuran Kontainer');

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