echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
echo $p->t('global/organisationseinheit') . ': <SELECT name="oe_kurzbz">';
echo '<OPTION value="">' . $p->t('global/alle') . '</OPTION>';
foreach ($organisationseinheit->result as $row) {
    if ($oe_kurzbz == $row->oe_kurzbz) {
        $selected = 'selected="selected"';
    } else {
        $selected = '';
    }
    echo '<OPTION value="' . $basis->convert_html_chars($row->oe_kurzbz) . '" ' . $selected . '>';
    echo $basis->convert_html_chars($row->organisationseinheittyp_kurzbz . ' ' . $row->bezeichnung);
    echo '</OPTION>';
}
echo '</SELECT>';
$ampel = new ampel();
$ampel->getAll();
echo ' ' . $p->t('tools/ampel') . ': <SELECT name="ampel_id">';
echo '<OPTION value="">' . $p->t('global/alle') . '</OPTION>';
foreach ($ampel->result as $row) {
    if ($ampel_id == $row->ampel_id) {
        $selected = 'selected="selected"';
    } else {
        $selected = '';
    }
    echo '<OPTION value="' . $basis->convert_html_chars($row->ampel_id) . '" ' . $selected . '>';
    echo $basis->convert_html_chars($row->kurzbz);
    echo '</OPTION>';
}
echo '</SELECT>';
echo '<input type="submit" value="OK" />';
echo '</form><br>';
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 *
 * Authors: Martin Tatzber <*****@*****.**>
 */
require_once '../config/vilesci.config.inc.php';
require_once '../include/basis_db.class.php';
require_once '../include/mail.class.php';
require_once '../include/ampel.class.php';
$db = new basis_db();
$ampel = new ampel();
$ampel->getAll(true);
foreach ($ampel->result as $a) {
    if (!$a->email) {
        continue;
    }
    $qry = $a->benutzer_select;
    $message = $a->beschreibung['German'];
    $subject = $a->kurzbz;
    if ($result = $db->db_query($qry)) {
        while ($row = $db->db_fetch_object($result)) {
            $uid = $row->uid;
            $mail = new mail($uid . '@' . DOMAIN, 'cis@' . DOMAIN, $subject, $message);
            if ($mail->send()) {
                echo "Email an {$uid} versandt\n";
            } else {
                echo "Fehler beim Versenden des Erinnerungsmails an {$uid}\n";
if (isset($_GET['action']) && $_GET['action'] == 'delete') {
    if (!$rechte->isBerechtigt('basis/ampel', null, 'suid')) {
        die('Sie haben keine Berechtigung fuer diese Seite');
    }
    if (!isset($_GET['ampel_id'])) {
        die('Fehlender Parameter Statistik');
    }
    $ampel = new ampel();
    if ($ampel->delete($_GET['ampel_id'])) {
        echo '<span class="ok">Eintrag wurde erfolgreich gelöscht</span>';
    } else {
        echo '<span class="error">' . $ampel->errormsg . '</span>';
    }
}
$ampel = new ampel();
if (!$ampel->getAll()) {
    die($ampel->errormsg);
}
echo '<table class="tablesorter" id="myTable">
	<thead>
		<tr>
			<th>ID</th>
			<th>Kurzbz</th>
			<th>Deadline</th>
			<th>Vorlaufzeit</th>
			<th>Verfallszeit</th>
			<th colspan="3">Aktion</th>
		</tr>
	</thead>
	<tbody>';
foreach ($ampel->result as $row) {