|
|
@@ -11,6 +11,7 @@ include '../solr.php'; |
|
|
|
|
|
|
|
$core = 'all'; |
|
|
|
$random_titles = ten_random_titles($core); |
|
|
|
$additional_titles = ten_random_titles($core); |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
@@ -29,6 +30,8 @@ $random_titles = ten_random_titles($core); |
|
|
|
<div class="container"> |
|
|
|
|
|
|
|
<button class="float-end btn btn-danger" onclick="removeRandomTitle()">-</button> |
|
|
|
<button class="float-end btn btn-danger" onclick="addRandomTitle()">+</button> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
foreach ($random_titles as $record_array): |
|
|
@@ -56,8 +59,26 @@ foreach ($random_titles as $record_array): |
|
|
|
<?php |
|
|
|
endforeach; |
|
|
|
?> |
|
|
|
<span class="add_title"> |
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
<script> |
|
|
|
|
|
|
|
var titles = <?php echo json_encode($additional_titles); ?>; |
|
|
|
|
|
|
|
x = 0; |
|
|
|
|
|
|
|
function addRandomTitle(){ |
|
|
|
var record_array = titles[x]; |
|
|
|
let title = ""; |
|
|
|
for (const id in record_array) { |
|
|
|
title += record_array[id]; |
|
|
|
document.querySelector('.container').innerHTML += "<a href='id_search.php?id=" + id + "&core=all'><span class='title'>" + title + "</span></a><br><br><hr>"; |
|
|
|
x++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function removeRandomTitle() { |
|
|
|
var elts = document.getElementsByClassName("title"); |
|
|
|
var RandomSpan = elts[Math.floor(Math.random() * elts.length)]; |