<?php
require_once("admin/inc/protecao-final.php");

@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_nome` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_email` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_whatsapp` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_logo` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_icone` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_background` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_facebook` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_instagram` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_twitter` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_site` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_chat` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_camera_studio` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_pedir_musica` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_cor_texto` CHAR(7) NOT NULL DEFAULT '#FFFFFF';");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_cor_menu_claro` CHAR(7) NOT NULL DEFAULT '#7386d5';");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_cor_menu_escuro` CHAR(7) NOT NULL DEFAULT '#6d7fcc';");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_visualizer` CHAR(6) NOT NULL DEFAULT '1';");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_exibir_capa` CHAR(3) NOT NULL DEFAULT 'sim';");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_url_youtube` VARCHAR(255) NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_text_prog` LONGTEXT NOT NULL;");
@mysqli_query($conexao,"ALTER TABLE `streamings` ADD `app_win_text_hist` LONGTEXT NOT NULL;");

$total_avisos_ativos = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM avisos WHERE area = 'streaming'"));
$checar_status_aviso = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM avisos_desativados WHERE area = 'streaming' AND codigo_usuario = '".$dados_stm["porta"]."'"));
$total_avisos_exibir = ($total_avisos_ativos > $checar_status_aviso) ? $total_avisos_ativos-$checar_status_aviso : 0;

$url_player = (!empty($dados_revenda["dominio_padrao"])) ? "player.".$dados_revenda["dominio_padrao"]."" : "player.".$dados_config["dominio_padrao"]."";

$dados_servidor_camera_studio = mysqli_fetch_array(mysqli_query($conexao,"SELECT * FROM servidores where codigo = '".$dados_stm["codigo_servidor_camera_studio"]."'"));

if($dados_servidor_camera_studio["nome_principal"]) {
$servidor_camera_studio = code_decode($dados_servidor_camera_studio["nome_principal"].".".$dados_config["dominio_padrao"],"E");
} else {
$servidor_camera_studio = code_decode($dados_servidor_camera_studio["nome"].".".$dados_config["dominio_padrao"],"E");
}

if($_POST["acao_form"] == "configurar") {

if($_FILES["logo"]["tmp_name"]) {
@copy($_FILES["logo"]["tmp_name"],$_SERVER['DOCUMENT_ROOT']."/player/app-win/logo-".$dados_stm["porta"].".png");
}
if($_FILES["fundo"]["tmp_name"]) {
@copy($_FILES["fundo"]["tmp_name"],$_SERVER['DOCUMENT_ROOT']."/player/app-win/background-".$dados_stm["porta"].".jpg");
}

$app_win_url_chat = ($_POST["ativar_chat"]) ? $_POST["app_win_url_chat"] : "";
$app_win_url_camera_studio = ($_POST["ativar_camera_studio"]) ? $_POST["app_win_url_camera_studio"] : "";
$app_win_url_pedir_musica = ($_POST["ativar_pedido_musica"]) ? $_POST["app_win_url_pedir_musica"] : "";
$app_win_exibir_capa = ($_POST["app_win_exibir_capa"]) ? "sim" : "nao";

$app_win_whatsapp = str_replace("+", "", $_POST["app_win_whatsapp"]);
$app_win_whatsapp = str_replace(" ", "", $_POST["app_win_whatsapp"]);
$app_win_whatsapp = str_replace("(", "", $_POST["app_win_whatsapp"]);
$app_win_whatsapp = str_replace(")", "", $_POST["app_win_whatsapp"]);

// Atualiza configuracoes do app com logo e fundo
mysqli_query($conexao,"Update streamings set app_win_nome = '".$_POST["app_win_nome"]."', app_win_email = '".$_POST["app_win_email"]."', app_win_whatsapp = '".$app_win_whatsapp."', app_win_url_facebook = '".$_POST["app_win_url_facebook"]."', app_win_url_instagram = '".$_POST["app_win_url_instagram"]."', app_win_url_twitter = '".$_POST["app_win_url_twitter"]."', app_win_url_site = '".$_POST["app_win_url_site"]."', app_win_visualizer = '".$_POST["app_win_visualizer"]."', app_win_cor_texto = '".$_POST["app_win_cor_texto"]."', app_win_cor_menu_claro = '".$_POST["app_win_cor_menu_claro"]."', app_win_cor_menu_escuro = '".$_POST["app_win_cor_menu_escuro"]."', app_win_url_logo = '/app-win/logo-".$dados_stm["porta"].".png', app_win_url_background = '/app-win/background-".$dados_stm["porta"].".jpg', app_win_url_chat = '".$app_win_url_chat."', app_win_url_camera_studio = '".$app_win_url_camera_studio."', app_win_url_pedir_musica = '".$app_win_url_pedir_musica."', app_win_text_prog = '".$_POST["app_win_text_prog"]."', app_win_text_hist = '".$_POST["app_win_text_hist"]."', app_win_url_youtube = '".$_POST["app_win_url_youtube"]."', app_win_exibir_capa = '".$app_win_exibir_capa."' where codigo = '".$dados_stm["codigo"]."'");

$_SESSION["status_acao"] = '<div class="alert alert-success text-center" role="alert">'.$lang['lang_info_config_painel_resultado_ok'].'</div>';

header("Location: /app-windows");
exit();
}

/////////////////////////////////////////////////
/////////////////// Idioma //////////////////////
/////////////////////////////////////////////////

if($dados_stm["idioma_painel"] == "pt-br") {

$lang[ 'lang_info_streaming_app_android_tab_app_pronto' ] = 'Pr&eacute;via App' ;
$lang[ 'lang_info_streaming_app_android_tab_configurar_app' ] = 'Configurar App' ;
$lang[ 'lang_info_streaming_app_android_info_configuracoes' ] = 'Ao alterar as configura&ccedil;&otilde;es abaixo, as mesmas ser&atilde;o atualizadas automaticamente no app sem precisar reinstalar.' ;
$lang[ 'lang_info_streaming_app_android_info_desativar_campo' ] = '(deixe este campo em branco para desativa-lo)';
$lang[ 'lang_info_streaming_app_android_app_cor_texto' ] = 'Cor Texto';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_claro' ] = 'Cor Menu Claro';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_escuro' ] = 'Cor Menu Escuro';
$lang[ 'lang_info_streaming_app_android_info_instalar_app' ] = 'Bot&atilde;o Instala&ccedil;&atilde;o:';
$lang[ 'lang_info_streaming_app_android_info_instalar_app2' ] = 'Coloque o c&oacute;digo acima em seu site, ao clicar, ser&aacute; aberto o app no navegador do ouvinte e ser&aacute; exibido uma mensagem para instala&ccedil;&atilde;o do app.';

} else if($dados_stm["idioma_painel"] == "en") {

$lang[ 'lang_info_streaming_app_android_tab_app_pronto' ] = 'App Preview' ;
$lang[ 'lang_info_streaming_app_android_tab_configurar_app' ] = 'Configure App' ;
$lang[ 'lang_info_streaming_app_android_info_configuracoes' ] = 'When changing the settings below, they will be updated automatically in the app without having to install again.' ;
$lang[ 'lang_info_streaming_app_android_info_desativar_campo' ] = '(leave empty to disable displaying)';
$lang[ 'lang_info_streaming_app_android_app_cor_texto' ] = 'Text Color';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_claro' ] = 'Menu Color Light';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_escuro' ] = 'Menu Color Dark';
$lang[ 'lang_info_streaming_app_android_info_instalar_app' ] = 'Install Button:';
$lang[ 'lang_info_streaming_app_android_info_instalar_app2' ] = 'Place the code above on your website, when clicking, it will be open the app in the listener\'s browser and a message is displayed to install the app.';

} else {

$lang[ 'lang_info_streaming_app_android_tab_app_pronto' ] = 'Vista Previa App' ;
$lang[ 'lang_info_streaming_app_android_tab_configurar_app' ] = 'Configurar App' ;
$lang[ 'lang_info_streaming_app_android_info_configuracoes' ] = 'Al cambiar la configuración a continuación, los datos se actualizarán automáticamente en la aplicación sin tener que instalar de nuevo.' ;
$lang[ 'lang_info_streaming_app_android_info_desativar_campo' ] = '(deje este campo en blanco para deshabilitarlo)';
$lang[ 'lang_info_streaming_app_android_app_cor_texto' ] = 'Color Texto';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_claro' ] = 'Color Menu Claro';
$lang[ 'lang_info_streaming_app_android_app_cor_menu_escuro' ] = 'Color Menu Oscuro';
$lang[ 'lang_info_streaming_app_android_info_instalar_app' ] = 'Botón de Instalación:';
$lang[ 'lang_info_streaming_app_android_info_instalar_app2' ] = 'Coloque el c&oacute;digo anterior en su sitio web, al hacer clic, abra la aplicaci&oacute;n en el navegador del oyente y se muestra un mensaje para instalar la aplicaci&oacute;n.';

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Streaming <?php echo $dados_stm["porta"]; ?></title>
  <link rel="stylesheet" href="/inc/materialdesignicons.min.css">
  <link rel="stylesheet" href="/inc/font-awesome.min.css">
  <link rel="stylesheet" href="/inc/vendor.bundle.base.css">
  <link rel="stylesheet" href="/inc/vendor.bundle.addons.css">
  <link rel="stylesheet" href="/inc/theme.css">
  <link rel="shortcut icon" href="/img/favicon.ico">
  <script type="text/javascript" src="/inc/ajax-streaming.js"></script>
  <script type="text/javascript" src="/inc/javascript.js"></script>
</head>

<body>
  <div class="container-scroller">
      <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
      <div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-center">
        <?php if($dados_revenda["url_logo"]) { ?>
        <a class="navbar-brand brand-logo" href="/dashboard"><img id="logo" src="<?php echo $dados_revenda["url_logo"]; ?>" title="Painel" height="60" border="0"></a>
        <?php } else { ?>
        <a class="navbar-brand brand-logo" href="/dashboard"><span>Painel Streaming</span></a>
        <?php } ?>
        <a class="navbar-brand brand-logo-mini" href="/dashboard"><img src="/img/icones/img-icone-logo.png" title="Painel" width="32" height="32" border="0"></a>
      </div>
      <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end justify-content-lg-start">
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
          <span class="mdi mdi-menu text-icones"></span>
        </button>
        <ul class="navbar-nav navbar-nav-right">
          <li class="nav-item nav-profile dropdown show">
            <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown" aria-expanded="true">
              <i class="fa fa-power-off f-18 text-icones" data-toggle="tooltip" data-placement="bottom" title="<?php echo $lang['lang_botao_titulo_ligar']; ?>/<?php echo $lang['lang_botao_titulo_desligar']; ?>"></i>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
              <a class="dropdown-item text-success" href="javascript:ligar_streaming('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_ligar']; ?> Streaming</a>
              <a class="dropdown-item text-danger" href="javascript:desligar_streaming('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_desligar']; ?> Streaming</a>
              <?php if($dados_stm["autodj"] == "sim") { ?>
              <div class="dropdown-divider"></div>              
              <a class="dropdown-item text-success" href="javascript:carregar_opcoes_ligar_autodj('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_ligar']; ?> AutoDJ</a>
              <a class="dropdown-item text-danger" href="javascript:desligar_autodj('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_desligar']; ?> AutoDJ</a>
              <?php } ?>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center" id="notificationDropdown" href="#" data-toggle="dropdown" aria-expanded="false">
              <i class="mdi mdi-bell f-22 text-icones" data-toggle="tooltip" data-placement="bottom" title="<?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?>"></i>
              <?php if($total_avisos_exibir > 0) { ?><span class="count bg-success"><?php echo $total_avisos_exibir; ?></span><?php } ?>           
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list" aria-labelledby="notificationDropdown">
              <a class="dropdown-item">
                <p class="mb-0 font-weight-normal float-left"><?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?></p>
              </a>
              <div class="dropdown-divider"></div>
              <?php carregar_avisos_streaming($conexao,$dados_stm["porta"],$dados_servidor["codigo"]); ?>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/sair"><i class="mdi mdi-logout f-22 text-icones" data-toggle="tooltip" data-placement="bottom" title="Sair/logout"></i></a>
          </li>
          <li>
            <button type="button" class="btn btn-info" id="status-streaming" onClick="status_streaming('<?php echo $porta_code; ?>');" style="margin: 10px;min-width: 150px; min-height: 40px"><i class="fa fa-refresh"></i></button>
          </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
          <span class="mdi mdi-menu text-icones"></span>
        </button>
      </div>
    </nav>

    <!-- modal -->
      <div class="modal fade" id="avisos" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body" id="avisos-conteudo"><img src="/img/ajax-loader.gif" align="center" /></div>
            </div>
        </div>
      </div>
                
      <div class="modal fade" id="playlists-autodj" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">AutoDJ</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body text-center" id="playlists-autodj-conteudo" style="text-align: center;"><img src="/img/ajax-loader.gif" /></div>
            </div>
          </div>
      </div>
                
      <div class="modal fade" id="log-sistema" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-body" id="log-sistema-conteudo" style="text-align:center"><img src="/img/ajax-loader.gif" /></div>
            </div>
        </div>
      </div>
      
    <div class="container-fluid page-body-wrapper">      
    <?php require_once("menu.php"); ?>
      <div class="main-panel">
        <div class="content-wrapper">
          <div id="local-status-acoes"><?php echo $_SESSION['status_acao'];unset($_SESSION['status_acao']); ?></div>
          <div class="row">            
            <?php if(!empty($dados_stm["app_win_nome"]) && !empty($dados_stm["app_win_url_logo"])) { ?>
            <div class="col-lg-12">
              <div class="card">
                  <div class="card-header">
                    <header><?php echo $lang['lang_info_streaming_app_android_tab_app_pronto']; ?></header>
                  </div>
                  <div class="card-body">
                      <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="65%" height="400" align="center"><iframe src="https://<?php echo $url_player; ?>/player-app-win/<?php echo $dados_stm["porta"]; ?>?app-win=preview" style="width:99%; height:350px" frameborder="0" onmousewheel=""></iframe></td>
    <td width="35%" align="center" style="padding:10px"><strong><?php echo $lang['lang_info_streaming_app_android_info_instalar_app']; ?></strong><br />
      <br /><a href="https://<?php echo $url_player; ?>/player-app-win/<?php echo $dados_stm["porta"]; ?>" target="_blank"><img src="https://<?php echo $url_player; ?>/app-win/img-instalar-app.png" width="150" height="48" /></a><br />
        <br /><textarea name="textarea" readonly="readonly" style="width:95%; height:70px;font-size:11px" onmouseover="this.select()"><a href="https://<?php echo $url_player; ?>/player-app-win/<?php echo $dados_stm["porta"]; ?>"><img src="https://<?php echo $url_player; ?>/app-win/img-instalar-app.png" width="150" height="48" /></a></textarea><br /><br /><span class="texto_padrao_pequeno"><?php echo $lang['lang_info_streaming_app_android_info_instalar_app2']; ?></span></td>
  </tr>
</table>
                  </div>
              </div>
            </div>           
            <?php } ?>
            <div class="col-lg-12">
              <div class="card">
                  <div class="card-header">
                    <header><?php echo $lang['lang_info_streaming_app_android_tab_configurar_app']; ?></header>
                  </div>
                  <div class="card-body">
                      <form method="post" action="/app-windows" style="padding:0px; margin:0px" enctype="multipart/form-data">
                                            <div class="alert alert-info text-center" role="alert"><?php echo $lang['lang_info_streaming_app_android_info_configuracoes']; ?></div>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
     <tr>
      <td width="20%" height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_radio_nome']; ?></td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_nome" type="text" id="app_win_nome" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_nome"]; ?>" />
        <br /></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">E-mail</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_email" type="text" id="app_win_email" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_email"]; ?>" /></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Site</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_url_site" type="text" id="app_win_url_site" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_url_site"]; ?>" />
        <br />
        <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">FaceBook</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_url_facebook" type="text" id="app_win_url_facebook" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_url_facebook"]; ?>" />
        <br />
        <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Twitter</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_url_twitter" type="text" id="app_win_url_twitter" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_url_twitter"]; ?>" />
        <br />
        <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr>    
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Instagram</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_url_instagram" type="text" id="app_win_url_instagram" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_url_instagram"]; ?>" />
        <br />
        <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr> 
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Canal YouTube</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_url_youtube" type="text" id="app_win_url_youtube" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_url_youtube"]; ?>" />
        <br />
        <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">WhatsApp</td>
      <td width="80%" class="texto_padrao_pequeno">
        <input name="app_win_whatsapp" type="text" id="app_win_whatsapp" style="width:350px" class="form-control" value="<?php echo $dados_stm["app_win_whatsapp"]; ?>" />
        <br />
        +00 00000000000 <?php echo $lang['lang_info_streaming_app_android_info_desativar_campo']; ?></td>
    </tr>
    <tr>
      <td width="20%" height="100" class="texto_padrao_destaque">Texto Programa&ccedil;&atilde;o</td>
      <td width="80%" class="texto_padrao_pequeno"><textarea name="app_win_text_prog" id="app_win_text_prog" style="width:350px" class="form-control" rows="5"><?php echo $dados_stm["app_win_text_prog"]; ?></textarea></td>
    </tr>
    <tr>
      <td width="20%" height="100" class="texto_padrao_destaque">Texto Hist&oacute;ria</td>
      <td width="80%" class="texto_padrao_pequeno"><textarea name="app_win_text_hist" id="app_win_text_hist" style="width:350px" class="form-control" rows="5"><?php echo $dados_stm["app_win_text_hist"]; ?></textarea></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Modulo Chat</td>
      <td width="80%" class="texto_padrao_pequeno"><input name="ativar_chat" type="checkbox" value="sim" <?php if($dados_stm["app_win_url_chat"]) { echo ' checked="checked"'; } ?> />
        <input name="app_win_url_chat" type="hidden" id="app_win_url_chat" value="<?php echo "/app-win/chat/".$dados_stm["porta"].""; ?>" /></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_modulo_pedido_musica']; ?>Modulo Pedido de Musicas</td>
      <td width="80%" class="texto_padrao_pequeno"><input name="ativar_pedido_musica" type="checkbox" value="sim" <?php if($dados_stm["app_win_url_pedir_musica"]) { echo ' checked="checked"'; } ?> />
        <input name="app_win_url_pedir_musica" type="hidden" id="app_win_url_pedir_musica" value="/app-win/pedido/<?php echo $dados_stm["porta"]; ?>" /></td>
    </tr>
    <?php if($dados_stm["camera_studio"] == "sim" && $dados_stm["camera_studio_instalado"] == "sim") { ?>    
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Modulo Camera Studio</td>
      <td width="80%" class="texto_padrao_pequeno"><input name="ativar_camera_studio" type="checkbox" value="sim" <?php if($dados_stm["app_win_url_camera_studio"]) { echo ' checked="checked"'; } ?> />
        <input name="app_win_url_camera_studio" type="hidden" id="app_win_url_camera_studio" value="https://player.<?php echo $dados_config["dominio_padrao"]; ?>/camera-studio/<?php echo $dados_stm["porta"]; ?>/<?php echo $servidor_camera_studio; ?>/16:9/true" /></td>
    </tr>
    <?php } else { ?> 
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque">Modulo Camera Studio</td>
      <td width="80%" class="texto_padrao_pequeno"><input name="ativar_camera_studio" type="checkbox" value="sim" <?php if($dados_stm["app_win_url_camera_studio"]) { echo ' checked="checked"'; } ?> />
        <input name="app_win_url_camera_studio" type="text" id="app_win_url_camera_studio" value="<?php echo $dados_stm["app_win_url_camera_studio"]; ?>" style="width:320px" /></td>
    </tr>
    <?php } ?> 
    <tr>
      <td width="21%" height="50" class="texto_padrao_destaque">Exibir Capa Artista</td>
      <td width="79%" class="texto_padrao_pequeno"><input name="app_win_exibir_capa" type="checkbox" value="sim" <?php if($dados_stm["app_win_exibir_capa"] == "sim") { echo ' checked="checked"'; } ?> /></td>
    </tr>
    <tr>
      <td height="50" class="texto_padrao_destaque">Visualizer(VU spectro)</td>
      <td class="texto_padrao_pequeno">
        <select name="app_win_visualizer" id="app_win_visualizer" style="width:100px; height:30px">
          <option value="1"<?php if($dados_stm["app_win_visualizer"] == "1") { echo ' selected="selected"'; } ?>>1</option>
          <option value="2"<?php if($dados_stm["app_win_visualizer"] == "2") { echo ' selected="selected"'; } ?>>2</option>
          <option value="3"<?php if($dados_stm["app_win_visualizer"] == "3") { echo ' selected="selected"'; } ?>>3</option>
          <option value="4"<?php if($dados_stm["app_win_visualizer"] == "4") { echo ' selected="selected"'; } ?>>4</option>
          <option value="5"<?php if($dados_stm["app_win_visualizer"] == "5") { echo ' selected="selected"'; } ?>>5</option>
          <option value="6"<?php if($dados_stm["app_win_visualizer"] == "6") { echo ' selected="selected"'; } ?>>6</option>
        </select></td>
    </tr> 
    <tr>
      <td height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_app_cor_texto']; ?></td>
      <td class="texto_padrao_pequeno">
        <input type="color" name="app_win_cor_texto" style="width:100px; height:30px" value="<?php echo $dados_stm['app_win_cor_texto']; ?>" /></td>
    </tr>
    <tr>
      <td height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_app_cor_menu_claro']; ?></td>
      <td class="texto_padrao_pequeno">
        <input type="color" name="app_win_cor_menu_claro" style="width:100px; height:30px" value="<?php echo $dados_stm['app_win_cor_menu_claro']; ?>" /></td>
    </tr>
    <tr>
      <td height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_app_cor_menu_escuro']; ?></td>
      <td class="texto_padrao_pequeno">
        <input type="color" name="app_win_cor_menu_escuro" style="width:100px; height:30px" value="<?php echo $dados_stm['app_win_cor_menu_escuro']; ?>" /></td>
    </tr>
    <tr>
      <td width="20%" height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_radio_logo']; ?></td>
      <td width="80%" class="texto_padrao_pequeno"><div class="input-group"><input name="logo" type="file" id="logo" style="width:60%" class="form-control" /><span class="input-group-append" id="basic-addon3"><label class="input-group-text">PNG / 300x300</label></span></div></td>
    </tr>
    <tr>
      <td height="50" class="texto_padrao_destaque"><?php echo $lang['lang_info_streaming_app_android_radio_fundo']; ?></td>
      <td class="texto_padrao_pequeno"><div class="input-group"><input name="fundo" type="file" id="fundo" style="width:60%" class="form-control" /><span class="input-group-append" id="basic-addon3"><label class="input-group-text">JPG / 1920x1080</label></span></div></td>
    </tr>
          <tr>
            <td height="40" colspan="2" align="center"><button type="submit" class="btn btn-info"><?php echo $lang['lang_botao_titulo_alterar_config']; ?></button><input name="acao_form" type="hidden" id="acao_form" value="configurar" /></td>
          </tr>
  </table>
  </form>
                  </div>
              </div>
            </div>

          </div>
        </div>
      </div>      

    </div>
  </div>
  <script src="/inc/vendor.bundle.base.js"></script>
  <script src="/inc/vendor.bundle.addons.js"></script>
  <script src="/inc/theme.js"></script>
  <script>
  status_streaming('<?php echo $porta_code; ?>');
  setInterval("status_streaming('<?php echo $porta_code; ?>')",60000);
  </script>
</body>
</html>