Are there actually any terms in your dahn_muc
custom taxonomy? get_terms
won’t return anything if no terms have been created.
Also, how did you create your custom taxonomy? I usually rely on GenerateWP.com’s taxonomy generator to make sure everything’s done properly.
Lastly, it might be better to reverse how you populate your $inra
array. Use the term IDs as the keys, instead of the values:
foreach ( $danhmucs as $danhmuc ) {
...
$inra[$iddm] = $tendm;
...
}