getRow($select); $department_id = $department['id'];*/ $database->StartTrans(); if($status) { $insert = " INSERT INTO job_trackings_completed (job_id,department_id,submitter,date_submitted) VALUES ('$job_id','$department_id','$submitter','$current_date_time') "; $database->query($insert); $department = common_department::production_department_name($department_id); logs::submit_logs(array("table" => "jobs", "action_type" => 18,"foreign_id" => $job_id, "description" => "Completed ".$department." for Job #".$job.",")); } else { $delete = " DELETE FROM job_trackings_completed WHERE department_id='$department_id' "; $database->query($delete); $department = common_department::production_department_name($department_id); logs::submit_logs(array("table" => "jobs", "action_type" => 18,"foreign_id" => $job_id, "description" => "Opened ".$department." for Job #".$job.",")); } $result = $database->CompleteTrans(); if($result){ $status = true; } else{ $status = false; } $results = array("status" => $status,"reasons" => $reasons); $json = json_encode($results); echo $json;