Commit 7ad95141 authored by Porter Libby's avatar Porter Libby
Browse files

add streaming host value to query

parent 878d0b07
......@@ -336,7 +336,7 @@ function getStreamingsHosts(sector_id){
s_count.push(response[x].s_count)
}
console.info('DATA - HOSTS');
console.table(response);
console.log(response);
renderStreamingsHosts(hosts, s_count);
},
error: function(xhr, status, err) {
......
......@@ -45,7 +45,7 @@ function switchToData(){
// TEAMPLATES FOR DOM PIECES
// generalized formula
function createRadioElement(name, id, label, f, count=999){
function createRadioElement(name, id, label, f, count=999){ // assign 999 if no value present.
var radioHtml = '<div class="elem-div elem-'
if (count == 0){
......
......@@ -164,6 +164,7 @@ const getReadings = (request, response) => {
}
const getStreamingsHosts = (request, response) => {
var query = 'SELECT DISTINCT hostid, '
+ "(SELECT COUNT(*) FROM fieldday_streaming WHERE tripid="+ (request.query.tripid) + ' and siteid=' + (request.query.siteid) + ' AND sectorid=' + request.query.sectorid + " AND hostid=fieldday_streaming.hostid) AS s_count, "
+'(SELECT DISTINCT hostname FROM fieldday_host_temp where hostid=fieldday_streaming.hostid)'
+' FROM fieldday_streaming where tripid='+ (request.query.tripid)
+' and siteid='+ (request.query.siteid)
......
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