project/developerpanel - all necessary websites linked
This commit is contained in:
@@ -1,112 +1,46 @@
|
||||
<?php /* Name: developer.php
|
||||
Beschreibung: Entwicklungsprozess (Bearbeitungsseite)
|
||||
- inkl. Aufruf von button_edit.php */
|
||||
|
||||
Beschreibung: Entwickler-Anwendungen */
|
||||
|
||||
// Initialisierung
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/general_files/initialise.php';
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" dir="ltr">
|
||||
<head>
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/html_head.php'; ?>
|
||||
</head>
|
||||
<body class="theme-green">
|
||||
|
||||
<?php /* Besondere Entwickler-Rechte checken */
|
||||
// Fetch user details
|
||||
$sql = "SELECT * FROM user_permissions up INNER JOIN user_general_information ugi ON up.user_id = ugi.user_id WHERE up.user_id = {$_SESSION["user_id"]}";
|
||||
$result = $pdo->query($sql);
|
||||
$isDeveloper = $result->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
// Check if the user has developer access (Entwickler = 1)
|
||||
if ($isDeveloper["Entwickler"] == 1) {
|
||||
$sql_groups = "SELECT * FROM user_permissions";
|
||||
$stmt = $pdo->prepare($sql_groups);
|
||||
$stmt->execute();
|
||||
$groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
} else {
|
||||
// Zugriff nur für Entwickler
|
||||
if (!isset($groups["Entwickler"]) || $groups["Entwickler"] != 1) {
|
||||
header("Location: {$g_httpHomePath}");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" dir="ltr">
|
||||
<head>
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/html_head.php'; ?>
|
||||
</head>
|
||||
<body class="theme-green">
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/header.php'; ?>
|
||||
|
||||
<div class="header_title ht_dev" id="header_title">
|
||||
<span class="header_title_text">Entwickler</span>
|
||||
</div>
|
||||
|
||||
<?php // Es folgen ab hier die HTML-Ausgaben beginnend mit dem HTML-Header: ?>
|
||||
<div class="mainpage" id="mainpage">
|
||||
<div class="mainpage_container">
|
||||
<button type="button" class="button_mainpage unselectable bg_green" onclick="window.open('https://git.pelpino.de/NAK-Reinickendorf/intranet', '_blank', 'noopener,noreferrer');">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="32" height="32" aria-hidden="true" focusable="false"><path d="M23.546 10.93 13.067.452a1.55 1.55 0 0 0-2.188 0L8.708 2.627l2.76 2.76a1.838 1.838 0 0 1 2.327 2.341l2.658 2.66a1.837 1.837 0 1 1-1.102 1.033L12.87 8.94v6.526a1.837 1.837 0 1 1-1.512-.053V8.828a1.838 1.838 0 0 1-.999-2.409L7.636 3.697.45 10.881a1.55 1.55 0 0 0 0 2.188l10.48 10.48a1.55 1.55 0 0 0 2.186 0l10.43-10.43a1.55 1.55 0 0 0 0-2.188Z"/></svg>
|
||||
<div class="text">Git Repository</div>
|
||||
</button>
|
||||
|
||||
<button type="button" class="button_mainpage unselectable bg_green" onclick="window.open('https://pgadmin.pelpino.de/', '_blank', 'noopener,noreferrer');">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="32" height="32" aria-hidden="true" focusable="false"><path d="M12 2C7.03 2 3 3.79 3 6v12c0 2.21 4.03 4 9 4s9-1.79 9-4V6c0-2.21-4.03-4-9-4Zm0 2c4.42 0 7 .99 7 2s-2.58 2-7 2-7-.99-7-2 2.58-2 7-2Zm0 16c-4.42 0-7-.99-7-2v-2.13C6.63 16.57 9.14 17 12 17s5.37-.43 7-1.13V18c0 1.01-2.58 2-7 2Zm0-5c-4.42 0-7-.99-7-2v-2.13C6.63 11.57 9.14 12 12 12s5.37-.43 7-1.13V13c0 1.01-2.58 2-7 2Z"/></svg>
|
||||
<div class="text">Postgres-Datenbank</div>
|
||||
</button>
|
||||
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/header.php'; ?>
|
||||
|
||||
|
||||
<?php // Header (erweitert): Titel der Seite mit Funktionsaufruf ?>
|
||||
<div class="header_title ht_dev text_white" id="header_title">
|
||||
<div class="flexrow fullwidth" style="justify-content:space-between !important;">
|
||||
<div class="header_title_text">Entwicklungsprozess</div>
|
||||
|
||||
<div class="small_text" style="margin-right:8px;margin-left:8px;align-self:center;">
|
||||
<?php echo "$p_nac_base // $p_version ($p_status)" ?>
|
||||
<button type="button" class="button_mainpage unselectable bg_green" onclick="window.location.href='/intranet_repo/projects/intranet/index.php';">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="32" height="32" aria-hidden="true" focusable="false"><path d="M3 3h5v18H3V3Zm6.5 0h5v11h-5V3ZM16 3h5v7h-5V3Zm0 8.5h5V21h-5v-9.5ZM9.5 15.5h5V21h-5v-5.5Z"/></svg>
|
||||
<div class="text">Kanban-Board</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // Die oberen Standard-Overlays müssen vor dem Content-Bereich platziert sein. ?>
|
||||
|
||||
|
||||
<div class="content" id="base">
|
||||
|
||||
<div class="content_flexcontainer">
|
||||
<div class="flexright">
|
||||
|
||||
<?php // Info-Panel einbinden
|
||||
require_once 'developer_info.php'; ?>
|
||||
|
||||
<?php // Info-Panel einbinden
|
||||
//require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/_templates/playground/table_openClose.php'; ?>
|
||||
</div>
|
||||
|
||||
<div class="flexleft">
|
||||
<?php // TODO: Durch die Developer-Textpanels iterieren
|
||||
// TODO: Dev-Texte werden später noch in die Datenbank integriert
|
||||
$edit_id = 1;
|
||||
$filename = "work/todo.txt";
|
||||
$filecontent = file_get_contents($filename);
|
||||
$filecontent_output = markdownFormat($filecontent);
|
||||
|
||||
if (isset($_POST['speichern'])) {
|
||||
$filecontent = $_POST['filecontent'];
|
||||
|
||||
file_put_contents($filename, $filecontent); //Speichern + Bearbeitungsmodus verlassen
|
||||
header("Location: {$g_httpCurrentCleanUrl}");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<div class="content_panel" id="1">
|
||||
<div class="flexrow_right fullwidth">
|
||||
<?php require $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/snippets/button_edit.php'; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( (isset($_GET['action']) && $_GET['action'] == 'edit') &&
|
||||
(isset($edit_id) && $edit_id == 1) ) { ?>
|
||||
|
||||
<form class="display_within_dev" action="" method="post" id="<?php echo $edit_id; ?>">
|
||||
<textarea id="filecontent" name="filecontent" autofocus><?php echo $filecontent; ?></textarea>
|
||||
<div>
|
||||
<input class="button" type="submit" value="Speichern" name="speichern">
|
||||
<input class="button" type="button" value="Abbrechen" onclick="window.location.href=window.location.href.split('?')[0];">
|
||||
</div>
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<div class="content_panel_output"><?php echo $filecontent_output; ?></div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- EOD: content -->
|
||||
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/footer.php'; ?>
|
||||
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user