<?
function WORKGROUPS($options=array())
{
  if (isset($GLOBALS['workgroups'])){return($GLOBALS['workgroups']);}
  else {$GLOBALS['workgroups']=new i_account($options);return($GLOBALS['workgroups']);}
}

class i_workgroups
{

 public $recs=[] ;

 function __construct()
 {  $this->upload_list_workgroups() ;
 }

 function upload_list_workgroups()
 {
     $this->recs=execSQL('select * from view_workgroups order by obj_name') ;
     if (_sizeof($this->recs)) foreach($this->recs as $id=>$rec_workgroup)
     {
         $this->recs[$id]['_filter_set']=json_decode($rec_workgroup['filter_set'],true) ;
     }

 }


}
?>
