133 lines
4.4 KiB
PHP
Executable File
133 lines
4.4 KiB
PHP
Executable File
<?php
|
|
header("Expires: Mon, 12 Jul 1995 05:00:00 GMT");
|
|
header("Last-Modified: " . gmdate("D, d M Y H.i:s") . " GMT");
|
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
header("Pragma: no-cache");
|
|
$verz = "upload/"; // relatives Uploadverzeichnis (relativ zum 'Spassworddort' dieser Datei, wohin die Dateien kopiert werden sollen
|
|
|
|
## INDEX gegen DB
|
|
session_start();
|
|
|
|
include_once '../classes/TestProjektSmarty.class_subdir.php';
|
|
require_once("../config.inc.php");
|
|
require_once("../config/datenbankanbindung.php");
|
|
require_once("../func_get_parameter.php");
|
|
require_once("../config/func_cryption.php");
|
|
$smarty = new SmartyAdmin();
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html";
|
|
require_once "../language/german.inc.php";
|
|
|
|
$action = $_GET['action'];
|
|
if ($action == '') {
|
|
|
|
|
|
$dst_id = $_SESSION["prx_dst_id"];
|
|
|
|
# Gespeicherte Werte
|
|
# Persönliche Angaben
|
|
$result = $db->query("SELECT bezeichnung, name, str, plz, ort, tel, internet, mail
|
|
FROM dvm_dienststellen
|
|
WHERE dst_id = '$dst_id'
|
|
LIMIT 1");
|
|
$row = @$result->fetch_array();
|
|
|
|
$smarty->assign('dst_bezeichnung', $row['bezeichnung']);
|
|
$smarty->assign('dst_name', $row['name']);
|
|
$smarty->assign('dst_str', $row['str']);
|
|
$smarty->assign('dst_plz', $row['plz']);
|
|
$smarty->assign('dst_ort', $row['ort']);
|
|
$smarty->assign('dst_mail', $row['mail']);
|
|
|
|
# -- Fehlermeldungen -- #
|
|
if (isset($_GET['error'])) {
|
|
|
|
$errorno = $_GET['error'];
|
|
|
|
$smarty->assign('dst_error', 1);
|
|
|
|
$smarty->assign('dst_bezeichnung', $_SESSION["dst_bezeichnung"]);
|
|
$smarty->assign('dst_name', $_SESSION["dst_name"]);
|
|
$smarty->assign('dst_str', $_SESSION["dst_str"]);
|
|
$smarty->assign('dst_plz', $_SESSION["dst_plz"]);
|
|
$smarty->assign('dst_ort', $_SESSION["dst_ort"]);
|
|
$smarty->assign('dst_mail', $_SESSION["dst_mail"]);
|
|
$smarty->assign('dst_pwd', $_SESSION["dst_pwd"]);
|
|
$smarty->assign('dst_pwd_wied', $_SESSION["dst_pwd_wied"]);
|
|
|
|
if ($errorno == 1) {
|
|
# ungültiges Datum
|
|
$smarty->assign('dst_error_text', "Es müssen alle Felder ausgefüllt werden!");
|
|
}
|
|
if ($errorno == 2) {
|
|
# ungültiges Datum
|
|
$smarty->assign('dst_error_text', "Das eingegebene Passwort stimmt nicht mit der Passwortwiederholung überein!");
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if ($action == 'save') {
|
|
|
|
$art = $_POST['art'];
|
|
$name = $_POST['name'];
|
|
$str = $_POST['str'];
|
|
$plz = $_POST['plz'];
|
|
$ort = $_POST['ort'];
|
|
$mail = $_POST['mail'];
|
|
$pwd = $_POST['pwd_prx'];
|
|
$pwd_wied = $_POST['pwd_prx_wied'];
|
|
$bez = $art." ".$name;
|
|
$dst_id = $_SESSION["prx_dst_id"];
|
|
|
|
|
|
$_SESSION["dst_bezeichnung"] = $art;
|
|
$_SESSION["dst_name"] = $name;
|
|
$_SESSION["dst_str"] = $str;
|
|
$_SESSION["dst_plz"] = $plz;
|
|
$_SESSION["dst_ort"] = $ort;
|
|
$_SESSION["dst_mail"] = $mail;
|
|
$_SESSION["dst_pwd"] = $pwd;
|
|
$_SESSION["dst_pwd_wied"] = $pwd_wied;
|
|
|
|
|
|
if($art == '' or $name == '' or $str == '' or $plz == '' or $ort == '' or $mail == ''){
|
|
echo "<meta http-equiv=\"refresh\" content=\"0; URL=" . $_SERVER['PHP_SELF'] . "?&error=1\">";
|
|
exit;
|
|
}
|
|
if($pwd != ''){
|
|
if($pwd != $pwd_wied){
|
|
echo "<meta http-equiv=\"refresh\" content=\"0; URL=" . $_SERVER['PHP_SELF'] . "?&error=2\">";
|
|
exit;
|
|
}
|
|
$pwd_md5 = md5($pwd);
|
|
}else{
|
|
# Passwort holen und unverändert lassen
|
|
$result = $db->query("SELECT pwd
|
|
FROM dvm_dienststellen
|
|
WHERE dst_id = '$dst_id'
|
|
LIMIT 1");
|
|
$row = @$result->fetch_array();
|
|
$pwd_md5 = $row['pwd'];
|
|
}
|
|
|
|
$result = $db->query("UPDATE dvm_dienststellen
|
|
SET bezeichnung = '$art'
|
|
, name = '$name'
|
|
, bez = '$bez'
|
|
, str = '$str'
|
|
, plz = '$plz'
|
|
, ort = '$ort'
|
|
, mail = '$mail'
|
|
, pwd = '$pwd_md5'
|
|
WHERE dst_id = $dst_id
|
|
");
|
|
echo "<meta http-equiv=\"refresh\" content=\"1; URL=" . $_SERVER['PHP_SELF'] . "?\">";
|
|
}
|
|
|
|
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/praxisstelle/$templatename");
|
|
?>
|