Subtask issue when writing a task organizer script
Asked By
20 points
N/A
Posted on - 07/19/2013
Hey techyv,
I am currently writing a task organizer script and am having difficulties with marking the subtasks as complete or not complete. My code is:
if($_POST['finished']){ // $_POST['finished'] is an html array of check boxes
 $subtask = Subtask::find_all_by_task_id($task->id);
 foreach($subtask as $stask){
 foreach($_POST['finished'] as $fin){Â
 if($stask->id == $fin){
 $stask->finished_at = date('Y-m-d H:i:s', time());
 $stask->save();
 } elseif($stask->id != $fin){
 $stask->finished_at = "";
 $stask->save();