<?php

$b = array(
	"1"=>0, "2"=>1, "3"=>2, "4"=>3, "5"=>4, "6"=>5, "7"=>6, "8"=>7, "9"=>8, "10"=>9, "11"=>1, "12"=>1, "13"=>1, "14"=>1, "15"=>14,
	"g1"=>15, "g2"=>16, "g3"=>17, "g4"=>18, "g5"=>19, "g6"=>20, "g7"=>21, "g8"=>22, "g9"=>23, "g10"=>24, "g11"=>25, "g12"=>26, "g13"=>27, "g14"=>28, "g15"=>29);

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

require_once dirname(__FILE__) . '/PHPExcel/IOFactory.php';
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');

if (!file_exists("../templates/excel/Trixell3040_2Boxes_DATUM.xlsx")) { exit("Vorlage nicht gefunden ..." . EOL); }

$objPHPexcel = PHPExcel_IOFactory::load('../templates/excel/Trixell3040_2Boxes_DATUM.xlsx');

$objWorksheet = $objPHPexcel->getActiveSheet();
$objWorksheet->getCell('A3')->setValue('John');
$objWorksheet->getCell('A4')->setValue('Smith');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel, 'Excel5');
$objWriter->save('../templates/excel/test.xls');




#$objPHPExcel = PHPExcel_IOFactory::load("../templates/excel/Trixell3040_2Boxes_DATUM.xlsx");

#$arrayData = array(
#    'part 1',
#    'part 2',
#    'part 3',
#    'part 4',
#    'part 5',
#);


#$objPHPExcel->setActiveSheetIndex(0);
#$objPHPExcel->getActiveSheet()->fromArray($arrayData, NULL, '');

#$objPHPExcel->getActiveSheet()
#	->getCell('e1')
#	->setValue('PHPExcel');

#$objPHPExcel->getActiveSheet()->setCellValue('A3', 'Part 1');
#$objPHPExcel->getActiveSheet()->setCellValue('A4', 'Part 2');
#$objPHPExcel->getActiveSheet()->setCellValue('A5', 'Part 3');
#$objPHPExcel->getActiveSheet()->setCellValue('A6', 'Part 4');
#$objPHPExcel->getActiveSheet()->setCellValue('A7', 'Part 5');
#$objPHPExcel->getActiveSheet()->setCellValue('A8', 'Part 6');
#$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Part 7');
#$objPHPExcel->getActiveSheet()->setCellValue('A10', 'Part 8');
#$objPHPExcel->getActiveSheet()->setCellValue('A11', 'Part 9');

#$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
#$objWriter->setIncludeCharts(TRUE);
#$objWriter->save("../templates/excel/test.xlsx");


?>