You have syntax errors. Try to use this
if($type=='1'){$link_medalje="<a href="https://stackoverflow.com/questions/25112942/javascript:void(0);" onmouseover="prikazimis(\"Administrator\');" onmouseout="sakrijmis();"><img src=""></a>';}
2
solved onmouseover and onmouseout not work