You can use css or js for hiding a div. In else statement you can write it as:
else{
?>
<style type="text/css">#divId{
display:none;
}</style>
<?php
}
Or in jQuery
else{
?>
<script type="text/javascript">$('#divId').hide()</script>
<?php
}
Or in javascript
else{
?>
<script type="text/javascript">document.getElementById('divId').style.display = 'none';</script>
<?php
}