I don't fully understand your question, but structuring your checkbox fields like this will provide an array:
<input type='checkbox' name='available_items[UNKNOWN]' value='$itemnamelol'>
Then, an array of $_POST['available_items'] will be created. I assume in the above code that UNKNOWN changes from entry-to-entry.
Now, taking a look at the code you provided, I would probably structure them like
<input type='checkbox' name='available_items[]' value='$itemidid'> $itemnamelol
Which would display the item and then have a checkbox next to it whose value was $itemidid. Then, you could get the available_items by code like this:
foreach ($_POST['available_items'] as $itemidid) {
//Do whatever you want with the item ids.
}