';
$mailform_mail = '';
$select_wap_show = '
';
$result = mysql_query("SELECT a.*,
b.adresse, b.formatierung_id, b.bezeichnung, b.rec_typ,
c.bg_farbe, c.text_farbe, c.text_format, c.text_groesse, c.text_groesse_text,
d.org_name, d.org
FROM alarm2mail a
LEFT JOIN ric_zvei b ON b.adresse = a.adresse
LEFT JOIN formatierung c ON c.id = b.formatierung_id
LEFT JOIN organisation d ON d.id = b.org_id
WHERE a.userid = '$_SESSION[userid]' ORDER BY org ASC, org_name ASC, rec_typ ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
// Zeitfunktion
if( $row["time_from"] == '0' && $row["time_to"] == '0' )
{
$zeitfilter = 'immer';
}
else
{
$zeitfilter = time_format( $row["time_from"] ).' bis '.time_format( $row["time_to"] ).' Uhr';
}
if( !empty($row["stiwo"]) ) { $stiwo = "Stiwo"; } else { $stiwo = ""; }
$abos .= '
'.$row["org"].' '.$row["org_name"].' '.$row["bezeichnung"].' - '.$row["rec_typ"].' |
'.$stiwo.' |
'.$zeitfilter.' |
löschen |
';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_profil_alarmmail")."\";");
}
// Ric zum Abo wählen
elseif( $_GET["do"] == 'abodet' )
{
for( $stunde = 0; $stunde <= 24; $stunde++ )
{
$select_time_filter .= '
';
}
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE id = '$_REQUEST[search_ric]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$org_id = $row["id"];
$org = $row["org"];
$org_name = $row["org_name"];
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '$org_id'") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$select_ric .= ' '.$org.' '.$org_name.' '.$row["bezeichnung"].' - '.$row["rec_typ"].'
';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_profil_alarmmail_select")."\";");
}
// Abo eintragen
elseif( $_GET["do"] == 'aboins' )
{
foreach( $_REQUEST["abo_ric"] AS $v )
{
// prüfen ob der User diese Ric bereits Abonniert hat
$result = mysql_query("SELECT id FROM alarm2mail WHERE userid = '$_SESSION[userid]' AND adresse = '$v'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( empty($row["id"]) )
{
$result = mysql_query("INSERT INTO alarm2mail (adresse, userid, time_from, time_to, stiwo) VALUES ('$v', '$_SESSION[userid]', '$_REQUEST[alarm_time_filter_from]', '$_REQUEST[alarm_time_filter_to]', '$_REQUEST[alarm_stiwo]')") or die(mysql_error());
}
}
echo gohome($_SERVER["PHP_SELF"]);
}
// Abo löschen
elseif( $_GET["do"] == 'abodel' )
{
$result = mysql_query("DELETE FROM alarm2mail WHERE id = '$_GET[id]' AND userid = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
// Alarmmail Form setzen
elseif( $_GET["do"] == 'setmailform' )
{
if( $_REQUEST["mail2sms"] == 1 ) { $setto = 1; } else { $setto = 0; }
$result = mysql_query("UPDATE admin_users SET a_alarmmail2sms='$setto', a_alarmmail='$_REQUEST[alarmmail]' WHERE id = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
// Wap Einstellungen speichern
elseif( $_GET["do"] == 'setwap' )
{
$result = mysql_query("UPDATE admin_users SET wap_show='$_REQUEST[wap_show]', wap_rows='$_REQUEST[wap_rows]', wap_pass='$_REQUEST[wap_pass]', wap_def_orgfilter='$_REQUEST[wap_orgfilter]', wap_def_statfilter='$_REQUEST[wap_statfilter]' WHERE id = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
/**************************/
// Ausgabe Rahmen
//
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
?>