- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
$bCancel = false;
while(!$bCancel)
{
$bCnt++;
$sql = "SELECT id, rDateTime, pDateTime, longitude, latitude, speed, reportId, inputs, peopIn, peopOut, COUNT(*) AS cnt FROM $tbname AS tblCur
WHERE ".$repIds." AND pDateTime>'$fd' AND unitId=$unitid
GROUP BY pDateTime, reportId ORDER BY pDateTime ASC LIMIT 0, 50";
$request = mysql_query($sql) or die(mysql_error());
$rCnt = 0;
while(!$bCancel)
{
if($row=mysql_fetch_assoc($request))
{
if(!arrZoneCoordContains($row['longitude'],$row['latitude'],$arrZoneCoord[$zoneId]))
{
$bCancel = true;
}
$fd = $row['pDateTime'];
array_push($arrRows, $row);
$rCnt++;
}
elseif($rCnt==0)
$bCancel=true;
}
}