Beispiel #1
0
<?php

include_once 'include/connect.php';
include_once 'class/range.class.php';
include_once 'class/device.class.php';
$results = Range::getAll();
$width = 0;
// Assign value for range
if ($results) {
    $width = (960 - count($results) * 20) / count($results);
}
$smarty->assign('ranges', $results);
$smarty->assign('devices', Device::getAll());
$smarty->assign('width', $width);
$smarty->assign('menu', 1);
$smarty->display('dashboard.tpl');
Beispiel #2
0
<?php

include_once 'class/range.class.php';
include_once 'class/device.class.php';
include_once 'class/payment.class.php';
$ranges = Range::getAll();
$smarty->assign('ranges', $ranges);
$smarty->assign('menu', 2);
// Report
if ($_POST['report']) {
    set_include_path(dirname(dirname(__FILE__)) . '/library/PEAR/');
    include_once 'Spreadsheet/Excel/Writer.php';
    $workbook = new Spreadsheet_Excel_Writer();
    $workbook->setVersion(8);
    $worksheet =& $workbook->addWorksheet('report');
    $worksheet->setInputEncoding('UTF-8');
    $header = $workbook->addFormat();
    $header->setFontFamily('Arial');
    $header->setSize(14);
    $header->setFgColor('blue');
    $header->setBold();
    $header->setHAlign('center');
    $header->setVAlign('center');
    $header->setColor('white');
    $common = $workbook->addFormat();
    $common->setFontFamily('Arial');
    $common->setSize(12);
    $caption = $workbook->addFormat();
    $caption->setFontFamily('Arial');
    $caption->setSize(12);
    $caption->setBorder(1);