-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvlozit_novinku.php
61 lines (53 loc) · 1.38 KB
/
vlozit_novinku.php
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
<?php
require_once 'php/funkce.php';
if(!$_SESSION["role"] || $_SESSION["role"] > 2){
posledni_strana();
}
if(array_key_exists("novinka", $_GET)){?>
<form action="php/nova_novinka.php" method="post" style="margin: 10px">
<table>
<tr>
<td style="width: 200px"><label for="nadpis">Nadpis novinky:</label></td>
<td><input type="text" name="nadpis" id="nadpis" maxlength="120" style="width: 300px"></td>
</tr>
<tr>
<td><label for="text">Text novinky:</label></td>
</tr>
</table>
<textarea name="text" id="text" maxlength="10000" style="width: 455px"></textarea>
<?php
if($_SESSION["role"] > 1){?>
<input type="hidden" name="aktivni" id="aktivni" value="0">
<?php
}
else{?>
<input type="hidden" name="aktivni" id="aktivni" value="1">
<?php
}
?>
<input type="submit" value="Vložit novinku do databáze">
</form>
<form action="index.php" method="post" style="margin: 10px">
<input type="submit" value="Zpět">
</form>
<?php
if(array_key_exists("chyba_novinka", $_GET)){?>
<div class="error">
<p> <?php echo($_GET["chyba_novinka"])?> </p>
</div>
<?php
}
if(array_key_exists("uspech_novinka", $_GET)){?>
<div class="succes">
<p> <?php echo($_GET["uspech_novinka"])?> </p>
</div>
<?php
}
}
else{?>
<form action="index.php?novinka=1" method="post" style="margin: 10px">
<input type="submit" value="Přidat novou novinku">
</form>
<?php
}
?>