|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?php
-
- # @name: search.php
- # @version: 0.1
- # @creation_date: 2021-09-30
- # @license: The MIT License <https://opensource.org/licenses/MIT>
- # @author: Simon Bowie <ad7588@coventry.ac.uk>
- # @purpose: Searches the Solr index
-
- include '../solr.php';
- include '../text_functions.php';
-
- ?>
-
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Performing Patents Otherwise: Archival conversations with 320.000 clothing inventions</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
- <link rel="stylesheet" type="text/css" href="css/style.css">
- </head>
- <body>
-
- <div class="container">
-
- <?php
-
- $search_results = solr_search($_POST["search"], $_POST["searchopt"], $_POST["sort"]);
-
- if(is_array($search_results)):
-
- foreach($search_results as $result):
-
- $result = highlight_search_terms($result, $_POST["search"]);
- ?>
- Application ID:
-
- <a href="id_search.php?id=<? echo $result['id']; ?>&core=<? echo $_POST['searchopt']; ?>">
- <?php
- echo $result['application_id'];
- ?>
- </a>
-
- <br><br>
-
- Year:
-
- <?php
- echo $result['year'];
- ?>
-
- <br><br>
-
- EPO publication:
-
- <a href=<?php echo $result['epo_publication_url']; ?>>
- <?php
- echo $result['epo_publication_url'];
- ?>
- </a>
-
- <br><br>
-
- IPC publication:
-
- <a href=<?php echo $result['ipc_publication_url']; ?>>
- <?php
- echo $result['ipc_publication_url'];
- ?>
- </a>
-
- <br><br>
-
- <?php
- if (isset($result['title'])):
- ?>
-
- Title:
-
- <?php
- echo $result['title'];
- ?>
-
- <br><br>
-
- <?
- endif;
- ?>
-
- <?php
- if (isset($result['abstract'])):
- ?>
-
- Abstract:
-
- <?php
- echo $result['abstract'];
- ?>
-
- <br><br>
-
- <?
- endif;
- ?>
-
- <hr>
-
- <?php
- endforeach;
-
- else:
- echo $search_results;
- endif;
- ?>
-
- </div>
- <script>
- let text = "<?php echo $_POST["search"]; ?>";
- upperText = text.toUpperCase();
- result = "<span style='color:orange'>" + upperText + "</span>";
- const collection = document.getElementsByClassName("search_term");
- for (let i = 0; i < collection.length; i++) {
- collection[i].innerHTML = result;
- }
- </script>
- </body>
- </html>
|