Example #1
0
 protected static function __build_tab__(){
     if (empty(self::$__par['tab-query'])) { return; }
     $hdn = self::$form->add(new hidden_box('osy[tid]'));
     $sql = env::ReplaceVariable(self::$__par['tab-query']);
     $rs  = env::$dba->exec_query(env::ReplaceVariable($sql),null,'NUM');
     $tab = new tab('tabs');
     
     $tab->att('style','border-top: 1px solid white; padding-top: 3px;');
     foreach($rs as $i => $rec)
     {
         if ((empty($_REQUEST['osy']['tid']) && empty($i)) || $_REQUEST['osy']['tid'] == $rec[0])
         {
             $tab->att('tabsel',$i);
             $hdn->value = $_REQUEST['osy']['tid'] = $rec[0];
             //self::$__bod = new addressbook('data-view');
             self::$__bod = new oaddressbook('data-view',env::$dbo,'',$_REQUEST['pag']);
             self::$__bod->att('filter_id',$rec[0]);
             self::$__bod->add_filter('_tab',$rec[0]);
             $tab->put($rec[1],self::$__bod,$i*10,10);
         } 
          else
         {
             $tab->put($rec[1],'<div style="text-align: center; margin-top: 100px;" filter_id="'.$rec[0].'">Data loading.... Please wait</div>',$i*10,10);
         }
     }
     self::$form->put($tab,'','',100,10);
 }