Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once '/var/www/html/includes/artsurvey-con.php';
- if(ISSET($_POST['search'])){
- $search = urlencode($_POST['search']);
- $search1 = urldecode($search);
- $search2 = preg_replace("/[^a-zA-Z0-9,. ]/",'',$search1);
- $query = $conn->query("SELECT * FROM `art_collection_records`
- WHERE (`department` LIKE '%".$search2."%')
- OR (`building` LIKE '%".$_POST['search']."%')
- OR (`room_number` LIKE '%".$_POST['search']."%')
- OR (`contact_person` LIKE '%".$_POST['search']."%')
- OR (`category` LIKE '%".$_POST['search']."%')
- OR (`painting` LIKE '%".$_POST['search']."%')
- OR (`drawing` LIKE '%".$_POST['search']."%')
- OR (`mixed` LIKE '%".$_POST['search']."%')
- OR (`print` LIKE '%".$_POST['search']."%')
- OR (`sculpture` LIKE '%".$_POST['search']."%')
- OR (`craft` LIKE '%".$_POST['search']."%')
- OR (`title` LIKE '%".$_POST['search']."%')
- OR (`artist` LIKE '%".$_POST['search']."%')
- OR (`how_acquired` LIKE '%".$_POST['search']."%')
- OR (`back_notes` LIKE '%".$_POST['search']."%')
- OR (`written_description` LIKE '%".$_POST['search']."%')
- ORDER BY title ASC LIMIT 1200");
- $row = $query->num_rows;
- if($row > 0){
- $output = "";
- $output .= "
- <center>
- <h3>Search Results</h3>
- </center>
- <table class='table table-striped'>
- <caption>End of Results</caption>
- <thead class='thead-dark'>
- <tr>
- <th>ID</th>
- <th>Department</th>
- <th>Building</th>
- <th>Room Number</th>
- <th>Contact Person</th>
- <th>Category</th>
- <th>Painting</th>
- <th>Drawing</th>
- <th>Mixed</th>
- <th>Print</th>
- <th>Framed</th>
- <th>Sculpture</th>
- <th>Craft</th>
- <th>Base</th>
- <th>2D Size</th>
- <th>3D Size</th>
- <th>Title</th>
- <th>Artist</th>
- <th>Date Created</th>
- <th>Date Acquired</th>
- <th>Back Notes</th>
- <th>Description</th>
- <th>Image 1</th>
- <th>Image 2</th>
- <th>Image 3</th>
- </tr>
- </thead>
- <tbody>
- ";
- while($fetch = $query->fetch_array()){
- $output .= "
- <tr>
- <td>".$fetch['acs_id']."</td>
- <td>".$fetch['department']."</td>
- <td>".$fetch['building']."</td>
- <td>".$fetch['room_number']."</td>
- <td>".$fetch['contact_person']."</td>
- <td>".$fetch['category']."</td>
- <td>".$fetch['painting']."</td>
- <td>".$fetch['drawing']."</td>
- <td>".$fetch['mixed']."</td>
- <td>".$fetch['print']."</td>
- <td>".$fetch['framed']."</td>
- <td>".$fetch['sculpture']."</td>
- <td>".$fetch['craft']."</td>
- <td>".$fetch['base']."</td>
- <td>".$fetch['two_d_size']."</td>
- <td>".$fetch['three_d_size']."</td>
- <td>".$fetch['title']."</td>
- <td>".$fetch['artist']."</td>
- <td>".$fetch['date_created']."</td>
- <td>".$fetch['date_acquired']."</td>
- <td>".$fetch['back_notes']."</td>
- <td>".$fetch['written_description']."</td>
- <td><img class='thumb' src=".$fetch[urlencode(image_link_1)]." /></td>
- <td><img class='thumb' src=".$fetch[rawurlencode(image_link_2)]." /></td>
- <td><img class='thumb' src=".$fetch[rawurlencode(image_link_3)]." /></td>
- </tr>
- ";
- }
- $output .="
- </tbody>
- </table>
- <a class='text-danger' href='#anchor'>Return to Top of Page</a>
- ";
- echo $output;
- }else{
- echo "<center><h4>Search Not Found!</h4></center>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement