Uploadscript verfeinert
This commit is contained in:
60
controller/admin_suche.php
Normal file
60
controller/admin_suche.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
require_once ("../config.inc.php");
|
||||
$function = $_POST['function'];
|
||||
|
||||
if ($function == 'titel')
|
||||
{
|
||||
if (isset($_POST["term"]))
|
||||
{
|
||||
$term = strtoupper(trim($_POST["term"]));
|
||||
|
||||
$query = "SELECT distinct titel FROM jumi_noten_daten WHERE upper(titel) LIKE '%" . $term . "%'";
|
||||
$result = $db->query($query) or die("Cannot execute titel");
|
||||
|
||||
if (mysqli_num_rows($result) > 0)
|
||||
{
|
||||
while ($row = $result->fetch_array())
|
||||
{
|
||||
$output[] = array(
|
||||
"label" => $row['titel'],
|
||||
"value" => $row['titel']
|
||||
);
|
||||
}
|
||||
#}else{
|
||||
# $output[] = array("label" => "keine Treffer");
|
||||
|
||||
}
|
||||
|
||||
echo json_encode($output);
|
||||
}
|
||||
}
|
||||
|
||||
if ($function == 'verlag')
|
||||
{
|
||||
if (isset($_POST["term"]))
|
||||
{
|
||||
$term = strtoupper(trim($_POST["term"]));
|
||||
|
||||
$query = "SELECT distinct verlag FROM jumi_noten_daten WHERE upper(verlag) LIKE '%" . $term . "%'";
|
||||
$result = $db->query($query) or die("Cannot execute verlag");
|
||||
|
||||
if (mysqli_num_rows($result) > 0)
|
||||
{
|
||||
while ($row = $result->fetch_array())
|
||||
{
|
||||
$output[] = array(
|
||||
"label" => $row['verlag'],
|
||||
"value" => $row['verlag']
|
||||
);
|
||||
}
|
||||
#}else{
|
||||
# $output[] = array("label" => "keine Treffer");
|
||||
|
||||
}
|
||||
|
||||
echo json_encode($output);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user