summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/chor.php
blob: ac733208d60908231db39a1b9da4ad4187018bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
$title = "Chorbeschreibung";
$class_konzert = 'class="active"';
$class_index= '';
$class_proben= '';
$class_chor= '';

require_once __DIR__ . '/header.php';
require_once __DIR__ . '/code/db.php';

$db = get_db();
if ( isset($_REQUEST["id"]) ) {
	$query = "SELECT id, nachricht FROM chor WHERE id = ? LIMIT 1";
	$stmt = $db->prepare($query);
	$stmt->execute( array($_REQUEST["id"]) );
} else {
	$query = "SELECT id, nachricht FROM chor ORDER BY id DESC LIMIT 1;";
	$stmt = $db->prepare($query);
	$stmt->execute();
}
$nachricht = $stmt->fetch(PDO::FETCH_ASSOC);
?>

<form class="form-horizontal" method="POST" action="/code/chor/update.php">
<fieldset>

<!-- Form Name -->
<legend class="text-center"><h1>Chorbeschreibung ändern</h1></legend>

<!-- Text input-->
<div class="form-group">
  <label class="col-md-4 control-label" for="nachricht">Chorbeschreibung</label>  
  <div class="col-md-4">
  <input id="anfahrt" name="anfahrt" type="text" placeholder="Hier den Text einfügen, der auf der Startseite unter der Chorbeschreibung erscheinen soll." class="form-control input-md" required="" value="<?php echo htmlentities($nachricht["nachricht"]); ?>">
  </div>
</div>

<input type="hidden" value="<?php echo htmlentities($nachricht["id"]); ?>" name="id">

<!-- Button (Double) -->
<div class="form-group">
  <label class="col-md-4 control-label" for="save"></label>
  <div class="col-md-8">
    <button id="save" name="save" class="btn btn-success">Speichern</button>
    <a href="/"><button type="button" id="Abbrechen" name="Abbrechen" class="btn btn-danger">Abbrechen</button></a>
  </div>
</div>

</fieldset>
</form>


    </div> <!-- /container -->

<?php
require_once __DIR__ . '/footer.php';
?>