84 lines
2.4 KiB
PHP
84 lines
2.4 KiB
PHP
<?php
|
|
if(!isset($_SESSION)) { session_start(); }
|
|
include_once '../classes/TestProjektSmarty.class_subdir.php';
|
|
require_once("../config.inc.php");
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
|
$smarty = new SmartyAdmin();
|
|
require_once("../language/german.inc.php");
|
|
require_once("../config/func_cryption.php");
|
|
|
|
if (isset($_GET['action'])) {
|
|
$action = $_GET['action'];
|
|
} else {
|
|
$action = '';
|
|
}
|
|
|
|
|
|
if ($action == '') {
|
|
|
|
$query1 = "SELECT pid, beschreibung, wert
|
|
FROM bpm_parameter
|
|
ORDER BY sort ASC";
|
|
|
|
$result1 = $db->query($query1) or die("Cannot execute query1");
|
|
|
|
$result_ct = $db->query("SELECT count(*) Anz FROM bpm_tanpool where verw_dat = '0000-00-00 00:00:00'");
|
|
$row_ct = $result_ct->fetch_array();
|
|
$smarty->assign('parameter_anzahltan', "$row_ct[Anz]");
|
|
|
|
while ($row1 = $result1->fetch_array()) {
|
|
# Passwort für die Praxisstellen wird verschlüsselt gespeichert
|
|
|
|
if(!isset($zaehler) or $zaehler == 1){
|
|
$zaehler = 0;
|
|
}else{
|
|
$zaehler = 1;
|
|
}
|
|
$row1['zaehler'] = $zaehler;
|
|
$table_data1[] = $row1;
|
|
}
|
|
|
|
$smarty->assign('table_data1', $table_data1);
|
|
}
|
|
|
|
if($action == 'save'){
|
|
|
|
|
|
$query2 = "SELECT pid
|
|
FROM bpm_parameter
|
|
ORDER BY pid ASC";
|
|
$result2 = $db->query( $query2)
|
|
or die ("Cannot execute query2");
|
|
|
|
while ($row2 = $result2->fetch_array()){
|
|
$pid = $row2['pid'];
|
|
$pid_value = $_POST[$pid];
|
|
|
|
|
|
$sql1 = $db->query( "UPDATE bpm_parameter
|
|
SET wert = '$pid_value'
|
|
WHERE pid = $pid
|
|
" );
|
|
|
|
}
|
|
|
|
if(!$sql1){
|
|
$error = TRUE;
|
|
$error_reason .= "Fehler beim Update [bpm_parameter]<br>";
|
|
}else{
|
|
$error = FALSE;
|
|
$smarty->assign('parameter_inserterr', "2");
|
|
echo "<meta http-equiv=\"refresh\" content=\"2; URL=".$_SERVER['PHP_SELF'] ."?\">";
|
|
}
|
|
|
|
if($error){
|
|
$smarty->assign('parameter_inserterr', "1");
|
|
$smarty->assign('parameter_reason', "$error_reason"); // Kein Mailversand
|
|
} // Ende IF : Insert hat geklappt
|
|
|
|
}
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/admin/$templatename");
|
|
|
|
?>
|