r15476 fixes both this and #1218
Note that getqcount.php is called from loi.php and refreshed each time loi refreshes.
For this part, a link to queuecount.php is displayed rather than running the long query if there are more than 500 targets in queue of the session. Also, a limit is put on the query for estimating the average processing time so that if a small unprocessed queue is in a session of a large number of processed queue will be faster and more accurate because the estimate will be based on later ones.
Eric, if you know how to speed this series of queries up, please let me know.
Testing:
1. visit myamiweb/loi.php for session 11feb28a. This has a big queue, but by the time this code is tested, it will be done so that the query should take a few seconds at most at its linked page.
2. visit the same site on a session that is currently running. If the queue is not big, the box showing the result should refresh within seconds.