ACC SHELL
<?php
$datum = date('Y-m-d');
if(isset($_POST['s']))
{
$datum = input($_POST['datum']);
$nadpis = input($_POST['nadpis']);
$text = wysInput($_POST['text']);
if($nadpis == NULL) $errors[] = 'Nezadali ste nadpis novinky!';
if($text == NULL) $errors[] = 'Nezadali ste text novinky!';
if(!isset($errors))
{
$q = "INSERT INTO novinky(datum, nadpis, text) VALUES('$datum', '$nadpis', '$text')";
mysql_query($q);
die(header("Location: admin.php?novinky"));
}
}
$nav = array(
"novinky" => "Novinky",
"novinky&new" => "Přidat novinku"
);
?>
<?php include 'head.inc.php'; ?>
<form action="<?php echo "admin.php?novinky&new"; ?>" method="post" class="form">
<fieldset>
<legend>Přidat novinku</legend>
<table>
<tr>
<td>Datum:</td>
<td><input type="text" name="datum" value="<?php echo @$datum; ?>" class="datepicker" /></td>
</tr>
<tr>
<td>Nadpis:</td>
<td><input type="text" name="nadpis" value="<?php echo @$nadpis; ?>" class="iText" /></td>
</tr>
<tr valign="top">
<td>Text:</td>
<td><textarea name="text" cols="70" rows="10"><?php echo @$text; ?></textarea></td>
</tr>
</table>
</fieldset>
<p><input type="submit" name="s" value="Uložit" /></p>
</form>
<?php include 'foot.inc.php'; ?>
ACC SHELL 2018