Nieuw lid |
|
<?
$admin = $_SESSION['sUserLevel'];
?>
<table border=0 cellpadding=0 cellspacing=0 width=377 class="body">
<tr><td background="images/contentboxTop.gif" WIDTH=377 HEIGHT=33 ALT="" align="center"><b>Edit newspost</b></td></tr>
<tr><td background="images/contentboxBack.gif" WIDTH=377 HEIGHT=126 ALT="">
<table>
<tr>
<td width=25></td><td class="body">
<?php
if($admin = 1) {
if(isset($_POST['submit'])) {
$titel = addslashes($_POST['titel']);
$door = $_POST['door'];
$text = addslashes($_POST['text']);
$datum = $_POST['datum'];
$id = $_GET['id'];
$query = "UPDATE news SET titel='$titel', door='$door', text='$text', datum='$datum' WHERE id=$id";
mysql_query($query) or die(mysql_error());
?>
<table class="body">
<tr><td width=15></td><td class="body">
News has been added. Thank you.
<?php
}
else {
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM nieuws WHERE id=$id");
$obj = mysql_fetch_object($query);
?>
<form action="index.php?page=editnews&nid=<?php print($id); ?>" method="POST">
Titel:<br><input type="text" name="topic" class="body" value="<?php print(stripslashes($obj->titel)); ?>"><br>
Content:<br>
<textarea name="content" rows="10" cols="55" class="body" ><?php print(stripslashes($obj->text)); ?></textarea>
<input type="hidden" name="poster" value="<?php print($_SESSION['sUser']); ?>">
<input type="hidden" name="date" value="<?php print(date("d-m-y H:i")); ?>">
<input type="submit" name="submit" value="Submit">
</form>
<?php
}
} else {
print("ERROR: You are not permitted to do this!");
}
?>
</td>
</tr>
</table>
</td></tr>
<tr><td background="images/contentboxBottom.gif" height=2>
</td></tr>
</table>
<? $admin = $_SESSION['sUserLevel']; ?> <table border=0 cellpadding=0 cellspacing=0 width=377 class="body"> <tr><td background="images/contentboxTop.gif" WIDTH=377 HEIGHT=33 ALT="" align="center"><b>Edit newspost</b></td></tr> <tr><td background="images/contentboxBack.gif" WIDTH=377 HEIGHT=126 ALT=""> <table> <tr> <td width=25></td><td class="body"> <?php if($admin = 1) { if(isset($_POST['submit'])) { $door = $_POST['door']; $datum = $_POST['datum']; $id = $_GET['id']; $query = "UPDATE news SET titel='$titel', door='$door', text='$text', datum='$datum' WHERE id=$id"; ?> <table class="body"> <tr><td width=15></td><td class="body"> News has been added. Thank you. <?php } else { $id = $_GET['id']; $query = mysql_query("SELECT * FROM nieuws WHERE id=$id"); ?> <form action="index.php?page=editnews&nid= <?php print($id); ?>" method="POST"> Titel:<br><input type="text" name="topic" class="body" value=" <?php print(stripslashes($obj->titel)); ?>"><br> Content:<br> <textarea name="content" rows="10" cols="55" class="body" > <?php print(stripslashes($obj->text)); ?></textarea> <input type="hidden" name="poster" value=" <?php print($_SESSION['sUser']); ?>"> <input type="hidden" name="date" value=" <?php print(date("d-m-y H:i")); ?>"> <input type="submit" name="submit" value="Submit"> </form> <?php } } else { print("ERROR: You are not permitted to do this!"); } ?> </td> </tr> </table> </td></tr> <tr><td background="images/contentboxBottom.gif" height=2> </td></tr> </table>
|