Guest User

Untitled

a guest
Feb 26th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. $('#textbox').keyup(function(){
  2. $("#display_students").text('');
  3. var name = $('#textbox').val();
  4. if($.trim(name) != ''){
  5. $.post('../core/Query/students/student_search.php', {st_process: name}, function(data){
  6. $("#display_students").append(data);
  7. });
  8.  
  9. }
  10. });
  11.  
  12. <?php
  13.  
  14.  
  15. if(isset($_POST['st_process']) === true && empty($_POST['st_process']) === false){
  16. include("../Query-core.php");
  17. include('../db.php');
  18.  
  19. $authentication = new DBRequest($host = 'localhost',
  20. $user = 'root',
  21. $pass = '',
  22. $db = 'contas');
  23.  
  24. $selectedstudents = $authentication->selectionQueryLike("alunos", $authentication->e(trim($_POST['st_process'])), "student_process");
  25.  
  26. if(mysqli_num_rows($selectedstudents) > 0){
  27. echo "<table><tr><th>Nome</th><th>NºProcesso</th><th>ID</th><th>Apagar</th></tr>";
  28.  
  29. while($row = $selectedstudents->fetch_assoc()){
  30. echo "<tr>";
  31. echo "<td><a href='#'>" . $row["student_name"] . "</a></td>";
  32. echo "<td>" . $row["student_process"] . "</td>";
  33. echo "<td>" . $row["student_ID"] . "</td>";
  34. echo "<td><a href=?usrdelete=" . $row["student_ID"] . ">Delete<a/></td>";
  35.  
  36. echo "</tr>";
  37.  
  38. }
  39. echo "</table>";
  40. }
  41. }
  42.  
  43. ?>
Add Comment
Please, Sign In to add comment