<?php
    use \koolreport\excel\Table;

    $sheet1 = "Sales by Customer";
?>
<meta charset="UTF-8">

<div sheet-name="<?php echo $sheet1; ?>">
    <?php
    $spreadsheetStyle = [
		'font' => [
			'bold' => false,
			'italic' => true,
			'underline' => false,
			'strikethrough' => true,
			'name' => 'Arial',
			'size' => '14',
			'color' => '808080',
		],
		'border' => [
			// 'color' => '000000',
			'width' => 'thick', //'thin', 'medium', 'thick'
			// 'style' => 'solid', //'none', 'solid', 'dashed', 'dotted', 'double'.
			'top' => [
				'color' => '000000',
				'width' => 'medium', //'thin', 'medium', 'thick'
				'style' => 'solid', //'none', 'solid', 'dashed', 'dotted', 'double'.
			],
			'right' => [],
			'bottom' => [],
			'left' => [],
		],
		'backgroundColor' => '00ff00',
		'wrapText' => true,
	];
    ?>
    <div><strong>
        Appointments Report
    </strong></div>

    <div>
        <?php
        Table::create(array(
            "dataSource" => $this->dataStore('myappts'),
            "removeDuplicate"=>array("name", "concatday"),

                "columns"=>array(
                    "name"=>array(
                    "label"=>"Service Name",
                ),
                "concatday"=>array(
                    "label"=>"Start-date",
                ),
                 "starttimefixed"=>array(
                    "label"=>"Start-time",
                    "type"=>"hh:mm", 
                ),
                "endtimefixed"=>array(
                    "label"=>"End-time",
                    "type"=>"hh:mm", 

                ),
                "first_name"=>array(
                    "label"=>"First Name",
                ),
                "last_name"=>array(
                    "label"=>"Last Name",
                ),
                "email"=>array(
                    "label"=>"Email",
                ),
                "phone_number"=>array(
                    "label"=>"Phone Number",
                ),
                 "address"=>array(
                    "label"=>"Address",
                ),
                 "city"=>array(
                    "label"=>"City",
                ),
                 "zipcode"=>array(
                    "label"=>"Zipcode",
                ),
                "birthdate"=>array(
                    "label"=>"Birthdate",
                ),
                 "concatbookday"=>array(
                    "label"=>"Date booked",
                ),
                 "booktimefixed"=>array(
                    "label"=>"Time booked",
                                        "type"=>"hh:mm", 

                ),
                "usernotes"=>array(
                    "label"=>"Customer Notes",
                ),
                "apptnotes"=>array(
                    "label"=>"Appointments/backend notes",
                ),),
        ));
        ?>
    </div>
    
</div>
