Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <?php
  2. include_once 'include/config.php';
  3. include_once 'admin/session.php';
  4. include_once 'friendAPI.php';
  5. //include 'userAPI.php';
  6. global $Dbconect;
  7.  
  8. $output = '';
  9. if(isset($_POST["query"]) )
  10. {
  11. $id = '.uid.';
  12.  
  13. $search = mysqli_real_escape_string($Dbconect, $_POST["query"]);
  14. $query = "
  15. SELECT * FROM user
  16. WHERE u_name LIKE '%".$search."%'
  17. OR u_email LIKE '%".$search."%'
  18.  
  19. ";
  20. $result = mysqli_query($Dbconect, $query);
  21. if(mysqli_num_rows($result) > 0)
  22. {
  23. //$output .= '<div class="resultsearch style="padding:0px"" >
  24. //<table class="table table bordered ">';
  25.  
  26. echo'
  27. <table>';
  28. $row = mysqli_fetch_array($result);
  29. $rcount=mysqli_num_rows($result);
  30.  
  31. while($row = mysqli_fetch_array($result))
  32.  
  33. {
  34.  
  35.  
  36. $user = $row['u_id'];
  37.  
  38.  
  39. echo '<tr>';
  40. echo'
  41. <td style="padding:3px; margin :5px"><a href="searchBox.php?id='.$row['u_id'].'"> <img src="'.$row['u_img'].'" alt="" width="30px" hieght="30px" /></a> </td>
  42. <td style="padding:3px; margin :5px"><a href="searchBox.php?id='.$row['u_id'].'"> '.$row['u_name'].' </a> </td>
  43. ';
  44. if( sooqcom_is_afriend($id , $user))
  45. {
  46.  
  47. echo ' <td><div style=" border-radius: 12px; background-color: #FF4500; width:60px"> add friend</div></tr>';echo '</br>';
  48.  
  49.  
  50. }
  51. else{
  52. echo'
  53.  
  54. <td>open </td>';
  55. }
  56.  
  57. echo'</tr>';
  58.  
  59. /*echo'
  60.  
  61. <tr style="margin:10px; border-bottom:1px solid #e0e0e0;">
  62.  
  63. <td style="padding:3px; margin :5px"><a href="searchBox.php?id='.$row['u_id'].'"> <img src="'.$row['u_img'].'" alt="" width="30px" hieght="30px" /></a> </td>
  64. <td style="padding:3px; margin :5px"><a href="searchBox.php?id='.$row['u_id'].'"> '.$row['u_name'].' </a> </td>
  65.  
  66. </tr>
  67.  
  68.  
  69. '; */
  70.  
  71.  
  72. }
  73.  
  74. echo '</table>';
  75.  
  76.  
  77. }
  78. else
  79. {
  80. echo 'Data Not Found';
  81. }
  82.  
  83. }
  84.  
  85.  
  86.  
  87. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement