boe
By: testje | Date: Dec 1 2007 20:31 | Format: PHP | Expires: never | Size: 7.36 KB | Hits: 1333
- <script language="javascript" type="text/javascript">
- tinyMCE.init({
- mode : "textareas",
- theme : "advanced",
- theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
- theme_advanced_buttons2 : "",
- theme_advanced_buttons3 : "",
- theme_advanced_toolbar_location : "top",
- theme_advanced_toolbar_align : "left",
- theme_advanced_statusbar_location : "bottom",
- extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
- });
- </script>
- <div id="location">
- U bevindt zich hier: <a href="index.php">Webber</a> › <a href="index.php?section=modules">Modules</a> › <a href="index.php?section=modules&view=news">Nieuws</a> › <a href="index.php?section=content&view=news&action=add">Nieuwsbericht schrijven</a>
- </div>
- <h1>Nieuwsbericht schrijven</h1>
- <?php
- if ($_POST['submit']) {
- // Variablen
- $title = $_POST['title'];
- $hours = $_POST['hours'];
- $minutes = $_POST['minutes'];
- $seconds = $_POST['seconds'];
- $days = $_POST['days'];
- $months = $_POST['months'];
- $year = $_POST['year'];
- $text = $_POST['text'];
- $author = $_POST['author'];
- $category = $_POST['category'];
- $title_db = escape($title);
- $date_db = ($date);
- $text_db = escape($text);
- $author_db = escape($author);
- $category_db = escape($category);
- VALUES ($title_db, $date_db, $text_db, $author_db, $category_db)
- ");
- //print '<div class="succes">Pagina toegevoegd!</div><meta http-equiv="refresh" content="1;URL=index.php?section=modules&view=news" />';
- }
- ?>
- <form action="" method="post">
- <fieldset><legend>Schrijf een nieuwsbericht</legend>
- <table class="add">
- <tr>
- <td style="width: 50%;">Titel:</td>
- <td style="width: 50%;">Datum:</td>
- <tr>
- <td style="width: 50%;"><input name="title" size="50" /></td>
- <td style="width: 50%;"><?php
- $stakker = getDates($tijd);
- print '<select name="days" class="select">'."n";
- foreach ($stakker['days'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$value.'"';
- if ($key == $stakker['days']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- print '<select name="months" class="select">'."n";
- foreach ($stakker['months'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$key.'"';
- if ($key == $stakker['months']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- print '<select name="year" class="select">'."n";
- foreach ($stakker['year'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$value.'"';
- if ($key == $stakker['year']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- print '<select name="hours" class="select">'."n";
- foreach ($stakker['hours'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$value.'"';
- if ($key == $stakker['hours']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- print '<select name="minutes" class="select">'."n";
- foreach ($stakker['minutes'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$value.'"';
- if ($key == $stakker['minutes']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- print '<select name="seconds" class="select" style="display: none;">'."n";
- foreach ($stakker['seconds'] as $key => $value) {
- if ($key !== 'selected') {
- print '<option value="'.$value.'"';
- if ($key == $stakker['seconds']['selected']) {
- print ' selected="selected"';
- }
- print ">$value</option>n";
- }
- }
- print '</select>';
- function getDates($timestamp = false) {
- $maanden = array(1 => "januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");
- $toret['months'] = $maanden;
- if ($timestamp) {
- $toret['months']['selected'] = $maand;
- $toret['days']['selected'] = $dag;
- $toret['hours']['selected'] = $uur;
- $toret['minutes']['selected'] = $minuten;
- $toret['seconds']['selected'] = $seconden;
- $toret['year']['selected'] = $jaar;
- }
- for ($i = 1; $i <= 31; $i++) {
- $toret['days'][$i] = $i;
- }
- for ($i = 0; $i <= 23; $i++) {
- $toret['hours'][$i] = $i;
- }
- for ($i = 0; $i <= 59; $i++) {
- $toret['minutes'][$i] = '0'.$i;
- $toret['seconds'][$i] = '0'.$i;
- }
- else {
- $toret['minutes'][$i] = $i;
- $toret['seconds'][$i] = $i;
- }
- }
- $toret['year'][$i] = $i;
- }
- return $toret;
- }
- ?></td>
- </tr>
- <tr>
- <td colspan="2">Inhoud:</td>
- </tr>
- <tr>
- <td colspan="2"><textarea name="text" cols="117" rows="20"> </textarea></td>
- </tr>
- <tr>
- <td style="width: 50%;">Auteur:</td>
- <td style="width: 50%;">Categorie:</td>
- <tr>
- <td style="width: 50%;">
- <select name="author">
- <?php
- print '
- <option value="'.$row['name'].'">'.$row['name'].'</option>
- ';
- }
- }
- ?>
- </select>
- </td>
- <td style="width: 50%;">
- <select name="category">
- <?php
- print '
- <option value="'.$row['category'].'">'.$row['category'].'</option>
- ';
- }
- }
- ?>
- </select>
- </td>
- </tr>
- </table>
- </fieldset>
- <fieldset><legend>Opties</legend>
- <input value="toevoegen" name="submit" type="submit" class="button" />
- <input value="annuleren" type="submit" onclick="javascript:history.back()" class="button" />
- </fieldset>
- </form>
Latest pastes
1 days ago
3 days ago
3 days ago
4 days ago
5 days ago