<?php
session_start();

$nivel_necessario = 6;
$id_user = $_SESSION['UsuarioID'];

// Verifica se não há a variável da sessão que identifica o usuário
if (!isset($_SESSION['UsuarioID']) OR ( $_SESSION['UsuarioNivel'] > $nivel_necessario)) {
// Destrói a sessão por segurança
    session_destroy();
// Redireciona o visitante de volta pro login
    header("Location: index.php");
    exit;
}

require_once("db.php");

if (!empty($_GET['edit'])) {

    $editar = $_GET['edit'];

    $resultEdit = mysql_query("SELECT idprod,porcent_acumu, acum1min,acum2min, acum3min, acum4min, acum1med, acum2med, acum3med,acum4med, 
        acum1max, acum2max, acum3max, acum4max, zerar,destrava, validade, dificuldade,id_ponto, ponto.nome,tablet.cliente,tablet.status, 
        tablet.pendrive_id, acum5min, acum5med, acum5max, acum6min, acum6med, acum6max,acumSenaMin,acumSenaAtu,acumSenaMax,acumBombaMin,acumBombaAtu,acumBombaMax, 
        creditoteclado, centavosbingo, apostamaxhalloween, leituraonlinesincronizada, zerarleituraparcial, zerarleituraoficialbackup,
        matematica_slot, modo_slot, retencao_slots, dificul_bonus,taxa_maxima, acrecimo_taxa_max, periodo_reducao, extras_min_rotina, saldo_para_acumulao, premio_do_acumulado, tam_premio_max, saldo_min_bingo_g1,
        saldo_min_bingo_g2, saldo_min_bingo_g3, qtn_jogos_azar, probabilidada_premios_azar, taxa_max_chance_azar,qtn_jogos_normal,
        probabilidada_premios_normal, taxa_max_chance_normal, qtn_jogos_neutro, probabilidade_premios_neutro, taxa_max_chance_neutro, qtn_jogos_sorte,
        probabilidade_premios_sorte, taxa_max_chance_sorte, qtn_jogos_moderado, probabilidade_premios_moderado, taxa_max_chance_moderado,
        limites_nivel_show_n2, 	limites_nivel_show_n3, 	limites_nivel_show_n4, status_bonus, valor, kiosk_sis, tipo_tela, tipo_inter, senha
        FROM tablet, ponto 
        WHERE idprod = '$editar' 
        AND tablet.id_ponto = ponto.id  
        ORDER BY tablet.id 
        DESC LIMIT 1");
    $rowEdit = mysql_fetch_array($resultEdit);
    ?>

    <div class="modal-body"> 	
        <div class="row">
            <div class="col-lg-12 center-block">			
                <div class="panel panel-default ">					
                    <div class="panel-body">
                        <div class="col-lg-4 center-block">
                            <div class="form-group input-group">
                                <span class="input-group-addon">Tablet  &nbsp;  &nbsp;  &nbsp; &nbsp; </span>
                                <input type="text" class="form-control" id="idprod" name="idprod"  <?php echo "value='" . $rowEdit['idprod'] . "'" ?> READONLY  >
                            </div>
                            <!-- <div class="form-group input-group">
                                <span class="input-group-addon">Centavos p/ Bingo</span>
                                <select name="centavosbingo" id="centavosbingo" class="form-control">
                                    <?php
                                    //Centavos para Bingo (1, 10, 25)
                                    $selected25 = "";
                                    $selected10 = "";
                                    $selected1 = "";
                                    
                                    switch ($rowEdit['centavosbingo']) {
                                        case '1':
                                            $selected1 = " selected";
                                            break;
                                        case '10':
                                            $selected10 = " selected";
                                            break;
                                        case '25':
                                            $selected25 = " selected";
                                            break;
                                        default:
                                            $selected1 = " selected";
                                            break;
                                    }
                                    ?>
                                    <option value ='1' <?php echo $selected1; ?>>1</option>
                                    <option value ='10' <?php echo $selected10; ?>>10</option>
                                    <option value ='25' <?php echo $selected25; ?>>25</option>									
                                </select>
                            </div> -->

                            <?php
                            if ($_SESSION['UsuarioNivel'] == 1 || $_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) {
                                $disabled = "";
                            } elseif ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4 ) {
                                $disabled = ' disabled=""';
                            }
                            ?>

                            <div class="form-group input-group">
                                <span class="input-group-addon">Apos. Max. Halloween</span>
                                <select name="apostamaxhalloween" id="apostamaxhalloween" class="form-control" <?php echo $disabled ?>>
                                    <?php
                                    //Aposta Maxima Halloween (10,20,30,40)
                                    $selected50 = "";
                                    $selected40 = "";
                                    $selected30 = "";
                                    $selected10 = "";
                                    $selected20 = "";
                                    switch ($rowEdit['apostamaxhalloween']) {
                                        case '10':
                                            $selected10 = "selected";
                                            break;
                                        case '20':
                                            $selected20 = "selected";
                                            break;
                                        case '30':
                                            $selected3 = "selected";
                                            break;
                                        case '40':
                                            $selected40 = "selected";
                                            break;
                                        case '50':
                                            $selected50 = "selected";
                                            break;
                                    }
                                    ?>
                                    <option value ='10' <?php echo $selected10; ?> >10</option>
                                    <option value ='20' <?php echo $selected20; ?> >20</option>
                                    <option value ='30' <?php echo $selected30; ?> >30</option>
                                    <option value ='40' <?php echo $selected40; ?> >40</option>		
                                    <option value ='50' <?php echo $selected50; ?> >50</option>		
                                </select>
                            </div>	

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaMax">
                                    <span class="input-group-addon">Taxa Maxima</span>
                                    <input type="number" min="35" max="95" class="form-control" name="taxa_maxima" id="taxaMax" placeholder="Taxa Maxima" <?php echo "value='" . $rowEdit['taxa_maxima'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="acrecimoTaxaMax">
                                    <span class="input-group-addon">Acrecimo Taxa Max</span>
                                    <input type="number" min="1" max="95" class="form-control" name="acrecimo_taxa_max" id="acrecimoTaxaMax" placeholder="Taxa Maxima" <?php echo "value='" . $rowEdit['acrecimo_taxa_max'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 
                           
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="periodoReducao">
                                    <span class="input-group-addon">Periodo Redução</span>
                                    <input type="number" min="1000" max="100000" class="form-control" name="periodo_reducao" id="periodoReducao" placeholder="Periodo Redução" <?php echo "value='" . $rowEdit['periodo_reducao'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="extraRotina">
                                    <span class="input-group-addon">Extra P/ Rotina</span>
                                    <input type="number" min="1" max="100" class="form-control" name="extras_min_rotina" id="extraRotina" placeholder="Extra Rotina" <?php echo "value='" . $rowEdit['extras_min_rotina'] . "'" ?>>
                                </div> -->
                            <?php } ?> 
                           
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="saldoAcum">
                                    <span class="input-group-addon">Saldo P/ AC Bingo</span>
                                    <input type="number" min="1000" max="999999" class="form-control" name="saldo_para_acumulao" id="saldoAcum" placeholder="Saldo p/ Acum" <?php echo "value='" . $rowEdit['saldo_para_acumulao'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="saldoBingoG1">
                                    <span class="input-group-addon">Saldo P/ 1º Bingo</span>
                                    <input type="number" min="1000" max="999999" class="form-control" name="saldo_min_bingo_g1" id="saldoBingoG1" placeholder="Saldo Bingo1" <?php echo "value='" . $rowEdit['saldo_min_bingo_g1'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="saldoBingoG1">
                                    <span class="input-group-addon">Saldo P/ 2º Bingo</span>
                                    <input type="number" min="1000" max="999999" class="form-control" name="saldo_min_bingo_g2" id="saldoBingoG2" placeholder="Saldo Bingo2" <?php echo "value='" . $rowEdit['saldo_min_bingo_g2'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="saldoBingoG1">
                                    <span class="input-group-addon">Saldo P/ 3º Bingo</span>
                                    <input type="number" min="1000" max="999999" class="form-control" name="saldo_min_bingo_g3" id="saldoBingoG3" placeholder="Saldo Bingo3" <?php echo "value='" . $rowEdit['saldo_min_bingo_g3'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="nivelShowN2">
                                    <span class="input-group-addon">Nivel Show N2</span>
                                    <input type="number" min="0" max="100" class="form-control" name="limites_nivel_show_n2" id="nivelShowN2" placeholder="Nivel Show N2" <?php echo "value='" . $rowEdit['limites_nivel_show_n2'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="nivelShowN3">
                                    <span class="input-group-addon">Nivel Show N3</span>
                                    <input type="number" min="0" max="100" class="form-control" name="limites_nivel_show_n3" id="nivelShowN3" placeholder="Nivel Show N3" <?php echo "value='" . $rowEdit['limites_nivel_show_n3'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="nivelShowN4">
                                    <span class="input-group-addon">Nivel Show N4</span>
                                    <input type="number" min="0" max="100" class="form-control" name="limites_nivel_show_n4" id="nivelShowN4" placeholder="Nivel Show N4" <?php echo "value='" . $rowEdit['limites_nivel_show_n4'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 


                        </div>


                        <div class="col-lg-4 center-block">
                            <?php if ($_SESSION['UsuarioNivel'] == 1) { ?> 

                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Pendrive Nº </span>
                                    <input type="number" min="1" max="100" class="form-control" name="pendrive" placeholder="Numero de Controle" value='<?php echo $rowEdit['pendrive_id'] ?>'  required >
                                </div>
                                <div class="form-group input-group">
                                    <span class="input-group-addon"> Pode Zerar</span>

                                    <select name="zerar" id="zerar" class="form-control">
                                        <?php
                                        if (($rowEdit['zerar']) == 0) {
                                            echo "<option value ='0' >Não</option>
										<option value ='1' >Sim</option>";
                                        }
                                        if ($rowEdit['zerar'] == 1) {
                                            echo "<option value ='1' >Sim</option>
										<option value ='0' >Não</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                                <?php
                            }
                            ?>

                            <div class="form-group input-group">
                                <span class="input-group-addon">Destravado</span>
                                <select name="destrava" id="destrava" class="form-control" <?= $disabled ?>>
                                    <?php
                                    for ($cont = 0; $cont <= 8; $cont++) {
                                        if ($rowEdit['destrava'] == $cont) {
                                            $selecionado = 'selected';
                                        } else {
                                            $selecionado = '';
                                        }
                                        if ($cont > 0) {
                                            if($cont < 7){
                                                $text = 'Acumulado ' . $cont;
                                            }else if($cont < 8) {
                                                $text = 'Bonus Sena ' . $cont;
                                            }else {
                                                $text = 'Bonus Bomba ' . $cont;
                                                
                                            }
                                        } else {
                                            $text = 'Não';
                                        }
                                        echo "<option $selecionado value ='$cont' >$text</option>";
                                    }
                                    ?>									
                                </select>
                            </div>
							
							<div class="form-group input-group">
								<span class="input-group-addon">Retenção Tipo</span>
								<select name="matematicaSlot" id="matematicaSlot" class="form-control" <?= $disabled ?>>
									<!-- <option value = '0' <?php echo $rowEdit['matematica_slot'] == 0 ? ' selected' : ""; ?> >NÍVEL</option> -->
									<option value = '1' <?php echo $rowEdit['matematica_slot'] == 1 ? ' selected' : ""; ?> >%</option>
								</select>
							</div>
							
							<?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>
                                <div class="form-group input-group">
                                    <span class="input-group-addon">Dificuldade</span>
                                    <select name="dificuldade" id="dificuldadeTablet" class="form-control">
                                        <option value ='50' <?php echo $rowEdit['dificuldade'] == 50 ? ' selected' : ""; ?> >50</option>
                                        <option value ='55' <?php echo $rowEdit['dificuldade'] == 55 ? ' selected' : ""; ?> >55</option>
                                        <option value ='60' <?php echo $rowEdit['dificuldade'] == 60 ? ' selected' : ""; ?> >60</option>								
                                        <option value ='65' <?php echo $rowEdit['dificuldade'] == 65 ? ' selected' : ""; ?> >65</option>
                                        <option value ='70' <?php echo $rowEdit['dificuldade'] == 70 ? ' selected' : ""; ?> >70</option>
                                        <option value ='75' <?php echo $rowEdit['dificuldade'] == 75 ? ' selected' : ""; ?> >75</option>
                                    </select>
                                </div> 
                                <!-- <div class="form-group input-group">
                                    <span class="input-group-addon">Dificuldade</span>
                                    <select name="dificuldade" id="dificuldadeTablet" class="form-control">
                                        <option value ='50' <?php echo $rowEdit['dificuldade'] == 50 ? ' selected' : ""; ?> >50</option>
                                        <option value ='45' <?php echo $rowEdit['dificuldade'] == 45 ? ' selected' : ""; ?> >45</option>
                                        <option value ='40' <?php echo $rowEdit['dificuldade'] == 40 ? ' selected' : ""; ?> >40</option>								
                                        
                                    </select>
                                </div> -->
                            <?php } else { ?> 
                                <div class="form-group input-group" id="dificuldade">
                                    <span class="input-group-addon">Dificuldade</span>
                                    <input type="number" min="35" max="95" class="form-control" name="dificuldade" id="dificuldadeTablet" placeholder="Dificuldade" <?php echo "value='" . $rowEdit['dificuldade'] . "'" ?>>
                                </div>
                            <?php } ?> 
							
							<div class="form-group input-group">
								<span class="input-group-addon">Nível</span>
								<select name="modoSlot" id="modoTablet" class="form-control">
									<option value ='1' <?php echo $rowEdit['modo_slot'] == 1 ? ' selected' : ""; ?> >1</option>
									<option value ='2' <?php echo $rowEdit['modo_slot'] == 2 ? ' selected' : ""; ?> >2</option>
									<option value ='3' <?php echo $rowEdit['modo_slot'] == 3 ? ' selected' : ""; ?> >3</option>								
									<option value ='4' <?php echo $rowEdit['modo_slot'] == 4 ? ' selected' : ""; ?> >4</option>
								</select>
							</div>

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4 || $_SESSION['UsuarioNivel'] == 1) { ?>
                                <div class="form-group input-group" id="dificuldade">
                                    <span class="input-group-addon">Max créditos</span>
                                    <input type="number" min="1000" max="500000" class="form-control" name="dificul_bonus" id="dificuldadeBonus" placeholder="Dificuldade Bonus" <?php echo "value='" . $rowEdit['dificul_bonus'] . "'" ?>>
                                </div>
                            <?php } else { ?> 
                                <div class="form-group input-group" id="dificuldade">
                                    <span class="input-group-addon">Max créditos</span>
                                    <input type="number" min="1000" max="500000" class="form-control" name="dificul_bonus" id="dificuldadeBonus" placeholder="Dificuldade Bonus" <?php echo "value='" . $rowEdit['dificul_bonus'] . "'" ?>>
                                </div>
                            <?php } ?>

                            <?php if ($_SESSION['UsuarioNivel'] == 1) { ?> 

                                <div class="form-group input-group">    
                                    <span class="input-group-addon">ZERAR Leitura parc.</span>
                                    <select name="zerarleituraparcial" id="zerarleituraparcial" class="form-control">
                                        <?php
                                        //Leitura Online ou Sincronizada (0, 1)							
                                        $selected0 = "";
                                        $selected1 = "";
                                        switch ($rowEdit['zerarleituraparcial']) {
                                            case '1':
                                                $selected1 = "selected";
                                                break;
                                            case '0':
                                                $selected0 = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selected1; ?> >Sim</option>
                                        <option value ='0' <?php echo $selected0; ?> >Não</option>
                                    </select>
                                </div>					
                                <?php
                            }
                            ?>
                            <!-- ROTINA AZAR -->
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="qtnJogosAzar">
                                    <span class="input-group-addon">Qtn Jogos Azar</span>
                                    <input type="number" min="0" max="100" class="form-control" name="qtn_jogos_azar" id="qtnJogosAzar" placeholder="Qtn Jogo Azar" <?php echo "value='" . $rowEdit['qtn_jogos_azar'] . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="probabiAzar">
                                    <span class="input-group-addon">Prob Premios Azar</span>
                                    <input type="number" min="0" max="100" class="form-control" name="probabilidada_premios_azar" id="probabiAzar" placeholder="Prob Azar" <?php echo "value='" . $rowEdit['probabilidada_premios_azar'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaChanceAzar">
                                    <span class="input-group-addon">Max Chance Azar</span>
                                    <input type="number" min="0" max="100" class="form-control" name="taxa_max_chance_azar" id="taxaChanceAzar" placeholder="Chance Azar" <?php echo "value='" . $rowEdit['taxa_max_chance_azar'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <!-- ROTINA NORMAL -->
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="qtnJogosNormal">
                                    <span class="input-group-addon">Qtn Jogos Normal</span>
                                    <input type="number" min="0" max="100" class="form-control" name="qtn_jogos_normal" id="qtnJogosNormal" placeholder="Qtn Jogo Normal" <?php echo "value='" . $rowEdit['qtn_jogos_normal'] . "'" ?>>
                                </div> -->
                            <?php } ?> 
                            
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="probabiNormal">
                                    <span class="input-group-addon">Prob Premios Normal</span>
                                    <input type="number" min="0" max="100" class="form-control" name="probabilidada_premios_normal" id="probabiNormal" placeholder="Prob Normal" <?php echo "value='" . $rowEdit['probabilidada_premios_normal'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaChanceNormal">
                                    <span class="input-group-addon">Max Chance Normal</span>
                                    <input type="number" min="0" max="100" class="form-control" name="taxa_max_chance_normal" id="taxaChanceNormal" placeholder="Chance Normal" <?php echo "value='" . $rowEdit['taxa_max_chance_normal'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                             <!-- ROTINA NEUTRO -->
                             <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="qtnJogosNeutro">
                                    <span class="input-group-addon">Qtn Jogos Neutro</span>
                                    <input type="number" min="0" max="100" class="form-control" name="qtn_jogos_neutro" id="qtnJogosNeutro" placeholder="Qtn Jogo Neutro" <?php echo "value='" . $rowEdit['qtn_jogos_neutro'] . "'" ?>>
                                </div> -->
                            <?php } ?> 
                            
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="probabiNeutro">
                                    <span class="input-group-addon">Prob Premios Neutro</span>
                                    <input type="number" min="0" max="100" class="form-control" name="probabilidade_premios_neutro" id="probabiNeutro" placeholder="Prob Neutro" <?php echo "value='" . $rowEdit['probabilidade_premios_neutro'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaChanceNeutro">
                                    <span class="input-group-addon">Max Chance Neutro</span>
                                    <input type="number" min="0" max="100" class="form-control" name="taxa_max_chance_neutro" id="taxaChanceNeutro" placeholder="Chance Neutro" <?php echo "value='" . $rowEdit['taxa_max_chance_neutro'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                             <!-- ROTINA SORTE -->
                             <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="qtnJogosSorte">
                                    <span class="input-group-addon">Qtn Jogos Sorte</span>
                                    <input type="number" min="0" max="100" class="form-control" name="qtn_jogos_sorte" id="qtnJogosSorte" placeholder="Qtn Jogo Sorte" <?php echo "value='" . $rowEdit['qtn_jogos_sorte'] . "'" ?>>
                                </div> -->
                            <?php } ?> 
                            
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="probabiSorte">
                                    <span class="input-group-addon">Prob Premios Sorte</span>
                                    <input type="number" min="0" max="100" class="form-control" name="probabilidade_premios_sorte" id="probabiSorte" placeholder="Prob Sorte" <?php echo "value='" . $rowEdit['probabilidade_premios_sorte'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaChanceSorte">
                                    <span class="input-group-addon">Max Chance Sorte</span>
                                    <input type="number" min="0" max="100" class="form-control" name="taxa_max_chance_sorte" id="taxaChanceSorte" placeholder="Chance Sorte" <?php echo "value='" . $rowEdit['taxa_max_chance_sorte'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                             <!-- ROTINA MODERADO -->
                             <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="qtnJogosModerado">
                                    <span class="input-group-addon">Qtn Jogos Moderado</span>
                                    <input type="number" min="0" max="100" class="form-control" name="qtn_jogos_moderado" id="qtnJogosModerado" placeholder="Qtn Jogo Moderado" <?php echo "value='" . $rowEdit['qtn_jogos_moderado'] . "'" ?>>
                                </div> -->
                            <?php } ?> 
                            
                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="probabiModerado">
                                    <span class="input-group-addon">Prob Premios Moderado</span>
                                    <input type="number" min="0" max="100" class="form-control" name="probabilidade_premios_moderado" id="probabiSorte" placeholder="Prob Moderado" <?php echo "value='" . $rowEdit['probabilidade_premios_moderado'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                            <?php if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>    
                               <!-- CASO O CLIENTE TENHA ACESSO COLOCAR O CODIGO AQUI DENTRO -->
                            <?php } else { ?> 
                                <!-- <div class="form-group input-group" id="taxaChanceModerado">
                                    <span class="input-group-addon">Max Chance Moderado</span>
                                    <input type="number" min="0" max="100" class="form-control" name="taxa_max_chance_moderado" id="taxaChanceModerado" placeholder="Chance Moderado" <?php echo "value='" . $rowEdit['taxa_max_chance_moderado'] * 100 . "'" ?>>
                                </div> -->
                            <?php } ?> 

                        </div>
                        <?php
                        //}
                        ?>      

                        <div class="col-lg-4 center-block">
                            <div class="form-group input-group">
                                <span class="input-group-addon"> Ponto &nbsp; &nbsp; &nbsp; &nbsp;</span>
                                <select name="ponto" id="ponto" class="form-control">

                                    <option <?php echo "value='" . $rowEdit['id_ponto'] . "'" ?>  selected="selected"><?php echo $rowEdit['nome'] ?> </option>

                                    <?php
                                    $resultUser = mysql_query("SELECT ponto.id,ponto.nome FROM ponto, user WHERE  ponto.id_apoio = user.id  AND user.username = '" . $rowEdit['cliente'] . "' AND ponto.nome NOT IN ('" . $rowEdit['nome'] . "') ORDER BY ponto.nome ASC");

                                    while ($rowUser = mysql_fetch_array($resultUser)) {
                                        echo '<option $selecionado value="' . $rowUser['id'] . '">' . $rowUser['nome'] . '</option>';
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="form-group input-group">    
                                <span class="input-group-addon">% Acumulado </span>
                                <input type="number" step="any" min="1" max="3"  class="form-control" name="porcent_acumu" placeholder="Porcentagem Acumulado" <?php echo "value='" . $rowEdit['porcent_acumu'] . "'" ?>  required >
                            </div>


                            <div class="form-group input-group">
                                <span class="input-group-addon">Cred. por Teclado?</span>

                                <select name="creditoteclado" id="creditoteclado" class="form-control">
                                    <?php
                                    if (($rowEdit['creditoteclado']) == 0) {
                                        echo "<option value ='0'selected >Não</option>
										<option value ='1' >Sim</option>";
                                    }
                                    if ($rowEdit['creditoteclado'] == 1) {
                                        echo "<option value ='1' selected >Sim</option>
										<option value ='0' >Não</option>";
                                    }
                                    ?>
                                </select>
                            </div>

                            <div class="form-group input-group">
                                <span class="input-group-addon">Tipo interface</span>

                                <select name="tipo_inter" id="tipo_inter" class="form-control">
                                    <?php
                                    if (($rowEdit['tipo_inter']) == 0) {
                                        echo "<option value ='0'selected >PS2 HALLO</option>
										<option value ='1' >WORD LINK</option>";
                                    }
                                    if ($rowEdit['tipo_inter'] == 1) {
                                        echo "<option value ='1' selected >WORD LINK</option>
										<option value ='0' >PS2 HALLO</option>";
                                    }
                                    ?>
                                </select>
                            </div>

                        </div>

                        <?php if ($_SESSION['UsuarioNivel'] == 1 || $_SESSION['UsuarioNivel'] == 2 || $_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) { ?>

                            <div class="col-lg-4 center-block" >
                                <div class="form-group input-group">    
                                    <span class="input-group-addon">ZERAR Ofic. Backup</span>
                                    <select name="zerarleituraoficialbackup" id="zerarleituraoficialbackup" class="form-control">
                                        <?php
                                        //ZERAR Oficial e Backup Banco de Dados (0, 1)						
                                        $selected0 = "";
                                        $selected1 = "";
                                        switch ($rowEdit['zerarleituraoficialbackup']) {
                                            case '1':
                                                $selected1 = "selected";
                                                break;
                                            case '0':
                                                $selected0 = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selected1; ?> >Sim</option>
                                        <option value ='0' <?php echo $selected0; ?> >Não</option>
                                    </select>
                                </div>


                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Leit. Online ou Sincr.</span>
                                    <select name="leituraonlinesincronizada" id="leituraonlinesincronizada" class="form-control">
                                        <?php
                                        //Leitura Online ou Sincronizada (0, 1)							
                                        $selected0 = "";
                                        $selected1 = "";
                                        switch ($rowEdit['leituraonlinesincronizada']) {
                                            case '1':
                                                $selected1 = "selected";
                                                break;
                                            case '0':
                                                $selected0 = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selected1; ?> >Sim</option>
                                        <option value ='0' <?php echo $selected0; ?> >Não</option>
                                    </select>
                                </div>

                                
                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Retenção Auto</span>
                                    <select name="retencao" id="retencao" class="form-control">
                                        <?php
                                        // Retenção de proteção(0, 1)							
                                        $selectedLig = "";
                                        $selectedDes = "";
                                        switch ($rowEdit['retencao_slots']) {
                                            case '1':
                                                $selectedLig = "selected";
                                                break;
                                            case '0':
                                                $selectedDes = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selectedLig; ?> >Sim</option>
                                        <option value ='0' <?php echo $selectedDes; ?> >Não</option>
                                    </select>
                                </div>
                                <?php if ($_SESSION['UsuarioNivel'] == 1 || $_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 3) {?>

                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Lib Raspadinha</span>
                                    <select name="status_bonus" id="retencao" class="form-control">
                                        <?php
                                        // Retenção de proteção(0, 1)							
                                        $selectedLig = "";
                                        $selectedDes = "";
                                        switch ($rowEdit['status_bonus']) {
                                            case '1':
                                                $selectedLig = "selected";
                                                break;
                                            case '0':
                                                $selectedDes = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selectedLig; ?> >Sim</option>
                                        <option value ='0' <?php echo $selectedDes; ?> >Não</option>
                                    </select>
                                </div>
                                
                                <div class="form-group input-group" id="qtnJogosSorte">
                                    <span class="input-group-addon">Valor bonús baú</span>
                                    <input type="number" min="0" max="100000" class="form-control" name="valor_bonus_bau" id="valor_bonus" placeholder="Qtn Jogo Sorte" <?php echo "value='" . $rowEdit['valor'] . "'" ?>>
                                </div>
                                <?php } ?>
                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Tipo Sistema</span>
                                    <select name="kiosk_sis" id="kiosk" class="form-control">
                                        <?php
                                        // Retenção de proteção(0, 1)							
                                        $selectedKioskLig = "";
                                        $selectedKioskDes = "";
                                        switch ($rowEdit['kiosk_sis']) {
                                            case '1':
                                                $selectedKioskLig = "selected";
                                                break;
                                            case '0':
                                                $selectedKioskDes = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $selectedKioskLig; ?> >Kiosk</option>
                                        <option value ='0' <?php echo $selectedKioskDes; ?> >Classico</option>
                                    </select>
                                </div>
                                
                                <div class="form-group input-group">    
                                    <span class="input-group-addon">Tipo Jogos</span>
                                    <select name="tipo_tela" id="tela" class="form-control">
                                        <?php
                                        // Retenção de proteção(0, 1)							
                                        $tipoTelaTouch = "";
                                        $tipoTelaPadrao = "";
                                        $tipoTelaPadraoBrinde = "";
                                        switch ($rowEdit['tipo_tela']) {
                                            case '1':
                                                $tipoTelaTouch = "selected";
                                                break;
                                            case '2':
                                                $tipoTelaPadraoBrinde = "selected";
                                                break;
                                            case '0':
                                                $tipoTelaPadrao = "selected";
                                                break;
                                        }
                                        ?>
                                        <option value ='1' <?php echo $tipoTelaTouch; ?> >Slots</option>
                                        <option value ='2' <?php echo $tipoTelaPadraoBrinde; ?> >HALLOWEEN IV</option>
                                        <!-- <option value ='0' <?php// echo $tipoTelaPadrao; ?> >Slots</option> -->
                                    </select>
                                </div>

                                <div class="form-group input-group" id="qtnJogosSorte">
                                    <span class="input-group-addon">Senha Terminal</span>
                                    <input type="number" min="1000" max="9999" class="form-control" name="senha" id="senha" placeholder="Senha" <?php echo "value='" . $rowEdit['senha'] . "'" ?>>
                                </div>

                            </div>

                            <?php
                        }
                        ?>	
                    </div>
                </div>

                <div class="panel panel-default ">					
                    <div class="panel-body" style="background-color: #CCCCCC" >
                        <div class="col-lg-12 center-block">   
                            <div class="panel-group" id="accordion">
                                <div class="row"> 
                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h1 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">Acumulado 1 (4 MAG)</a>
                                                </h1>
                                            </div>
                                            <div id="collapseOne" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum4min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum4min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum4med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum4med'] . "'" ?>  required>
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum4max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum4max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h1 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">Acumulado 2 (4 ABO)</a>
                                                </h1>
                                            </div>
                                            <div id="collapseTwo" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum1min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum1min'] . "'" ?>  required>
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum1med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum1med'] . "'" ?>  required>
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum1max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum1max'] . "'" ?>  required>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">Acumulado 3 (5 CAP)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseThree" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum2min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum2min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum2med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum2med'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum2max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum2max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-12 center-block">   
                            <div class="panel-group" id="accordion">
                                <div class="row"> 
                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">Acumulado 4 (5 ABO)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseFour" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum3min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum3min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum3med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum3med'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum3max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum3max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseFive">Acumulado 5 (Jackpot)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseFive" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum5min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum5min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum5med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum5med'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum5max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum5max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseSix">Acumulado 6 (Bingo)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseSix" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01"  class="form-control" name="acum6min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum6min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01"  class="form-control" name="acum6med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum6med'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum6max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum6max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="col-lg-12 center-block">   
                            <div class="panel-group" id="accordion">
                                <div class="row"> 
                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">Acumulado 7 Bônus Sena</a>
                                                </h5>
                                            </div>
                                            <div id="collapseFour" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumSenaMin" placeholder="Inicial" <?php echo "value='" . $rowEdit['acumSenaMin'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumSenaAtu" placeholder="Atual" <?php echo "value='" . $rowEdit['acumSenaAtu'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumSenaMax" placeholder="Máximo" <?php echo "value='" . $rowEdit['acumSenaMax'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseFive">Acumulado 8 (BOMBA)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseFive" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumBombaMin" placeholder="Inicial" <?php echo "value='" . $rowEdit['acumBombaMin'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumBombaAtu" placeholder="Atual" <?php echo "value='" . $rowEdit['acumBombaAtu'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="2000" step=".01" class="form-control" name="acumBombaMax" placeholder="Máximo" <?php echo "value='" . $rowEdit['acumBombaMax'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <!-- <div class="col-lg-4 center-block"> 
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h5 class="panel-title">
                                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseSix">Acumulado 6 (Bingo)</a>
                                                </h5>
                                            </div>
                                            <div id="collapseSix" class="panel-collapse collapse in">
                                                <div class="panel-body">
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Inicial &nbsp  </span>
                                                        <input type="number" min="1" max="10000" step=".01"  class="form-control" name="acum6min" placeholder="Inicial" <?php echo "value='" . $rowEdit['acum6min'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Atual &nbsp &nbsp </span>
                                                        <input type="number" min="1" max="10000" step=".01"  class="form-control" name="acum6med" placeholder="Atual" <?php echo "value='" . $rowEdit['acum6med'] . "'" ?> required >
                                                    </div>
                                                    <div class="form-group input-group">    
                                                        <span class="input-group-addon">Máximo </span>
                                                        <input type="number" min="1" max="10000" step=".01" class="form-control" name="acum6max" placeholder="Máximo" <?php echo "value='" . $rowEdit['acum6max'] . "'" ?> required >
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div> -->

                                </div>
                            </div>
                        </div>
                        <!-- .panel-body -->
                    </div>
                </div>			
            </div>
        </div>	
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
            <button type="submit" class="btn btn-primary btnSalvarEditTablet" >Salvar</button>
        </div>
    </div>
    
    
    <script>
        $(document).ready(function () {
			
			atualizarMatematicaSlot ();
			
    <?php if ($_SESSION['UsuarioNivel'] == 3) { ?>
                // dificuldadeTablet
                //$("#dificuldadeTablet").attr({
                //	"max" : 70 // Limitar ao Cliente a configuração de retenção em 70%
                //});			
        <?php
    }
    ?>

            $("#dificuldadeTablet").change(function () {

                var max = parseInt($(this).attr('max'));
                var min = parseInt($(this).attr('min'));

                if ($(this).val() > max) {
                    $(this).val(max);
                } else if ($(this).val() < min) {
                    $(this).val(min);
                }
            });
			
			$("#matematicaSlot").change (function () {
				
				atualizarMatematicaSlot ();
			});
        });
		
		function atualizarMatematicaSlot ()
		{
			var matematica = $("#matematicaSlot").val();
				
			if (matematica == 0) // Nova
			{
				$("#dificuldadeTablet").parent().hide ();
				$("#modoTablet").parent().show ();
			}
			else if (matematica == 1) // Antiga
			{
				$("#dificuldadeTablet").parent().show ();
				$("#modoTablet").parent().hide ();
			}
		}
    </script>	
    <!-- /.col-lg-4 -->
    <?php
}
?>      