Guest User

pages

a guest
Aug 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. <h1>Page Manager</h1>
  2.  
  3.  
  4. <div class="row">
  5.  
  6. <div class="col-md-3">
  7.  
  8.  
  9. <div class="list-group">
  10.  
  11. <a class="list-group-item" href="?page=pages">
  12. <i class="fa fa-plus-circle" aria-hidden="true"></i> Add New Page
  13.  
  14. </a>
  15.  
  16.  
  17.  
  18. <?php
  19.  
  20. $q = "SELECT * FROM pages ORDER BY title ASC";
  21.  
  22. $r = mysqli_query($dbc, $q);
  23.  
  24. while ($list = mysqli_fetch_assoc($r)) {
  25.  
  26. $blur = substr(strip_tags($list['body']),0,140);
  27.  
  28. ?>
  29.  
  30. <a class="list-group-item <?php selected($list['id'],$opened['id'],'active'); ?>" href="index.php?page=pages&id=<?php echo $list['id']; ?>">
  31. <h4 class="list-group-item-heading"><?php echo $list['title']; ?></h4>
  32. <p class="list-group-item-text"><?php echo $blur; ?></p>
  33. </a>
  34.  
  35. <?php }
  36. ?>
  37.  
  38. </div>
  39. </div>
  40.  
  41. <div class="col-md-9">
  42.  
  43. <?php if(isset($message)){echo $message; } ?>
  44.  
  45.  
  46. <!--form and text boxes -->
  47.  
  48.  
  49. <form action="index.php?page=pages&id= <?php echo $opened['id']; ?>" role="form" method="post">
  50. <div class="form-group">
  51. <label for="title" >page title</label>
  52. <input class="form-control" type="text" name="title" id="title" value="<?php echo $opened['title']; ?>" placeholder="page title" />
  53.  
  54. </div>
  55.  
  56. <div class="form-group">
  57. <label for="user" >user</label>
  58. <select class="form-control" name="user" id="user" >
  59.  
  60. <option value="0">No user</option>
  61. <?php
  62. $q = "SELECT id FROM users ORDER BY first ASC";
  63. $r = mysqli_query($dbc,$q);
  64.  
  65. while ( $user_list = mysqli_fetch_assoc($r)) {
  66. $user_data = data_user($dbc,$user_list['id']);
  67.  
  68. ?>
  69. <option value="<?php echo $user_data['id']; ?>"
  70. <?php
  71. if(isset($_GET['id'])){
  72. //if($user_data['id'] == $opened['user']){echo 'selected'; }
  73.  
  74. selected($user_data['id'], $opened['user'], 'selected');
  75.  
  76. }
  77. else{
  78. //if($user_data['id'] == $user['id']){echo 'selected'; }
  79. selected($user_data['id'], $user['id'], 'selected');
  80. }
  81.  
  82. ?> > <?php echo $user_data['fullname']; ?> </option>
  83.  
  84. <?php } ?>
  85. </select>
  86.  
  87.  
  88.  
  89.  
  90. </div>
  91.  
  92.  
  93. <div class="form-group">
  94.  
  95. <label for="slug" >Slug:</label>
  96.  
  97. <input class="form-control" type="text" name="slug" id="slug" value="<?php echo $opened['slug']; ?>" placeholder="page slug" />
  98.  
  99. </div>
  100.  
  101.  
  102. <div class="form-group">
  103. <label for="label" >page label</label>
  104. <input class="form-control" type="text" name="label" id="label" value="<?php echo $opened['label']; ?>" placeholder="page label" />
  105.  
  106. </div>
  107.  
  108. <div class="form-group">
  109. <label for="header" >page header</label>
  110. <input class="form-control" type="text" name="header" id="header" value="<?php echo $opened['header']; ?>" placeholder="page heade" />
  111.  
  112. </div>
  113.  
  114.  
  115. <div class="form-group">
  116. <label for="body" >body</label>
  117. <textarea class="form-control editor" name="body" id="body" placeholder="page body" rows="8">
  118.  
  119. <?php echo $opened['body']; ?>
  120. </textarea>
  121.  
  122. </div>
  123.  
  124. <button type="submit" class="btn btn-default"> Save</button>
  125. <input type="hidden" name="submitted" value="1" />
  126. <input type="hidden" name="id" value="<?php echo $opened['id']; ?>">
  127. </form>
  128.  
  129.  
  130. </div>
  131.  
  132. </div>
Add Comment
Please, Sign In to add comment