if (fetch_task_ready($tid) and !fetch_task_finished($tid) and !fetch_task_predecessor_wait($tid)) { $array_task_ready_index = count($array_task_ready); $array_task_ready[$array_task_ready_index] = $db_array_fetch_user_task[$i]; } } $array_task_ready_number = count($array_task_ready); if ($array_task_ready_number <= 1) { $array_task_ready_number_label = "task"; } else { $array_task_ready_number_label = "tasks"; } //Task Waiting $array_task_waiting = array(); for ($i = 0; $i < $tasks_number; $i++) { $tid = $db_array_fetch_user_task[$i]['tid']; if (fetch_task_ready($tid) and fetch_task_predecessor_wait($tid)) { $array_task_waiting_index = count($array_task_waiting); $array_task_waiting[$array_task_waiting_index] = $db_array_fetch_user_task[$i]; } } $array_task_waiting_number = count($array_task_waiting); if ($array_task_waiting_number <= 1) { $array_task_waiting_number_label = "task"; } else { $array_task_waiting_number_label = "tasks"; } //Task Finished $array_task_finished = array(); for ($i = 0; $i < $tasks_number; $i++) { $tid = $db_array_fetch_user_task[$i]['tid']; if (fetch_task_finished($tid)) {
function task_status($tid) { $status = ''; $db_array_task = fetch_task($tid); $db_array_task_history = fetch_task_history($tid); if (isset($db_array_task[0]['start']) and strtotime($db_array_task[0]['start']) > time()) { $status .= 'Not yet start. '; } if (isset($db_array_task_history[0]['version']) and count($db_array_task_history) >= 1) { $status .= 'Ver ' . $db_array_task_history[0]['version'] . ', (' . $db_array_task_history[0]['percent'] . '%) '; } if (isset($db_array_task[0]['end']) and strtotime($db_array_task[0]['end']) < time()) { $status .= 'Expired. '; } if (fetch_task_predecessor_wait($tid)) { $status .= 'Waiting for predecessor. '; } return $status; }