<?php
include_once('c_db_table.php');
class c_page_cab_db_table_check extends c_page_cab_db_table
{

    public $h1='Проверки таблицы';


    function block_main()
    {
        $this->page_title($this->table_name);
        ?><button class="v1" cmd="check_table">Проверить таблицу</button>&nbsp;<?
        $recs=execSQL('describe '.$this->table_name.' ');
        if (isset($recs['parent2'])) ?><button class="v1" cmd="check_tree">Проверить структуру дерева</button>&nbsp;<?
        //damp_array($recs);

    }

    function CMD_check_table()
    {
        include('i_table_checked.php') ;
        table_checked(_DOT($this->table_name)->pkey) ;
    }

    function CMD_check_tree()
    {
        TREE($this->table_name)->update_levels_parents();
    }
}

?>
