first commit
This commit is contained in:
116
edit_administratoren.php
Executable file
116
edit_administratoren.php
Executable file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
include_once 'classes/TestProjektSmarty.class.php';
|
||||
require_once("config.inc.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
$smarty = new Smarty();
|
||||
require_once "language/german.inc.php";
|
||||
|
||||
require_once("func_mail_einstell.php");
|
||||
|
||||
$action = $_GET['action'];
|
||||
if(isset($_GET['id'])){
|
||||
$_SESSION["status_id"] = $_GET['id'];
|
||||
}
|
||||
$status = $_SESSION["status_id"];
|
||||
|
||||
|
||||
if($action == ''){
|
||||
|
||||
# Verfügbare Administratoren
|
||||
$query1 = "SELECT imtuid, vorname, nachname
|
||||
FROM imt_user
|
||||
WHERE imtuid not in (select imtuid from imt_rollen_user_zuord where roid in(1))
|
||||
";
|
||||
|
||||
$result1 = $db->query ($query1)
|
||||
or die ("Cannot execute query1");
|
||||
|
||||
$table_data1 = array();
|
||||
|
||||
while ($row1 = $result1->fetch_array()){
|
||||
|
||||
array_push($table_data1, array(
|
||||
'imtuid' => $row1['imtuid'],
|
||||
'vorname' => $row1['vorname'],
|
||||
'nachname' => $row1['nachname']
|
||||
)
|
||||
);
|
||||
}
|
||||
$smarty->assign('table_data1', $table_data1);
|
||||
|
||||
|
||||
# Alle Administratoren
|
||||
$query2 = "SELECT a.imtuid, vorname, nachname
|
||||
FROM imt_user a, imt_rollen_user_zuord b
|
||||
WHERE a.imtuid=b.imtuid
|
||||
AND b.roid=1";
|
||||
|
||||
$result2 = $db->query ($query2)
|
||||
or die ("Cannot execute query2");
|
||||
|
||||
$table_data2 = array();
|
||||
|
||||
while ($row2 = $result2->fetch_array()){
|
||||
|
||||
array_push($table_data2, array(
|
||||
'imtuid' => $row2['imtuid'],
|
||||
'vorname' => $row2['vorname'],
|
||||
'nachname' => $row2['nachname']
|
||||
)
|
||||
);
|
||||
}
|
||||
$smarty->assign('table_data2', $table_data2);
|
||||
|
||||
}
|
||||
|
||||
if($action == 'step2'){
|
||||
|
||||
|
||||
# Ausschussmitglied bzw Vertreter, je nachdem ob Häkchen gesetzt wurde
|
||||
if(isset($_POST["mitglied"])){
|
||||
$mitglied = $_POST["mitglied"];
|
||||
}
|
||||
|
||||
|
||||
# Wenn ein Mitglied ausgewählt wurde
|
||||
if(isset($mitglied)){
|
||||
|
||||
$db = dbconnect();
|
||||
$sql1 = $db->query("INSERT INTO imt_rollen_user_zuord ( roid
|
||||
, imtuid
|
||||
)
|
||||
VALUES
|
||||
( '1'
|
||||
, '$mitglied'
|
||||
)
|
||||
");
|
||||
|
||||
|
||||
}
|
||||
echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF']."\">";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($action == 'step3'){
|
||||
$rolle = $_GET['rolle'];
|
||||
$imtuid = $_GET['imtuid'];
|
||||
|
||||
# Wenn ein Ausschussmitglied gelöscht wird
|
||||
# Dann auch den Vertreter
|
||||
if($rolle == 1){
|
||||
|
||||
$db = dbconnect();
|
||||
$del1 = $db->query("DELETE FROM imt_rollen_user_zuord WHERE imtuid = $imtuid AND roid=1");
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF']."\">";
|
||||
|
||||
}
|
||||
|
||||
$smarty->assign('action', "$action");
|
||||
$smarty->display("$template/$templatename");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user