A search interface for data from the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office API. https://patents.copim.ac.uk
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

152 lines
2.7KB

  1. <?php
  2. # @name: random.php
  3. # @version: 0.1
  4. # @creation_date: 2021-09-24
  5. # @license: The MIT License <https://opensource.org/licenses/MIT>
  6. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  7. # @purpose: Displays a random record from the Solr index
  8. include '../solr.php';
  9. include '../ops_api.php';
  10. $core = 'all';
  11. $random_record = one_random_record($core);
  12. $publication_details = get_publication_details($random_record['doc_ref']);
  13. ?>
  14. <!DOCTYPE html>
  15. <html lang="en">
  16. <head>
  17. <meta charset="utf-8">
  18. <meta name="viewport" content="width=device-width, initial-scale=1">
  19. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  20. <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>
  21. <link rel="stylesheet" type="text/css" href="css/style.css">
  22. </head>
  23. <body>
  24. <div class="container-fluid">
  25. Application ID:
  26. <a href="id_search.php?id=<? echo $random_record['id']; ?>&core=all">
  27. <?php
  28. echo $random_record['application_id'];
  29. ?>
  30. </a>
  31. <br><br>
  32. Year:
  33. <?php
  34. echo $random_record['year'];
  35. ?>
  36. <br><br>
  37. EPO publication:
  38. <a href=<?php echo $random_record['epo_publication_url']; ?>>
  39. <?php
  40. echo $random_record['epo_publication_url'];
  41. ?>
  42. </a>
  43. <br><br>
  44. IPC publication:
  45. <a href=<?php echo $random_record['ipc_publication_url']; ?>>
  46. <?php
  47. echo $random_record['ipc_publication_url'];
  48. ?>
  49. </a>
  50. <br><br>
  51. <?php
  52. if (isset($random_record['title'])):
  53. ?>
  54. Title:
  55. <?php
  56. echo $random_record['title'];
  57. ?>
  58. <br><br>
  59. <?php
  60. endif;
  61. ?>
  62. <?php
  63. if (isset($publication_details['original_title'])):
  64. ?>
  65. Original language title:
  66. <?php
  67. echo $publication_details['original_title'];
  68. ?>
  69. <br><br>
  70. <?php
  71. endif;
  72. ?>
  73. <?php
  74. if (isset($random_record['abstract'])):
  75. ?>
  76. Abstract:
  77. <?php
  78. echo $random_record['abstract'];
  79. ?>
  80. <br><br>
  81. <?
  82. endif;
  83. ?>
  84. <?php
  85. if (isset($publication_details['original_abstract'])):
  86. ?>
  87. Original language abstract:
  88. <?php
  89. echo $publication_details['original_abstract'];
  90. ?>
  91. <br><br>
  92. <?php
  93. endif;
  94. ?>
  95. <?php
  96. if (check_for_images($random_record['doc_ref'])):
  97. ?>
  98. <?php
  99. $image = get_images($random_record["doc_ref"]);
  100. ?>
  101. <?php
  102. echo '<img class="img-fluid" src="data:image/jpg;base64,'.base64_encode($image->getImageBlob()).'" alt="Drawing of patent" />';
  103. ?>
  104. <?php
  105. endif;
  106. ?>
  107. </div>
  108. </body>
  109. </html>