Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Page Manager</h1>
- <div class="row">
- <div class="col-md-3">
- <div class="list-group">
- <a class="list-group-item" href="?page=pages">
- <i class="fa fa-plus-circle" aria-hidden="true"></i> Add New Page
- </a>
- <?php
- $q = "SELECT * FROM pages ORDER BY title ASC";
- $r = mysqli_query($dbc, $q);
- while ($list = mysqli_fetch_assoc($r)) {
- $blur = substr(strip_tags($list['body']),0,140);
- ?>
- <a class="list-group-item <?php selected($list['id'],$opened['id'],'active'); ?>" href="index.php?page=pages&id=<?php echo $list['id']; ?>">
- <h4 class="list-group-item-heading"><?php echo $list['title']; ?></h4>
- <p class="list-group-item-text"><?php echo $blur; ?></p>
- </a>
- <?php }
- ?>
- </div>
- </div>
- <div class="col-md-9">
- <?php if(isset($message)){echo $message; } ?>
- <!--form and text boxes -->
- <form action="index.php?page=pages&id= <?php echo $opened['id']; ?>" role="form" method="post">
- <div class="form-group">
- <label for="title" >page title</label>
- <input class="form-control" type="text" name="title" id="title" value="<?php echo $opened['title']; ?>" placeholder="page title" />
- </div>
- <div class="form-group">
- <label for="user" >user</label>
- <select class="form-control" name="user" id="user" >
- <option value="0">No user</option>
- <?php
- $q = "SELECT id FROM users ORDER BY first ASC";
- $r = mysqli_query($dbc,$q);
- while ( $user_list = mysqli_fetch_assoc($r)) {
- $user_data = data_user($dbc,$user_list['id']);
- ?>
- <option value="<?php echo $user_data['id']; ?>"
- <?php
- if(isset($_GET['id'])){
- //if($user_data['id'] == $opened['user']){echo 'selected'; }
- selected($user_data['id'], $opened['user'], 'selected');
- }
- else{
- //if($user_data['id'] == $user['id']){echo 'selected'; }
- selected($user_data['id'], $user['id'], 'selected');
- }
- ?> > <?php echo $user_data['fullname']; ?> </option>
- <?php } ?>
- </select>
- </div>
- <div class="form-group">
- <label for="slug" >Slug:</label>
- <input class="form-control" type="text" name="slug" id="slug" value="<?php echo $opened['slug']; ?>" placeholder="page slug" />
- </div>
- <div class="form-group">
- <label for="label" >page label</label>
- <input class="form-control" type="text" name="label" id="label" value="<?php echo $opened['label']; ?>" placeholder="page label" />
- </div>
- <div class="form-group">
- <label for="header" >page header</label>
- <input class="form-control" type="text" name="header" id="header" value="<?php echo $opened['header']; ?>" placeholder="page heade" />
- </div>
- <div class="form-group">
- <label for="body" >body</label>
- <textarea class="form-control editor" name="body" id="body" placeholder="page body" rows="8">
- <?php echo $opened['body']; ?>
- </textarea>
- </div>
- <button type="submit" class="btn btn-default"> Save</button>
- <input type="hidden" name="submitted" value="1" />
- <input type="hidden" name="id" value="<?php echo $opened['id']; ?>">
- </form>
- </div>
- </div>
Add Comment
Please, Sign In to add comment