Hiding Panel for SuiteP

Hello,

I want to restrict and hide panel according to security group. I did it with 7.8.12 version and it was working good until update to 7.12.5. My code doesn’t work with new version.
What is wrong, let me know please.

My Code is;

require_once('include/MVC/View/views/view.detail.php');

class ContactsViewDetail extends ViewDetail {

	function display() {

    	$role_to_check ="CIAD Comitee"; 

		$user_in_group = FALSE;  
		
		global $current_user;
		global $db;
		
		$getusergroup="select s.securitygroup_id as id from securitygroups_users s where s.deleted=0 and s.user_id='".$current_user->id."'
		and s.securitygroup_id in ('ae3d24dc-734d-4c21-149f-4c5035f8b5f8','d357b5ce-1c66-899d-03c9-4c6e20adcd36','8ad4e0e8-8eb4-d10a-a611-4c034f1c5e06')";
    
    	$resgetusergroup=$db->query($getusergroup, true);
		
		if($db->getRowCount($resgetusergroup)>0) {
    		$user_in_group = TRUE; 
		}		
		
	    $getuserindss="select s.securitygroup_id as id from securitygroups_users s where s.deleted=0 and s.user_id='".$current_user->id."' and s.securitygroup_id in ('8ad4e0e8-8eb4-d10a-a611-4c034f1c5e06')";
		$resgetuserindss=$db->query($getuserindss, true);
		if($db->getRowCount($resgetuserindss)>0) {
    		$user_in_dss = TRUE; 
		}	
		
		if (!$user_in_group){
            echo "<script>$(document).ready(function(){ $('#LBL_PANEL100').hide();";
			echo "$('#whole_subpanel_contacts_ahis_academichist').hide();";
			echo "$('#whole_subpanel_contacts_ahis_advisors').hide();});</script>";
			unset($this->dv->defs['templateMeta']['form']['panels']['lbl_panel100']); 

			$this->th2 = new TemplateHandler(); 
			$this->th2->clearCache($this->module); 
		}	
		
	
		if (!$user_in_dss){
            echo "<script>$(document).ready(function(){ $('#LBL_PANEL101').hide();$('#LBL_PANEL2').hide();});</script>";
			unset($this->dv->defs['templateMeta']['form']['panels']['lbl_panel101']); 
			unset($this->dv->defs['templateMeta']['form']['panels']['lbl_panel2']);
			$this->th2 = new TemplateHandler(); 
			$this->th2->clearCache($this->module); 
		}			

		$this->dv->process();
	
		echo $this->dv->display();
	}
	function process() {
  echo '<script src="custom/javascript/jquery/external/jquery/jquery.js" type="text/javascript"></script>';
  print '<style type="text/css">#create_link, #create_image{ display:none; }</style>';
        parent::process();
		}
}

please add the error reporting on your code
ini_set(‘display_errors’,1);
error_reporting(E_ALL);
Or
maybe the issue is a constructor

Thank you for response.
I solved my problem with changing label name. Because of new theme.

@dtosun , where did you find this object #whole_subpanel_contacts_ahis_academichist? that is the name of whole panel?

Yes, sure . It is name of the panel

@dtosun , it will work also on the panel in editview? because I want to show/hide a Personal Information Panel in edit view.