<?php
include_once('c_quiz_theme_card.php');
class c_page_cab_quiz_theme_card_db extends c_page_cab_quiz_theme_card
{
    public $h1='Контроль знаний - карточка раздела - Исходные данные';
    public $title=' - Исходные данные';
    var $use_textarea_autosize=1;

    function block_main()
    {
        $this->page_title();
        $this->panel_event();
    }

    function panel_event()
    {
        ?><button class="v1" cmd="check_structure">Проверить структуру разделов</button><?
        $recs=execSQL('select * from quiz_themes where pkey='.$this->rec_section['pkey']) ;
        print_2x_arr($recs);

        $recs=execSQL('select * from quiz_themes_text where parent='.$this->rec_section['pkey']) ;
        print_2x_arr($recs);
    }
    
    function CMD_check_structure()
    {   echo 'Проверяем структуру позразделов<br>' ;
        TREE('quiz_themes')->update_levels_parents('',['ext_table'=>'quiz_questions']);
        echo 'Проверка структуру выполнена<br>' ;


    }

    function get_page_obj_by_url($url)
    { echo '$url='.$url.'<br>' ;
      $options=cab_page_prepare($url) ;
      if ($options['class_file'] and $options['class_name'] and $options['ext'])
      {
          include_once(_DIR_EXT.'/'.$options['ext'].'/'.$options['class_file']) ;
          $page=new $options['class_name'] ;
          damp_array($page);
      }
      //damp_array($options);


    }


}

?>