Exemple #1
0
            // Form element
            $optionValue = getOption('loadSheet', $tSheets[0]);
            print formElement(formLabel('loadSheet', 'Excel sheet'), formSelect('loadSheet', $optionValue, $sheets));
            // Apply sheet
            $loadSheet = $optionValue;
            $reader->setOption('loadSheet', $optionValue);
            break;
    }
}
function getOption($name, $default = null)
{
    global $sessionOptions;
    return array_key_exists($name, $sessionOptions) ? $sessionOptions[$name] : $default;
}
print formElement('', formSubmit('filter', 'Save options'));
print formEnd();
########################################################################################################################
## Print Excel sheet ###################################################################################################
########################################################################################################################
echo '<h2>Preview</h2>';
$workbook = $reader->load($excelFile);
$sheet = $workbook->getSheet($loadSheet);
print '<table border="1" cellpadding="1" cellspacing="0">';
for ($row = 0; $row < min(10, $sheet->getNumRows()); $row++) {
    print '<tr>';
    for ($col = 0; $col < $sheet->getNumColumns(); $col++) {
        print '<td>' . $sheet->getCellValue($row, $col) . '</td>';
    }
    print '</tr>';
}
print '</table>';
        border: dotted;
    }
</style>
</head>


<?php 
htmlBodyStart();
formStart();
getTextField();
echo getTextFieldV1('First Name', 'fname');
echo getTextFieldV1('Last Name', 'lname');
echo getTextFieldV2('Phone 1', 'phone1', 'cssClassA');
echo getTextFieldV3('Phone 2', 'phone2');
echo getTextFieldV3('City', 'city', 'cssClassA');
formEnd();
htmlBodyEnd();
htmlEnd();
function htmlStart()
{
    echo "<html>";
}
function htmlEnd()
{
    echo "</html>";
}
function htmlBodyStart()
{
    echo "<body>";
}
function htmlBodyEnd()