Advertisement
Guest User

Untitled

a guest
May 29th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <!-- marked -->
  2. <script src="js/marked.min.js"></script>
  3. <script src="js/highlight.pack.js"></script>
  4.  
  5. <!-- plugin script -->
  6. <script src="js/bootstrap-suggest.js"></script>
  7.  
  8. <div class="form-group">
  9. <label for="comment">start typing with @</label>
  10. <textarea class="form-control" rows="5" id="comment"></textarea>
  11. </div>
  12.  
  13. hljs.initHighlightingOnLoad();
  14. // configure marked
  15. var renderer = new marked.Renderer();
  16. renderer.table = function (header, body) {
  17. return '
  18. <table class="table table-bordered table-striped table-hover">
  19. <thead>
  20. ' + header + '
  21. </thead>
  22. <tbody>
  23. ' + body + '
  24. </tbody>
  25. </table>';
  26. },
  27.  
  28. marked.setOptions({
  29. sanitize: false,
  30. highlight: function (code) {
  31. return hljs.highlightAuto(code).value;
  32. },
  33. renderer: renderer,
  34. breaks: true
  35. });
  36.  
  37. $.fn.extend({
  38. marked: function() {
  39. this.each(function() {
  40. $this = $(this);
  41. $this.html(marked($this.html()));
  42. })
  43.  
  44. return this;
  45. },
  46. });
  47.  
  48. $(function() {
  49.  
  50. $('.markdown').marked();
  51.  
  52. // data
  53. var users = [
  54. "users.php",
  55. ];
  56.  
  57. $('#comment').suggest('@', {
  58. data: users,
  59. map: function(user) {
  60. return {
  61. value: user,
  62. text: '<strong>'+users+'</strong>'
  63. }
  64. }
  65. })
  66.  
  67. })
  68.  
  69. include_once 'koneksi.php';
  70. $query = $db_con->prepare("SELECT * FROM tb_users WHERE username LIKE ? ");
  71. $query->bindValue(':param', '%'.$param.'%', PDO::PARAM_STR);
  72. $query->execute();
  73. $row=$query->execute();
  74. if ($query->rowCount() > 0) {
  75. ?> <?php
  76. $username= array();
  77. while($row=$query->fetch(PDO::FETCH_OBJ)) {
  78. echo $row->username;
  79. <?php }
  80. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement