Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2017
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.99 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. ?>
  21. <?php
  22. require_once 'users/init.php';
  23. require_once $abs_us_root.$us_url_root.'users/includes/header.php';
  24. require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
  25. ?>
  26. <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  27. <?php
  28. //Find Encouragement
  29. $encQ=$db->query("SELECT * FROM encouragement ORDER BY id DESC");
  30. $enc=$encQ->results();
  31.  
  32. if (!empty($_POST['encouragement'])){
  33.     $note = Input::get('notes');
  34.     $date = date('Y-m-d');
  35.     $fields = array(
  36.         'user'          => $user->data()->id,
  37.         'email'         => $user->data()->email,
  38.         'date'          => $date,
  39.         'note'          => $note,
  40.     );
  41.     $db->insert('encouragement',$fields);
  42.     Redirect::to('encouragement.php?err=Encouragement+Added!');
  43. }
  44. ?>
  45.  
  46. <div id="page-wrapper">
  47.     <div class="container-fluid">
  48. <div class="row">
  49. <div class="col-sm-12">
  50. <div class="col-xs-8  panel panel-primary">
  51.     <h1 align="center" class="page-header">
  52.         Wall of Encouragement
  53.     </h1>
  54. <?php foreach ($enc as $v1){ ?>
  55. <div class="row">
  56. <div class="col-sm-12">
  57. <div class="col-xs-2">
  58. <?php
  59.     $grav = get_gravatar(strtolower(trim($v1->email)));
  60.  ?>
  61.     <img src="<?=$grav?>" class="img-responsive img-thumbnail" >
  62. </div>
  63.  
  64. <div class="col-xs-10">
  65. <strong><p align="left">Posted by <?php echouser($v1->user);?> on <?=$v1->date?></strong><br>
  66. <p><?=$v1->note?></p>
  67. </div>
  68. <hr>
  69.  
  70. </div>
  71. </div>
  72. <?php } ?>
  73.  
  74. </div> <!-- /col2/3 -->
  75. <div class="col-sm-4">
  76.  
  77.  
  78. <form class="" action="encouragement.php" name="encourage" method="post">
  79. <div class="form-group">
  80.  
  81. <div class="form-group">
  82.     <label for="notes"><h3>Post your encouragement!</h3></label>
  83.     <textarea rows='4' cols='100'" class="form-control" name="notes" id="notes" "></textarea>
  84. </div>
  85.  
  86. <p><input class='btn btn-large btn-primary' type='submit' name="encouragement" value='Post your encouragement!'/></p>
  87. </form>
  88. </div>
  89.  
  90.  
  91.                 <!-- Content Ends Here -->
  92. </div> <!-- /.col -->
  93.         </div> <!-- /.row -->
  94.  
  95.     </div> <!-- /.container -->
  96.  
  97. </div> <!-- /.wrapper -->
  98.  
  99.  
  100.  
  101.  
  102. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  103.  
  104. <!-- Place any per-page javascript here -->
  105.  
  106. <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement