Advertisement
Guest User

Untitled

a guest
Mar 4th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. <?php
  2. require_once '/var/www/html/includes/artsurvey-con.php';
  3. if(ISSET($_POST['search'])){
  4. $search = urlencode($_POST['search']);
  5. $search1 = urldecode($search);
  6. $search2 = preg_replace("/[^a-zA-Z0-9,. ]/",'',$search1);
  7. $query = $conn->query("SELECT * FROM `art_collection_records`
  8. WHERE (`department` LIKE '%".$search2."%')
  9. OR (`building` LIKE '%".$_POST['search']."%')
  10. OR (`room_number` LIKE '%".$_POST['search']."%')
  11. OR (`contact_person` LIKE '%".$_POST['search']."%')
  12. OR (`category` LIKE '%".$_POST['search']."%')
  13. OR (`painting` LIKE '%".$_POST['search']."%')
  14. OR (`drawing` LIKE '%".$_POST['search']."%')
  15. OR (`mixed` LIKE '%".$_POST['search']."%')
  16. OR (`print` LIKE '%".$_POST['search']."%')
  17. OR (`sculpture` LIKE '%".$_POST['search']."%')
  18. OR (`craft` LIKE '%".$_POST['search']."%')
  19. OR (`title` LIKE '%".$_POST['search']."%')
  20. OR (`artist` LIKE '%".$_POST['search']."%')
  21. OR (`how_acquired` LIKE '%".$_POST['search']."%')
  22. OR (`back_notes` LIKE '%".$_POST['search']."%')
  23. OR (`written_description` LIKE '%".$_POST['search']."%')
  24. ORDER BY title ASC LIMIT 1200");
  25. $row = $query->num_rows;
  26. if($row > 0){
  27. $output = "";
  28. $output .= "
  29. <center>
  30. <h3>Search Results</h3>
  31. </center>
  32. <table class='table table-striped'>
  33. <caption>End of Results</caption>
  34. <thead class='thead-dark'>
  35. <tr>
  36. <th>ID</th>
  37. <th>Department</th>
  38. <th>Building</th>
  39. <th>Room Number</th>
  40. <th>Contact Person</th>
  41. <th>Category</th>
  42. <th>Painting</th>
  43. <th>Drawing</th>
  44. <th>Mixed</th>
  45. <th>Print</th>
  46. <th>Framed</th>
  47. <th>Sculpture</th>
  48. <th>Craft</th>
  49. <th>Base</th>
  50. <th>2D Size</th>
  51. <th>3D Size</th>
  52. <th>Title</th>
  53. <th>Artist</th>
  54. <th>Date Created</th>
  55. <th>Date Acquired</th>
  56. <th>Back Notes</th>
  57. <th>Description</th>
  58. <th>Image 1</th>
  59. <th>Image 2</th>
  60. <th>Image 3</th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. ";
  65. while($fetch = $query->fetch_array()){
  66. $output .= "
  67. <tr>
  68. <td>".$fetch['acs_id']."</td>
  69. <td>".$fetch['department']."</td>
  70. <td>".$fetch['building']."</td>
  71. <td>".$fetch['room_number']."</td>
  72. <td>".$fetch['contact_person']."</td>
  73. <td>".$fetch['category']."</td>
  74. <td>".$fetch['painting']."</td>
  75. <td>".$fetch['drawing']."</td>
  76. <td>".$fetch['mixed']."</td>
  77. <td>".$fetch['print']."</td>
  78. <td>".$fetch['framed']."</td>
  79. <td>".$fetch['sculpture']."</td>
  80. <td>".$fetch['craft']."</td>
  81. <td>".$fetch['base']."</td>
  82. <td>".$fetch['two_d_size']."</td>
  83. <td>".$fetch['three_d_size']."</td>
  84. <td>".$fetch['title']."</td>
  85. <td>".$fetch['artist']."</td>
  86. <td>".$fetch['date_created']."</td>
  87. <td>".$fetch['date_acquired']."</td>
  88. <td>".$fetch['back_notes']."</td>
  89. <td>".$fetch['written_description']."</td>
  90. <td><img class='thumb' src=".$fetch[urlencode(image_link_1)]." /></td>
  91. <td><img class='thumb' src=".$fetch[rawurlencode(image_link_2)]." /></td>
  92. <td><img class='thumb' src=".$fetch[rawurlencode(image_link_3)]." /></td>
  93. </tr>
  94. ";
  95. }
  96. $output .="
  97. </tbody>
  98. </table>
  99. <a class='text-danger' href='#anchor'>Return to Top of Page</a>
  100. ";
  101. echo $output;
  102. }else{
  103. echo "<center><h4>Search Not Found!</h4></center>";
  104. }
  105. }
  106. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement