function doExport($table, $mode)
{
    global $REX, $REX_USER, $XLS_TABLES, $XLS_MODES;
    $Basedir = dirname(__FILE__);
    require_once $Basedir . '/../libs/Spreadsheet_Excel_Writer-0.8/Writer.php';
    if (array_key_exists($table, $XLS_TABLES) && array_key_exists($mode, $XLS_MODES)) {
        $createstamp = time();
        $oTable = new ExportTable($table);
        if ($mode == 'all') {
            $result = $oTable->getAll();
        } else {
            if ($mode == 'new') {
                $result = $oTable->getNew();
            }
        }
        if (mysql_error() == '') {
            rs2xls(xlsLocation($table, $createstamp), xlsFilename($tables[$table], $createstamp), $result);
            $values = array(0, $table, mysql_num_rows($result), $REX_USER->getValue('login'), $createstamp);
            $set = '';
            $first = true;
            foreach ($values as $value) {
                if ($first) {
                    $first = false;
                } else {
                    $set .= ', ';
                }
                if (is_string($value)) {
                    $set .= '"' . mysql_escape_string($value) . '"';
                } else {
                    $set .= $value;
                }
            }
            $sql = new CompatSql();
            $qry = 'INSERT INTO ' . TBL_EXCEL_EXPORT . ' VALUES (' . $set . ')';
            $sql->setQuery($qry);
        } else {
            echo 'Fehler beim ausführen der Abfrage!';
        }
    }
}
Beispiel #2
0
       <col width="*"/>
       <col width="50px"/>
       <col width="50px"/>
       <col width="120px"/>
       <col width="250px"/>
    </colgroup>
    <tr>
      <th>Tabelle</th>
      <th>Anzahl</th>
      <th>Neue</th>
      <th>Letzter Export</th>
      <th>Aktion</th>
    </tr>  
    <?php 
foreach ($XLS_TABLES as $table => $label) {
    $oTable = new ExportTable($table);
    ?>
    <tr>
      <td><?php 
    echo $label;
    ?>
</td>
      <td>
        <?php 
    echo $numAll = $oTable->numAll();
    ?>
      </td>
      <td>
        <?php 
    echo $numNew = $oTable->numNew();
    ?>
<?php

require_once '../include/export_class.php';
include '../include/connect.php';
$object = new ExportTable();
$object->loadContent($_POST['nr'], isset($_POST['table']) ? $_POST['table'] : '', isset($_POST['filename']) ? $_POST['filename'] : '', isset($_POST['type']) ? $_POST['type'] : '', isset($_POST['columns']) ? $_POST['columns'] : '');