PHP Classes

File: demo.php

Recommend this page to a friend!
  Classes of Skrol29   TinyButStrong plug-in for Excel   demo.php   Download  
File: demo.php
Role: Example script
Content type: text/plain
Description: example and test - main script
Class: TinyButStrong plug-in for Excel
Generate Excel spreadsheets using template plug-in
Author: By
Last change: new version of the plug-in
Date: 13 years ago
Size: 912 bytes
 

Contents

Class file image Download
<?php

if (count($_GET)==0) {
   
header('Location: demo_main.htm');
    exit;
}

// load the TinyButStrong library
if (version_compare(PHP_VERSION,'5')<0) {
    include_once(
'tbs_class.php'); // TinyButStrong template engine for PHP 4
} else {
    include_once(
'tbs_class_php5.php'); // TinyButStrong template engine
}

// Excel plug-in for TBS
include('tbs_plugin_excel.php');

include(
'demo_data.php'); // Data stored in arrays

$TBS = new clsTinyButStrong;

// Install the Excel plug-in (must be before LoadTemplate)
$TBS->PlugIn(TBS_INSTALL, TBS_EXCEL);

// Load the Excel template
$TBS->LoadTemplate('demo_template.xml');

// Merge Example 1 (in sheet #1)
$TBS->MergeBlock('book',$books);

// Merge Example 2 (in sheet #2)
$TBS->MergeBlock('tsk1,tsk2',$tasks);
$TBS->MergeBlock('emp',$employees);

// Final merge and download file
$TBS->Show(TBS_EXCEL_DOWNLOAD, 'result.xml');

?>