<?php
class c_services_class_get_obj_childs
{
  function show()
  { //print_r($_GET) ;
  	$recs=select_db_obj_child_recs($_GET['id']) ;
  //print_2x_arr($recs) ;
    if (_sizeof($recs)) foreach($recs as $tkey=>$recs_tkey)
        if (_sizeof($recs_tkey)) foreach($recs_tkey as $clss=>$recs_clss)
		{  if (_sizeof($recs_clss)) foreach($recs_clss as $rec)
									$res[]=array(   'id'=>$rec['_reffer'],
												            'label'=>$rec['obj_name'],
												            'type'=>($rec['parent']==1)? 'theme':'section',
												            'parent'=>$rec['parent'],
												            'clss'=>$rec['clss'],
												            'has_children'=>($rec['cnt_subsections'] or $rec['cnt_questions'] or 1)? true:false
										                ) ;
		}
    echo json_encode($res) ;

  }
}
