INSERT INTO `sc_tb_menu` (`id`, `pai`, `nome`, `icone`, `tipo`, `local`, `arquivo`, `url`, `target`, `ativo`, `modulo`, `ordem`, `ad_a_click`, `ad_p_nome`, `ad_p_nome_cor`, `cor_nome`, `cor_icone`, `temp`) VALUES
('kiosk_01', '000', 'Kiosk', 'activity', 'N', '.content-body', NULL, '#', NULL, 1, 'kiosk', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('kiosk_02', 'kiosk_01', 'Gerenciar', 'monitor', 'C', '.content-body', 'mod/kiosk/tb_kiosk.php', '#', NULL, 1, 'kiosk', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL);

INSERT INTO `sc_tb_modulos` (`modulo`) VALUES ('kiosk');

CREATE TABLE IF NOT EXISTS `kiosk_tb_kiosk` (
  `idg` int(11) NOT NULL AUTO_INCREMENT,
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `token` varchar(250) NOT NULL,
  `titulo` varchar(50) DEFAULT NULL,
  `descricao` varchar(3000) DEFAULT NULL,
  `logo` varchar(300) DEFAULT 'img/logo.png',
  `email` varchar(250) NOT NULL,
  `carrossel` int(11) NOT NULL DEFAULT 0,
  `carl1` varchar(250) DEFAULT NULL,
  `carl2` varchar(250) DEFAULT NULL,
  `carl3` varchar(250) DEFAULT NULL,
  `carl4` varchar(250) DEFAULT NULL,
  `carl5` varchar(250) DEFAULT NULL,
  `carl6` varchar(250) DEFAULT NULL,
  `btnserv` int(11) NOT NULL DEFAULT 0,
  `mdata` int(11) NOT NULL DEFAULT 0,
  `mhora` int(11) NOT NULL DEFAULT 0,
  `barrad` int(11) NOT NULL DEFAULT 1,
  `kiosk_conf` varchar(300) NOT NULL,
  `kiosk_file` varchar(150) NOT NULL,
  `ki_nome` varchar(200) DEFAULT NULL,
  `ki_connection` varchar(15) NOT NULL DEFAULT 'wired',
  `ki_dhcp` varchar(15) NOT NULL DEFAULT 'yes',
  `ki_browser` varchar(15) NOT NULL DEFAULT 'firefox',
  `ki_mouse_cursor_size` varchar(15) NOT NULL DEFAULT 'large',
  `ki_enable_file_protocol` varchar(15) NOT NULL DEFAULT 'yes',
  `ki_homepage` varchar(350) NOT NULL DEFAULT 'mod/kiosk/index.php',
  `ki_session_idle` varchar(10) DEFAULT '5',
  `ki_primary_keyboard_layout` varchar(15) NOT NULL DEFAULT 'br',
  `ki_default_microphone` varchar(10) NOT NULL DEFAULT '0.0',
  `ki_disable_navigation_bar` varchar(10) NOT NULL DEFAULT 'yes',
  `ki_scheduled_action` varchar(250) DEFAULT 'Monday-20:30 Tuesday-on Wednesday-on Thursday-on Friday-on action:halt',
  `ki_allow_popup_windows` varchar(10) NOT NULL DEFAULT 'yes',
  `ki_printer_connection` varchar(25) NOT NULL DEFAULT 'direct',
  `ki_printer_model` varchar(250) DEFAULT 'Zebra CPCL Label Printer',
  `ki_root_password` varchar(20) NOT NULL DEFAULT '123456',
  `ki_rtc_wake` varchar(250) DEFAULT 'Monday-06:00 Tuesday-on Wednesday-on Thursday-on Friday-on',
  `ki_default_sound_card` varchar(10) NOT NULL DEFAULT '0.0',
  `ki_volume_level` varchar(10) NOT NULL DEFAULT '97%',
  `ki_timezone` varchar(50) NOT NULL DEFAULT 'America/Sao_Paulo',
  `ki_vnc_interactive` varchar(10) NOT NULL DEFAULT 'yes',
  `ki_vnc_password` varchar(20) NOT NULL DEFAULT '123456',
  `ki_wallpaper` varchar(350) NOT NULL DEFAULT 'mod/kiosk/img/wp1.jpg',
  `ki_whitelist` varchar(2000) DEFAULT 'https://cadastro.saude.gov.br/segcartao/ ',
  `ki_blacklist` varchar(2000) DEFAULT NULL,
  `ki_wake_on_lan` varchar(10) NOT NULL DEFAULT 'yes',
  `ki_additional_components` varchar(350) NOT NULL DEFAULT '09-x11vnc.xzm uefi.zip 10-printing.xzm',
  `ki_onscreen_buttons` varchar(10) NOT NULL DEFAULT 'home',
  `ki_onscreen_buttons_position` varchar(10) NOT NULL DEFAULT 'top',
  `ki_disable_numlock` varchar(10) NOT NULL DEFAULT 'no',
  `ki_hide_mouse` varchar(10) NOT NULL DEFAULT 'no',
  `ki_virtual_keyboard` varchar(10) NOT NULL DEFAULT 'no',
  `ki_disable_zoom_controls` varchar(10) NOT NULL DEFAULT 'no',
  `ki_browser_zoom_level` varchar(10) NOT NULL DEFAULT '1.0',
  `ki_refresh_webpage` varchar(10) DEFAULT '0',
  `ki_removable_devices` varchar(10) NOT NULL DEFAULT 'yes',
  `ki_ntp_server` varchar(100) NOT NULL DEFAULT 'pool.ntp.org',
  `ki_hostname` varchar(10) NOT NULL DEFAULT '',
  `ki_screen_rotate` varchar(10) NOT NULL DEFAULT 'normal',
  `ki_ip_address` varchar(16) DEFAULT '0.0.0.0',
  `ki_default_gateway` varchar(16) DEFAULT '0.0.0.0',
  `ki_netmask` varchar(16) DEFAULT '0.0.0.0',
  `ki_dns_server` varchar(70) DEFAULT '0.0.0.0',
  `ki_network_interface` varchar(10) NOT NULL DEFAULT 'eth0',
  `ki_ssid_name` varchar(50) DEFAULT '',
  `ki_wifi_encryption` varchar(10) DEFAULT 'wpa',
  `ki_wpa_password` varchar(50) DEFAULT '',
  `ki_wep_key` varchar(20) DEFAULT '',
  `ki_vnc_port` varchar(10) DEFAULT '5900',
  `ki_printer_name` varchar(150) DEFAULT 'kiosk-printer',
  `ki_paper_size` varchar(10) DEFAULT 'A4',
  `ki_silent_printing` varchar(10) DEFAULT 'yes',
  `ki_share_printer` varchar(10) DEFAULT 'yes',
  `ki_proxy_config` varchar(150) DEFAULT '',
  `ki_proxy` varchar(150) DEFAULT '',
  `ki_proxy_exceptions` varchar(350) DEFAULT '',
  primary key(idg)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_kiosk` int(11) NOT NULL,
  `url` varchar(300) NOT NULL,
  `nome` varchar(30) NOT NULL,
  `cor` varchar(50) NOT NULL DEFAULT 'primary',
  `target` varchar(30) NOT NULL DEFAULT '_blank',
  `botao` varchar(15) NOT NULL DEFAULT 'Site',
  `logo` varchar(300) NOT NULL DEFAULT 'img/logolink.svg',
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_links_tmp` (
  `idtmp` varchar(100) NOT NULL,
  `url` varchar(300) NOT NULL,
  `nome` varchar(30) NOT NULL,
  `cor` varchar(50) NOT NULL DEFAULT 'primary',
  `target` varchar(30) NOT NULL DEFAULT '_blank',
  `botao` varchar(15) NOT NULL DEFAULT 'Site',
  `logo` varchar(300) NOT NULL DEFAULT 'img/logolink.svg',
  `tempo` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_lista` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_kiosk` int(11) NOT NULL,
  `tipo` varchar(15) NOT NULL DEFAULT 'whitelist',
  `url` varchar(300) NOT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_lista_tmp` (
  `idtmp` varchar(100) NOT NULL,
  `tipo` varchar(15) NOT NULL DEFAULT 'whitelist',
  `url` varchar(300) NOT NULL,
  `tempo` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_onoff` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_kiosk` int(11) NOT NULL,
  `tipo` varchar(15) NOT NULL DEFAULT 'on',
  `dsemana` varchar(50) NOT NULL,
  `hora` varchar(5) NOT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_onoff_tmp` (
  `idtmp` varchar(100) NOT NULL,
  `tipo` varchar(15) NOT NULL DEFAULT 'on',
  `dsemana` varchar(50) NOT NULL,
  `hora` varchar(5) NOT NULL,
  `tempo` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_servicos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_kiosk` int(11) NOT NULL,
  `id_servico` int(11) NOT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `kiosk_tb_servicos_tmp` (
  `idtmp` varchar(100) NOT NULL,
  `id_servico` int(11) NOT NULL,
  `tempo` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;