Advertisement
Guest User

editarticle.php code

a guest
May 5th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.61 KB | None | 0 0
  1. <?php include "templates/include/header.php" ?>
  2.  
  3.       <div id="adminHeader">
  4.         <h2>Admin</h2>
  5.         <p>Inloggad som: <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Logga ut</a></p>
  6.       </div>
  7.  
  8.       <h1><?php echo $results['pageTitle']?></h1>
  9.  
  10.       <form action="admin.php?action=<?php echo $results['formAction']?>" method="post">
  11.         <input type="hidden" name="articleId" value="<?php echo $results['article']->id ?>"/>
  12.  
  13. <?php if ( isset( $results['errorMessage'] ) ) { ?>
  14.         <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
  15. <?php } ?>
  16.  
  17.         <ul>
  18.  
  19.           <li>
  20.             <label for="title">Filmtitel</label>
  21.             <input type="text" name="title" id="title" placeholder="Filmens titel!" required autofocus maxlength="255" value="<?php echo htmlspecialchars( $results['article']->title )?>" />
  22.           </li>
  23.          
  24.            <li>
  25.             <label for="genre">Genre</label>
  26.             <input type="text" name="genre" id="genre" placeholder="Genre" required autofocus maxlength="255" value="<?php echo htmlspecialchars( $results['article']->genre )?>" />
  27.           </li>
  28.  
  29.           <li>
  30.             <label for="summary">Movie Plot</label>
  31.             <textarea name="summary" id="summary" placeholder="Description for the movie!" required maxlength="1000" style="height: 5em;"><?php echo htmlspecialchars( $results['article']->summary )?></textarea>
  32.           </li>
  33.  
  34.           <li>
  35.             <label for="content">Article Content</label>
  36.             <textarea name="content" id="content" placeholder="The HTML content of the article" required maxlength="100000" style="height: 30em;"><?php echo htmlspecialchars( $results['article']->content )?></textarea>
  37.           </li>
  38.  
  39.           <li>
  40.             <label for="publicationDate">Day:</label>
  41.             <input type="date" name="publicationDate" id="publicationDate" placeholder="RANDOM" required maxlength="10" value="<?php echo $results['article']->publicationDate ? date( "", $results['article']->publicationDate ) : "" ?>" />
  42.           </li>
  43.  
  44.  
  45.         </ul>
  46.  
  47.         <div class="buttons">
  48.           <input type="submit" name="saveChanges" value="Save Changes" />
  49.           <input type="submit" formnovalidate name="cancel" value="Cancel" />
  50.         </div>
  51.  
  52.       </form>
  53.  
  54. <?php if ( $results['article']->id ) { ?>
  55.       <p><a href="admin.php?action=deleteArticle&amp;articleId=<?php echo $results['article']->id ?>" onclick="return confirm('Delete This Article?')">Delete</a></p>
  56. <?php } ?>
  57.  
  58. <?php include "templates/include/footer.php" ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement