<?php
/**
 * Добавляем поля в таблицу полей для модуля IP-телефонии Oktell
 * Created by: Andrey
 * Release: 12.06.2014
 * App Version: 2.0.3
 * Copyright: Clientbase (www.clientbase.ru)
 */

$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_oktell_servers LIKE 'table_id'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_oktell_servers ADD table_id INT NOT NULL");
}
$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_oktell_servers LIKE 'field_id_phone'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_oktell_servers ADD field_id_phone INT NOT NULL");
}
$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_oktell_servers LIKE 'field_id_name'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_oktell_servers ADD field_id_name INT NOT NULL");
}
?>