summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/chor.php
blob: d303b57a9a25b29a5161dba0a820bca0bb708c6b (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
$title = "Chorbeschreibung";
$class_konzert = '';
$class_index= '';
$class_proben= '';
$class_chor= 'class="active"';
$class_video= '';
$class_konzert_video= '';

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">
  <textarea onkeyup='auto_grow(this);' id="nachricht" name="nachricht" type="text" class="form-control input-md" required="" placeholder="Hier den Text einfügen, der auf der Startseite unter der Chorbeschreibung erscheinen soll.">
<?php echo htmlentities($nachricht["nachricht"]); ?></textarea>
 <span class="help-block">Formatierung: Doppelstern um ein Wort lässt das Wort fett erscheinen. Beispiel: **wort** => <strong>wort</strong>.<br>
<a href="https://de.wikipedia.org/wiki/Markdown" title="Markdown">Mehr ist hier zu finden.</a></span>
  </div>
  </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 -->

<script>
function auto_grow(element) {
    element.style.height = "5px";
    element.style.height = (element.scrollHeight)+"px";
}
var tx = document.getElementById("nachricht");
auto_grow(tx);
</script>
<?php
require_once __DIR__ . '/footer.php';
?>