<?php
include_once(_DIR_TO_CLASS.'/c_page.php');
class c_page_cab_db_table extends c_page
{

    var $table_name ;
    var $table_id ;
    public $h1='Дамп таблицы';
    public $cur_window_mode='window';

    function select_obj_info()
    {
        if($this->filter['table_name'])
        {   $this->table_name=$this->filter['table_name'];
            $this->table_id=_DOT($this->table_name)->pkey ;
            $this->h1.=' <strong>'.$this->table_name.'</strong>' ;

            $arr_tables=execSQL_line('show tables') ;
            if(!in_array($this->table_name,$arr_tables)) $this->result=404;
            reboot_engine();
        }
    }

    function second_menu_config()
    { // вкладки для сотрудника
       $this->second_menu['/window/db/table/[table_name='.$this->table_name.']/']='Дамп таблицы';
       $this->second_menu['/window/db/table/[table_name='.$this->table_name.']/structure/']='Структура таблицы';
       $this->second_menu['/window/db/table/[table_name='.$this->table_name.']/check/']='Операции';
       $this->second_menu['/window/db/table/[table_name='.$this->table_name.']/DOT/']='DOT' ;

    }

    function block_main()
    {
        $this->page_title();
        $recs=execSQL('select * from '.$this->table_name.' order by pkey desc limit 500') ;
        print_2x_arr($recs);
    }
}

?>