mirror of
https://github.com/Theodor-Springmann-Stiftung/pantoiaperiodica.git
synced 2025-10-29 09:05:31 +00:00
Initial
This commit is contained in:
27
src/civis-romanus_scriptor-latinus/auto_ver.php
Normal file
27
src/civis-romanus_scriptor-latinus/auto_ver.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
//
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/db_connection.php';
|
||||
include("php/namen.inc.php");
|
||||
//
|
||||
if (!isset($_GET["term"])) { exit; } // "term" ist von jQuery-autocomplete festgelegt!
|
||||
$suchwort = addslashes($_GET["term"]);
|
||||
$db_feld = ($_GET["db_feld"]);
|
||||
//
|
||||
$sql_select = "SELECT DISTINCT (" . $db_feld .") FROM cr_sl WHERE (" . $db_feld . " LIKE '%" . $suchwort . "%' OR " . $db_feld . " LIKE '%«" . $suchwort . "%') AND (Uebersetzung = 1) ORDER BY ". $db_feld . " ASC";
|
||||
$sql_result = $db->query($sql_select);
|
||||
//
|
||||
while ($row = $sql_result->fetch_object()) {
|
||||
if(($db_feld == "Autor") or ($db_feld == "Originalautor")){$d = erster_name($row->$db_feld);} else {$d = $row->$db_feld;}
|
||||
// zu lange Ausgaben kürzen
|
||||
if (strlen($d) > 60) {
|
||||
$d = preg_replace("/[^ ]*$/", '', substr($d, 0, 60));
|
||||
}
|
||||
// jQuery-autocomplete verlangt "value-label"
|
||||
$data[] = array('value' => $d, 'label' => $d);
|
||||
}
|
||||
//
|
||||
echo json_encode($data);
|
||||
ob_flush();
|
||||
flush();
|
||||
//
|
||||
?>
|
||||
Reference in New Issue
Block a user