Dashboard weiter ausgebaut
This commit is contained in:
82
dashboard/parameter.php
Normal file
82
dashboard/parameter.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
if(!isset($_SESSION)) { session_start(); }
|
||||
|
||||
include_once '../classes/TestProjektSmarty.class_subdir.php';
|
||||
require_once("../config.inc.php");
|
||||
$smarty = new SmartyAdmin();
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html";
|
||||
require_once "../language/german.inc.php";
|
||||
|
||||
|
||||
if (isset($_GET['action'])) {
|
||||
$action = $_GET['action'];
|
||||
} else {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$query1 = "SELECT pid, beschreibung, wert
|
||||
FROM jumi_parameter
|
||||
ORDER BY sort ASC";
|
||||
|
||||
$result1 = $db->query($query1) or die("Cannot execute query1");
|
||||
|
||||
|
||||
while ($row1 = $result1->fetch_array()) {
|
||||
# Passwort f<>r die Praxisstellen wird verschl<68>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 jumi_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 jumi_parameter
|
||||
SET wert = '$pid_value'
|
||||
WHERE pid = $pid
|
||||
" );
|
||||
|
||||
}
|
||||
|
||||
if(!$sql1){
|
||||
$error = TRUE;
|
||||
$error_reason .= "Fehler beim Update [jumi_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/dashboard/$templatename");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user