Commit ad2932cc authored by dmorley's avatar dmorley

filter to only subdomain on table

parent 5459c5d7
......@@ -53,14 +53,14 @@ $table
});
var software = $('input:input[name="software"]').val();
var columns = [];
$.get('tabledata.php', function (html) {
$.get('tabledata.php?software=' + software, function (html) {
$('table tbody').append(html);
$('table').trigger('update', [true]);
$('.loadingtable').slideToggle('fast');
if (software) {
columns[3] = software;
$('table').trigger('search', [columns]);
}
//if (software) {
// columns[3] = software;
// $('table').trigger('search', [columns]);
//}
})
$('[data-toggle="tooltip"]').tooltip();
});
......@@ -17,7 +17,18 @@ $iso = new Matriphe\ISO639\ISO639;
$hiddensoftwares = c('hidden-softwares');
try {
$pods = R::getAll('
if ($_GET['software']) {
$pods = R::getAll('
SELECT domain, dnssec, podmin_statement, masterversion, shortversion, softwarename, daysmonitored, monthsmonitored, score, signup, protocols, name, country, countryname, city, state, detectedlanguage, uptime_alltime, active_users_halfyear, active_users_monthly, services, service_xmpp, latency, date_updated, ipv6, total_users, local_posts, comment_counts, userrating, status, date_laststats
FROM pods
WHERE status < ?
AND score > 0
AND softwarename NOT SIMILAR TO ?
AND softwarename = ?
ORDER BY weightedscore DESC
', [PodStatus::RECHECK, $hiddensoftwares, $_GET['software']]);
} else {
$pods = R::getAll('
SELECT domain, dnssec, podmin_statement, masterversion, shortversion, softwarename, daysmonitored, monthsmonitored, score, signup, protocols, name, country, countryname, city, state, detectedlanguage, uptime_alltime, active_users_halfyear, active_users_monthly, services, service_xmpp, latency, date_updated, ipv6, total_users, local_posts, comment_counts, userrating, status, date_laststats
FROM pods
WHERE status < ?
......@@ -25,6 +36,7 @@ try {
AND softwarename NOT SIMILAR TO ?
ORDER BY weightedscore DESC
', [PodStatus::RECHECK, $hiddensoftwares]);
}
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment