function &setAmberConfig()
 {
     $cfgFileName = '../conf/localconf.xml';
     if (!file_exists($cfgFileName)) {
         Amber::showError('Error: localconf.xml does not exist', 'Amber needs to be configured before you can use it. <br>Use the <a href="../Amber/install/index.php" target="_blank">install tool</a> to set up the database connection.');
     }
     $cfg = new AmberConfig();
     $cfg->fromXML($cfgFileName);
     setlocale(LC_CTYPE, 'de_DE', 'de_DE@euro');
     setlocale(LC_TIME, 'de_DE', 'de_DE@euro');
     // needed for date, time
     setlocale(LC_MONETARY, 'de_DE', 'de_DE@euro');
     // needed for numbers
     return Amber::getInstance($cfg);
 }
Example #2
0
    if (!$cfg->toXML($filename)) {
        echo formatMessage('Unable to update localconf.xml<p />' . htmlentities($filename) . ' needs to be writeable.');
    } else {
        echo formatMessage('Configuraton successfully written to:<p />' . htmlentities($filename));
    }
}
if (isset($_POST['doImport'])) {
    if (!file_exists($filename)) {
        echo formatMessage('You need to create a localconf.xml before attempting to import the sample database.');
    } else {
        $cfg->fromXML($filename);
        doImport($cfg);
    }
}
// Re-read for display
$cfg = new AmberConfig();
if (file_exists($filename)) {
    $cfg->fromXML($filename);
}
$dbcfg = $cfg->get('db');
$syscfg = $cfg->get('sys');
?>

<p />

<form method="post" action="<?php 
echo $__SELF__;
?>
">

Example #3
0
    $type = $_GET['export'];
} else {
    $type = 'html';
    // for a list of possible values see ExporterFactory.php and corresponding include files
}
$mode = 'normal';
if (isset($_GET['mode'])) {
    $mode = $_GET['mode'];
    // 'design' or 'normal'
}
$cfgFileName = '../Amber/conf/localconf.xml';
if (!file_exists($cfgFileName)) {
    Amber::showError('Error: localconf.xml does not exist', 'Amber needs to be configured before you can use it. <br>Use the <a href="../Amber/install/index.php" target="_blank">install tool</a> to set up the database connection.');
    die;
}
$cfg = new AmberConfig();
$cfg->fromXML($cfgFileName);
setlocale(LC_CTYPE, 'de_DE', 'de_DE@euro');
setlocale(LC_TIME, 'de_DE', 'de_DE@euro');
// needed for date, time
setlocale(LC_MONETARY, 'de_DE', 'de_DE@euro');
// needed for numbers
//setlocale (LC_ALL, 'de_DE', 'de_DE@euro');
if (isset($_GET['filter'])) {
    $filter = $_GET['filter'];
}
$amber =& Amber::getInstance($cfg);
if ($mode == 'normal') {
    $amber->OpenReport($repName, AC_NORMAL, $filter, $type);
} else {
    $amber->OpenReport($repName, AC_DESIGN, $filter, $type);