NEW: Use DB row for job status and refactor the sql statements
NEW: Fixing queuedjob status and hiding report button when report is running