3
0
mirror of http://git.frickel.earth/Tysox/BOS-Pinneberg.git synced 2025-05-21 07:24:30 +02:00
2018-02-28 21:48:54 +01:00

133 lines
4.3 KiB
PHP

<?php
session_start();
if (empty($_SESSION['status'])) {
if (!file_exists('config/config.inc.php')) {
$_SESSION['status'] = 'error';
} else {
$_SESSION['status'] = 'login';
}
}
if ($_SESSION['status'] == "login") {
echo "<html>
<head>
<script>
setTimeout(\"window.location.href='../login.php'\", 0);
</script>
</head>
<body>
</body>
</html>";
return;
}
include '../config/config.inc.php';
$data = new Config();
// Create connection
$conn = new mysqli($data->getSQLHost(), $data->getSQLUser(), $data->getSQLPassword(), $data->getSQLDatabase());
mysqli_set_charset($conn, "utf8");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$result = $conn->query("SELECT * FROM `feuerwehr_pi`");
include("include/header.php");
$header = new Header();
$header->showHeader("Feuerwehr"); ?>
<main class="mdl-layout__content mdl-color--grey-100">
<div class="mdl-grid demo-content">
<div class="demo-charts mdl-color--white mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-grid">
<h3 id="feedback"></h3>
<div class="mdl-textfield mdl-js-textfield getmdl-select getmdl-select__fix-height">
<input class="mdl-textfield__input" value="" id="ort" readonly/>
<input value="" type="hidden" name="ort"/>
<i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
<label class="mdl-textfield__label" for="ort">Wache</label>
<ul for="ort" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
<?php
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
?>
<li class="mdl-menu__item"
data-val="<?php echo($row['id']); ?>"> <?php echo($row['Ort']) ?></li> <?php
}
}
?>
</ul>
</div>
<br>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="name">
<label class="mdl-textfield__label" for="name">Funkrufname</label>
</div>
<br>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="number">
<label class="mdl-textfield__label" for="number">Funknummer</label>
</div>
<br>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="type">
<label class="mdl-textfield__label" for="type">Fahrzeug</label>
</div>
<br>
<button onclick="addVehicle()"
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">
OK
</button>
</div>
</main>
</div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="position: fixed; left: -1000px; height: -1000px;">
<defs>
<mask id="piemask" maskContentUnits="objectBoundingBox">
<circle cx=0.5 cy=0.5 r=0.49 fill="white"/>
<circle cx=0.5 cy=0.5 r=0. 40 fill="black"/>
</mask>
<g id="piechart">
<circle cx=0.5 cy=0.5 r=0.5/>
<path d="M 0.5 0.5 0.5 0 A 0.5 0.5 0 0 1 0.95 0.28 z" stroke="none" fill="rgba(255, 255, 255, 0.75)"/>
</g>
</defs>
</svg>
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script src="../style/js/jQuery.js"></script>
<script>
function addVehicle() {
var ort = $("#ort").val();
var name = $("#name").val();
var number = $("#number").val();
var type = $("#type").val();
$.ajax({
url: "../scripts/vehicle.php",
type: "POST",
data: "org=ff&ort" + ort + "&name=" + name + "&number=" + number + "&type=" + type,
success: function (resp) {
$("#feedback").html(resp);
}
});
}
</script>
</body>
</html>