/** * Returns the specify bookdata foreach element of an array with the inventory data. * @param $inventory */ function getBookCodesByInvData($inventory) { $bookmanager = new BookManager(); require_once PATH_ACCESS . '/DBConnect.php'; foreach ($inventory as &$inventor) { $bookinfos[] = $bookmanager->getBookDataById($inventor['book_id']); } $counter = 0; if (isset($bookinfos)) { foreach ($bookinfos as &$bookinfo) { $bookcode[$counter]['id'] = $inventory[$counter]['id']; $bookcode[$counter]['code'] = $bookinfo['subject'] . ' ' . $inventory[$counter]['year_of_purchase'] . ' ' . $bookinfo['class'] . ' ' . $bookinfo['bundle'] . ' / ' . $inventory[$counter]['exemplar']; $counter++; } return $bookcode; } }