Based on link you said users would click on:
<a href="module/index.php?id='.$module_ID.'">Click Here</a>
The following code will never show your hidden value:
<input type="hidden" name="module" id="module" value="<?php if(isset($module_ID)){ echo $module_ID; } else {echo $class_ID;} ?>" />
This is because $module_ID never gets set on this page, only on the page the user came from. The page that contains your hidden field will only know the variable $id unless you change your link to read as below:
<a href="module/index.php?module_ID='.$module_ID.'">Click Here</a>
You've made your code too hard to debug by changing your variable name over and over.
While your change may work for now, the inconsistency of your code will probably just cause you more confusion down the road.
Just my 2 cents.
However, I'm glad you got your code working... 🙂