Answer the question
In order to leave comments, you need to log in
Where does the output come from if there was no post request and how to check if there was a post request?
There is a script:
if(isset($_POST['date']) && $_POST['date'] != '') {
$result = ibase_query($dbh,
"SELECT Stat.* FROM STATHIST Stat INNER join (SELECT UnitID, MAX(DtStat) as
DtStat FROM STATHIST WHERE DtStat <= '".$_POST['date']."' GROUP BY UnitID) MaxD ON Stat.UnitID=MaxD.UnitID AND
Stat.DtStat=MaxD.DtStat") or die (ibase_errmsg());
} else {
$result = ibase_query($dbh, "SELECT * FROM STATREAL") or die (ibase_errmsg());
}
$units = array();
while($row=ibase_fetch_object($result)) {
$units[] = $row;
}
foreach($units as $unit) {
if(isset($units_coords[$unit->UNITID])) {
$coords = 'style="top:'.$units_coords[$unit->UNITID][0].'px; left:'.$units_coords[$unit->UNITID][1].'px;"';
//echo ($unit->UNITSTAT == 5) ? '<img src="/style/error.png" '.$coords.' class="icons">' : ($unit->UNITSTAT == 1) ? '<img src="/style/on.png" '.$coords.' class="icons">' : '';
if($unit->UNITSTAT == 5)
echo '<img src="/data/img/error.png" '.$coords.' class="icons">';
if ($unit->UNITSTAT == 1)
echo '<img src="/data/img/on.png" '.$coords.' class="icons">';
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question