<?php

// Get Tasks For Project
$query = 'SELECT * FROM tasks WHERE projectID=' . $editID .' AND display=1 ORDER BY dueDate DESC, taskID DESC'; 
$result = $con->query($query);

while ($row=$result->fetch_array(MYSQLI_ASSOC)) {
	$nameString_name = "taskName_". $row['taskID'];
	$descString_name = "taskDesc_". $row['taskID'];
	$priorityCurrent_name = "priorityCurrent_". $row['taskID'];
	$priorityString_name = "priority_". $row['taskID'];
	$startCurrent_name = "startCurrent_". $row['taskID'];
	$startString_name = "startDate_". $row['taskID'];
	$dueCurrent_name = "dueCurrent_". $row['taskID'];
	$dueString_name = "dueDate_". $row['taskID'];
	$statusCurrent_name = "statusCurrent_". $row['taskID'];
	$statusString_name = "taskStatus_". $row['taskID'];
		
	$taskPriority = getProjPriority($row['priority'],$con);
	$taskStatus = getTaskStatus($row['taskStatus'],$con);
	
	$timeInfo .= '<tr'. $rowShad .'>
						<td>'. $row['taskName'] .'</td>
						<td><div style="width: 250px">'. $row['taskDesc'] .'</div></td>
						<td>
							<input type="hidden" name="'. $priorityCurrent_name .'" value="'. $row['priority'] .'" />
							<select name="'. $priorityString_name .'">'. $taskPriority .'</select>
						</td>
						<td>
							<input type="hidden" name="'. $startCurrent_name .'" value="'. $row['startDate'] .'" readonly="readonly" class="dateField datepicker" />
							<input type="text" name="'. $startString_name .'" value="'. $row['startDate'] .'" readonly="readonly" class="dateField datepicker" />
						</td>
						<td>
							<input type="hidden" name="'. $dueCurrent_name .'" value="'. $row['dueDate'] .'" readonly="readonly" class="dateField datepicker" />
							<input type="text" name="'. $dueString_name .'" value="'. $row['dueDate'] .'" readonly="readonly" class="dateField datepicker" />
						</td>
						<td>
							<input type="hidden" name="'. $statusCurrent_name .'" value="'. $row['taskStatus'] .'" />
							<select name="'. $statusString_name .'">'. $taskStatus .'</select>
						</td>
					</tr>';	
		
	$hoursTotal = $hoursTotal + $row['timeAmount'];
	if ($row['billable'] == 1)
		$hoursBillable = $hoursBillable + $row['timeAmount'];
}

?>