ideenmanagement/menu_admin.php
2023-03-14 08:08:06 +01:00

137 lines
3.8 KiB
PHP
Executable File

<?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";
$action = $_GET['action'];
if($action == ''){
$db = dbconnect();
$result_bearb = $db->query("SELECT count(*) Anz
FROM imt_rollen_user_zuord a, imt_rolle b, imt_rollen_rechte_zuord c, imt_rechte d
WHERE a.roid=b.roid
AND b.roid=c.roid
AND c.reid=d.reid
AND a.imtuid = '$uid'
AND d.bereich='ADB'");
$row_bearb = $result_bearb->fetch_array();
if($row_bearb['Anz'] > 0){
$smarty->assign('menu_admin_bearb', "1");
}
$query = "SELECT beschreibung, dateiname, target
FROM imt_rollen_user_zuord a, imt_rolle b, imt_rollen_rechte_zuord c, imt_rechte d
WHERE a.roid=b.roid
AND b.roid=c.roid
AND c.reid=d.reid
AND a.imtuid = '$uid'
AND d.bereich='ADB'
ORDER BY sort_order ASC";
$result = $db->query ($query)
or die ("Cannot execute query");
$table_data1 = array();
while ($row = $result->fetch_array()){
array_push($table_data1, array(
'beschreibung' => $row['beschreibung'],
'dateiname' => $row['dateiname'],
'target' => $row['target']
)
);
}
$smarty->assign('table_data1', $table_data1);
$query2 = "SELECT beschreibung, dateiname, target
FROM imt_rollen_user_zuord a, imt_rolle b, imt_rollen_rechte_zuord c, imt_rechte d
WHERE a.roid=b.roid
AND b.roid=c.roid
AND c.reid=d.reid
AND a.imtuid = '$uid'
AND d.bereich='ADS'
ORDER BY sort_order ASC";
$result2 = $db->query ($query2)
or die ("Cannot execute query2");
$table_data2 = array();
while ($row2 = $result2->fetch_array()){
array_push($table_data2, array(
'beschreibung' => $row2['beschreibung'],
'dateiname' => $row2['dateiname'],
'target' => $row2['target']
)
);
}
$smarty->assign('table_data2', $table_data2);
$query3 = "SELECT beschreibung, dateiname, target
FROM imt_rollen_user_zuord a, imt_rolle b, imt_rollen_rechte_zuord c, imt_rechte d
WHERE a.roid=b.roid
AND b.roid=c.roid
AND c.reid=d.reid
AND a.imtuid = '$uid'
AND d.bereich='ADA'
ORDER BY sort_order ASC";
$result3 = $db->query ($query3)
or die ("Cannot execute query3");
$table_data3 = array();
while ($row3 = $result3->fetch_array()){
array_push($table_data3, array(
'beschreibung' => $row3['beschreibung'],
'dateiname' => $row3['dateiname'],
'target' => $row3['target']
)
);
}
$smarty->assign('table_data3', $table_data3);
}
if($action == 'suche'){
$suchid = $_POST['suchid']." ";
$findMich = ' ';
$pos = strpos($suchid, $findMich);
$vid = trim(substr($suchid,0,$pos));
echo"
<script type='text/javascript'>
<!--
parent.menu_admin.location.href='".$_SERVER['PHP_SELF']."';
parent.admin_haupt.location.href='bearbeiten.php?id=$vid';
//-->
</script>
";
}
$smarty->assign('action', "$action");
$smarty->display("$template/$templatename");
?>