query($sql_delete); $sql =" INSERT INTO quotes_production_time (`quote_id`,`production_departments_id`,`hours`,`status`,`date_created`,`submitter`,`date_submitted`) VALUES ".$fac." "; $database->query($sql); $lastid = $database->insert_ID(); return $lastid; } public function get_labour_budget($job_id) { global $database; $sql =" SELECT SUM(hours) as total_hours from quotes_production_time WHERE quote_id = '$job_id' "; $results=$database->getRow($sql); return $results['total_hours']; } public function get_department_array($quote_id) { global $database; $sql =" SELECT production_departments_id as dept_id FROM quotes_production_time WHERE quote_id = '$quote_id' "; $results=$database->getAll($sql); return $results ; } }