<?php




if ($_settings->userdata('type') != '1') {
	echo 'Você não tem permissão para acessar essa página.';
	exit();
}

$dealer_active = ($_settings->info('dealer_active') ? $_settings->info('dealer_active') : 2);
$dealer_limit_raffle_quantity = ($_settings->info('dealer_limit_raffle_quantity') ? $_settings->info('dealer_limit_raffle_quantity') : 9999);
$dealer_limit_quantity_numbers = ($_settings->info('dealer_limit_quantity_numbers') ? $_settings->info('dealer_limit_quantity_numbers') : 10000000);
$dealer_deactive_site = ($_settings->info('dealer_deactive_site') ? $_settings->info('dealer_deactive_site') : 2);
$dealer_contact = $_settings->info('dealer_contact');
$dealer_split_mercadopago = $_settings->info('dealer_split_mercadopago');
$dealer_split_mercadopago_loja_id = $_settings->info('dealer_split_mercadopago_loja_id');
$dealer_split_mercadopago_token = $_settings->info('dealer_split_mercadopago_token');
$dealer_split_mercadopago_comissao = $_settings->info('dealer_split_mercadopago_comissao');
echo '<style>' . "\n\t" . '.active-tab{border-bottom:none!important}.can-toggle{position:relative;margin-bottom:20px}.can-toggle *,.can-toggle :after,.can-toggle :before{box-sizing:border-box}.can-toggle input[type=checkbox]{opacity:0;position:absolute;top:0;left:0}.can-toggle input[type=checkbox]:checked~label .can-toggle__switch:before{content:attr(data-unchecked);left:0}.can-toggle label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:flex;align-items:center;font-size:14px}.can-toggle label .can-toggle__switch{position:relative;transition:background-color .3s cubic-bezier(0, 1, .5, 1);background:#848484;height:36px;flex:0 0 134px;border-radius:4px}.can-toggle label .can-toggle__switch:before{content:attr(data-checked);position:absolute;top:0;text-transform:uppercase;text-align:center;color:rgba(255,255,255,.5);left:67px;font-size:12px;line-height:36px;width:67px;padding:0 12px}.can-toggle label .can-toggle__switch:after{content:attr(data-unchecked);position:absolute;z-index:5;text-transform:uppercase;text-align:center;background:#fff;transform:translate3d(0,0,0);transition:transform .3s cubic-bezier(0, 1, .5, 1);color:#777;top:2px;left:2px;border-radius:2px;width:65px;line-height:32px;font-size:12px}.can-toggle input[type=checkbox]:focus~label .can-toggle__switch,.can-toggle input[type=checkbox]:hover~label .can-toggle__switch{background-color:#777}.can-toggle input[type=checkbox]:focus~label .can-toggle__switch:after,.can-toggle input[type=checkbox]:hover~label .can-toggle__switch:after{color:#5e5e5e;box-shadow:0 3px 3px rgba(0,0,0,.4)}.can-toggle input[type=checkbox]:hover~label{color:#6a6a6a}.can-toggle input[type=checkbox]:checked~label:hover{color:#55bc49}.can-toggle input[type=checkbox]:checked~label .can-toggle__switch{background-color:#70c767}.can-toggle input[type=checkbox]:checked~label .can-toggle__switch:after{content:attr(data-checked);color:#4fb743;transform:translate3d(65px,0,0)}.can-toggle input[type=checkbox]:checked:focus~label .can-toggle__switch,.can-toggle input[type=checkbox]:checked:hover~label .can-toggle__switch{background-color:#5fc054}.can-toggle input[type=checkbox]:checked:focus~label .can-toggle__switch:after,.can-toggle input[type=checkbox]:checked:hover~label .can-toggle__switch:after{color:#47a43d;box-shadow:0 3px 3px rgba(0,0,0,.4)}.can-toggle label .can-toggle__switch:hover:after{box-shadow:0 3px 3px rgba(0,0,0,.4)}@media all and (max-width:40em){#tabs{flex-wrap:wrap}#tabs .mr-1{margin-bottom:15px}}#cimg{max-width:100%;max-height:25em;object-fit:scale-down;object-position:center center}h2.social-rodape{font-weight:700;margin-top:20px}' . "\n" . '</style>' . "\n" . '<main class="h-full pb-16 overflow-y-auto">' . "\n\t" . '<div class="container px-6 mx-auto grid">' . "\n\t\t" . '<h2' . "\t" . 'class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">Geral</h2>' . "\n\n\t" . '    <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">' . "\n\t\t" . '    <div class="flex">' . "\n\t\t\t" . '    <ul class="flex" id="tabs">' . "\n" . '                    <li class="mr-1">' . "\n" . '                        <a href="#tab1" class="dark:text-gray-300 dark:border-gray-600 dark:bg-gray-800 inline-block py-2 px-4 font-semibold border rounded-t text-gray-700 active-tab">Configurações</a>' . "\n" . '                    </li>' . "\n" . '                    <!--' . "\n" . '                    <li class="mr-1">' . "\n" . '                        <a href="#tab2" class="dark:text-gray-300 dark:border-gray-600 dark:bg-gray-800 inline-block py-2 px-4 font-semibold border rounded-t text-gray-700">Split Mercado Pago</a>' . "\n" . '                    </li>' . "\n" . '                    <li class="mr-1">' . "\n" . '                        <a href="#tab3" class="dark:text-gray-300 dark:border-gray-600 dark:bg-gray-800 inline-block py-2 px-4 font-semibold border rounded-t text-gray-700">Split Gerencianet (EFI)</a>' . "\n" . '                    </li>' . "\n" . '                    <li class="mr-1">' . "\n" . '                        <a href="#tab4" class="dark:text-gray-300 dark:border-gray-600 dark:bg-gray-800 inline-block py-2 px-4 font-semibold border rounded-t text-gray-700">Split OpenPix</a>' . "\n" . '                    </li>' . "\n" . '                    -->' . "\n\t\t\t" . '    </ul>' . "\n\t\t" . '    </div>' . "\n\n" . '            <form action="" id="manage-system">' . "\n" . '                <div class="mt-4">' . "\t\n" . '                    <div id="tab1" class="tabcontent text-gray-700 dark:text-gray-400">' . "\n" . '                        <label class="block text-sm mb-2">' . "\n\t\t\t\t\t\t\t" . '<span class="text-gray-700 dark:text-gray-400">Ativar configurações de revendedor</span>' . "\t\n\t\t\t\t\t\t\t" . '<p class="mb-2" style="font-size:13px;color: orange;font-style:italic;">Ao habilitar esta opção, o sistema irá sobrepor as configurações de acordo as definições abaixo</p>' . "\t\n\t\t\t\t\t\t" . '</label>' . "\n" . '                        <div class="can-toggle mb-2">' . "\n" . '                            <input type="checkbox" name="dealer_active" id="dealer_active" ';
echo (isset($dealer_active) && $dealer_active == 1 ? 'checked' : '');
echo '>' . "\n" . '                            <label for="dealer_active">' . "\n" . '                                <div class="can-toggle__switch" data-checked="Sim" data-unchecked="Não"></div>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_limit_raffle_quantity">' . "\n" . '                            <label class="block text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">Quantidade máxima de campanhas</span>' . "\n" . '                                <input name="dealer_limit_raffle_quantity" id="dealer_limit_raffle_quantity" type="number" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"' . "\n" . '                                value="';
echo $_settings->info('dealer_limit_raffle_quantity');
echo '"/>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_limit_quantity_numbers">' . "\n" . '                            <label class="block mt-4 text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">' . "\n" . '                                    Quantidade máxima de números na campanha' . "\n" . '                                </span>' . "\n" . '                                <select name="dealer_limit_quantity_numbers" id="dealer_limit_quantity_numbers" class="mb-4 block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray">' . "\n" . '                                    <option value="100" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '100' ? 'selected' : '');
echo '>100</option>' . "\n" . '                                    <option value="200" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '200' ? 'selected' : '');
echo '>200</option>' . "\n" . '                                    <option value="300" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '300' ? 'selected' : '');
echo '>300</option>' . "\n" . '                                    <option value="400" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '400' ? 'selected' : '');
echo '>400</option>' . "\n" . '                                    <option value="500" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '500' ? 'selected' : '');
echo '>500</option>' . "\n" . '                                    <option value="600" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '600' ? 'selected' : '');
echo '>600</option>' . "\n" . '                                    <option value="700" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '700' ? 'selected' : '');
echo '>700</option>' . "\n" . '                                    <option value="800" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '800' ? 'selected' : '');
echo '>800</option>' . "\n" . '                                    <option value="900" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '900' ? 'selected' : '');
echo '>900</option>' . "\n" . '                                    <option value="1000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '1000' ? 'selected' : '');
echo '>1.000</option>' . "\n" . '                                    <option value="2000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '2000' ? 'selected' : '');
echo '>2.000</option>' . "\n" . '                                    <option value="3000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '3000' ? 'selected' : '');
echo '>3.000</option>' . "\n" . '                                    <option value="4000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '4000' ? 'selected' : '');
echo '>4.000</option>' . "\n" . '                                    <option value="5000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '5000' ? 'selected' : '');
echo '>5.000</option>' . "\n" . '                                    <option value="6000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '6000' ? 'selected' : '');
echo '>6.000</option>' . "\n" . '                                    <option value="7000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '7000' ? 'selected' : '');
echo '>7.000</option>' . "\n" . '                                    <option value="8000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '8000' ? 'selected' : '');
echo '>8.000</option>' . "\n" . '                                    <option value="9000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '9000' ? 'selected' : '');
echo '>9.000</option>' . "\n" . '                                    <option value="10000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '10000' ? 'selected' : '');
echo '>10.000</option>' . "\n" . '                                    <option value="20000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '20000' ? 'selected' : '');
echo '>20.000</option>' . "\n" . '                                    <option value="30000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '30000' ? 'selected' : '');
echo '>30.000</option>' . "\n" . '                                    <option value="40000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '40000' ? 'selected' : '');
echo '>40.000</option>' . "\n" . '                                    <option value="50000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '50000' ? 'selected' : '');
echo '>50.000</option>' . "\n" . '                                    <option value="60000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '60000' ? 'selected' : '');
echo '>60.000</option>' . "\n" . '                                    <option value="70000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '70000' ? 'selected' : '');
echo '>70.000</option>' . "\n" . '                                    <option value="80000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '80000' ? 'selected' : '');
echo '>80.000</option>' . "\n" . '                                    <option value="90000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '90000' ? 'selected' : '');
echo '>90.000</option>' . "\n" . '                                    <option value="100000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '100000' ? 'selected' : '');
echo '>100.000</option>' . "\n" . '                                    <option value="200000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '200000' ? 'selected' : '');
echo '>200.000</option>' . "\n" . '                                    <option value="300000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '300000' ? 'selected' : '');
echo '>300.000</option>' . "\n" . '                                    <option value="400000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '400000' ? 'selected' : '');
echo '>400.000</option>' . "\n" . '                                    <option value="500000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '500000' ? 'selected' : '');
echo '>500.000</option>' . "\n" . '                                    <option value="600000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '600000' ? 'selected' : '');
echo '>600.000</option>' . "\n" . '                                    <option value="700000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '700000' ? 'selected' : '');
echo '>700.000</option>' . "\n" . '                                    <option value="800000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '800000' ? 'selected' : '');
echo '>800.000</option>' . "\n" . '                                    <option value="900000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '900000' ? 'selected' : '');
echo '>900.000</option>' . "\n" . '                                    <option value="1000000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '1000000' ? 'selected' : '');
echo '>1.000.000</option>' . "\n" . '                                    <option value="3000000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '3000000' ? 'selected' : '');
echo '>3.000.000</option>' . "\n" . '                                    <option value="5000000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '5000000' ? 'selected' : '');
echo '>5.000.000</option>' . "\n" . '                                    <option value="10000000" ';
echo (isset($dealer_limit_quantity_numbers) && $dealer_limit_quantity_numbers == '10000000' ? 'selected' : '');
echo '>10.000.000</option>' . "\n" . '                                </select>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_deactive_site">' . "\n" . '                            <label class="block text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">Desativar/ativar site</span>' . "\t\n" . '                                <p class="mb-2" style="font-size:13px;color: orange;font-style:italic;">Ao habilitar esta opção, o site ficará inacessível e irá exibir uma mensagem para entrar em contato com o revendedor do sistema.</p>' . "\t\n" . '                            </label>' . "\n" . '                            <div class="can-toggle mb-2">' . "\n" . '                                <input type="checkbox" name="dealer_deactive_site" id="dealer_deactive_site" ';
echo (isset($dealer_deactive_site) && $dealer_deactive_site == 1 ? 'checked' : '');
echo '>' . "\n" . '                                <label for="dealer_deactive_site">' . "\n" . '                                    <div class="can-toggle__switch" data-checked="Sim" data-unchecked="Não"></div>' . "\n" . '                                </label>' . "\n" . '                            </div>' . "\n" . '                        </div>' . "\n" . '                    </div>' . "\n\n" . '                    <div id="tab2" class="tabcontent text-gray-700 dark:text-gray-400 hidden">' . "\n" . '                        <label class="block text-sm mb-2">' . "\n\t\t\t\t\t\t\t" . '<span class="text-gray-700 dark:text-gray-400">Ativar split do Mercado Pago</span>' . "\t\n\t\t\t\t\t\t\t" . '<p class="mb-2" style="font-size:13px;color: orange;font-style:italic;">Ao habilitar esta opção, você </p>' . "\t\n\t\t\t\t\t\t" . '</label>' . "\n" . '                        <div class="can-toggle mb-2">' . "\n" . '                            <input type="checkbox" name="dealer_split_mercadopago" id="dealer_split_mercadopago" ';
echo (isset($dealer_split_mercadopago) && $dealer_split_mercadopago == 1 ? 'checked' : '');
echo '>' . "\n" . '                            <label for="dealer_split_mercadopago">' . "\n" . '                                <div class="can-toggle__switch" data-checked="Sim" data-unchecked="Não"></div>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_split_mercadopago_loja_id">' . "\n" . '                            <label class="block text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">ID da loja</span>' . "\n" . '                                <input name="dealer_split_mercadopago_loja_id" id="dealer_split_mercadopago_loja_id" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"' . "\n" . '                                value="';
echo $_settings->info('dealer_split_mercadopago_loja_id');
echo '"/>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_split_mercadopago_token">' . "\n" . '                            <label class="block text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">Token</span>' . "\n" . '                                <input name="dealer_split_mercadopago_token" id="dealer_split_mercadopago_token" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"' . "\n" . '                                value="';
echo $_settings->info('dealer_split_mercadopago_token');
echo '"/>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                        <div class="dealer_split_mercadopago_comissao">' . "\n" . '                            <label class="block text-sm mb-2">' . "\n" . '                                <span class="text-gray-700 dark:text-gray-400">Comissão (%)</span>' . "\n" . '                                <input name="dealer_split_mercadopago_comissao" id="dealer_split_mercadopago_comissao" type="number" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"' . "\n" . '                                value="';
echo $_settings->info('dealer_split_mercadopago_comissao');
echo '"/>' . "\n" . '                            </label>' . "\n" . '                        </div>' . "\n" . '                    </div>' . "\n" . '                </div>' . "\n" . '                <div style="margin-top:20px;"> ' . "\n" . '                    <button form="manage-system" class="px-5 py-3 font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">' . "\n" . '                        Salvar' . "\n" . '                    </button>' . "\n" . '                </div>' . "\n" . '            </form>' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</main>' . "\n\n" . '<span id="openModal" href="javascript:void(0)" @click="openModal"></span>' . "\n" . '<div x-show="isModalOpen" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-150" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="fixed inset-0 z-30 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center" style="display: none;">' . "\n\t" . '<!-- Modal -->' . "\n\t" . '<div x-show="isModalOpen" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0 transform translate-y-1/2" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-150" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0  transform translate-y-1/2" @click.away="closeModal" @keydown.escape="closeModal" class="w-full px-6 py-4 overflow-hidden bg-white rounded-t-lg dark:bg-gray-800 sm:rounded-lg sm:m-4 sm:max-w-xl" role="dialog" id="modal" style="display: none;">' . "\n\t\t" . '<!-- Remove header if you don\'t want a close icon. Use modal body to place modal tile. -->' . "\n\t\t" . '<header class="flex justify-end">' . "\n\t\t\t" . '<button class="inline-flex items-center justify-center w-6 h-6 text-gray-400 transition-colors duration-150 rounded dark:hover:text-gray-200 hover: hover:text-gray-700" aria-label="close" @click="closeModal">' . "\n\t\t\t\t" . '<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20" role="img" aria-hidden="true">' . "\n\t\t\t\t\t" . '<path d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" fill-rule="evenodd"></path>' . "\n\t\t\t\t" . '</svg>' . "\n\t\t\t" . '</button>' . "\n\t\t" . '</header>' . "\n\t\t" . '<div class="mt-4 mb-6">' . "\n\t\t\t" . '<p class="mb-2 text-lg font-semibold text-gray-700 dark:text-gray-300">' . "\n\t\t\t\t" . 'Parabéns!' . "\n\t\t\t" . '</p>' . "\n\t\t\t" . '<p class="text-sm text-gray-700 dark:text-gray-400">' . "\n\t\t\t\t" . 'Alterações salvas com sucesso!' . "\n\t\t\t" . '</p>' . "\n\t\t" . '</div>' . "\n\n\t" . '</div>' . "\n" . '</div>' . "\n" . '<script>' . "\n" . '    var pageToken = \'dealer\'; ' . "\n\t" . '$("#tabs a").click(function() {' . "\n\t\t" . 'var selectedTab = $(this).attr("href");' . "\n\t\t" . '$("#tabs a").removeClass("active-tab");' . "\n\t\t" . '$(this).addClass("active-tab");' . "\n\t\t" . '$(".tabcontent").hide();' . "\n\t\t" . '$(selectedTab).show();' . "\n\t\t" . 'localStorage.setItem(\'selectedTab_\' + pageToken, pageToken + \'_\' + selectedTab);' . "\n\t\t" . 'return false;' . "\n\t" . '});' . "\n\n" . '    $(document).ready(function(){' . "\n" . '        var storedTab = localStorage.getItem(\'dealer\' + pageToken);' . "\n\t\t" . 'if (storedTab) {' . "\n\t\t\t" . 'var selectedTab = storedTab.substring(pageToken.length + 1);' . "\n\t\t\t" . '$("#tabs a").removeClass("active-tab");' . "\n\t\t\t" . '$(selectedTab).addClass("active-tab");' . "\n\t\t\t" . '$(".tabcontent").hide();' . "\n\t\t\t" . '$(selectedTab).show();' . "\n\t\t" . '}' . "\n\n" . '        //Split Mercado Pago' . "\n" . '        if($(\'#dealer_split_mercadopago\').is(":checked")){' . "\n" . '            $(\'.dealer_split_mercadopago_loja_id\').show();' . "\n" . '            $(\'.dealer_split_mercadopago_token\').show();' . "\n" . '            $(\'.dealer_split_mercadopago_comissao\').show();' . "\n" . '        }else{' . "\n" . '            $(\'.dealer_split_mercadopago_loja_id\').hide();' . "\n" . '            $(\'.dealer_split_mercadopago_token\').hide();' . "\n" . '            $(\'.dealer_split_mercadopago_comissao\').hide();' . "\n" . '        }' . "\n\n" . '        $(\'#dealer_split_mercadopago\').change(function() {' . "\n" . '            if($(\'#dealer_split_mercadopago\').is(":checked")){' . "\n" . '                $(\'.dealer_split_mercadopago_loja_id\').show();' . "\n" . '                $(\'.dealer_split_mercadopago_token\').show();' . "\n" . '                $(\'.dealer_split_mercadopago_comissao\').show();' . "\n" . '            }else{' . "\n" . '                $(\'.dealer_split_mercadopago_loja_id\').hide();' . "\n" . '                $(\'.dealer_split_mercadopago_token\').hide();' . "\n" . '                $(\'.dealer_split_mercadopago_comissao\').hide();' . "\n" . '            }' . "\n" . '        });' . "\n\n" . '        if($(\'#dealer_active\').is(":checked")){' . "\n" . '            $(\'.dealer_limit_raffle_quantity\').show();' . "\n" . '            $(\'.dealer_limit_quantity_numbers\').show();' . "\n" . '            $(\'.dealer_deactive_site\').show();' . "\n" . '            $(\'.dealer_contact\').show();' . "\n\n" . '        }else{' . "\n" . '            $(\'.dealer_limit_raffle_quantity\').hide();' . "\n" . '            $(\'.dealer_limit_quantity_numbers\').hide();' . "\n" . '            $(\'.dealer_deactive_site\').hide();' . "\n" . '            $(\'.dealer_contact\').hide();' . "\n" . '        }' . "\n\n" . '        $(\'#dealer_active\').change(function() {' . "\n" . '            if($(\'#dealer_active\').is(":checked")){' . "\n" . '                $(\'.dealer_limit_raffle_quantity\').show();' . "\n" . '                $(\'.dealer_limit_quantity_numbers\').show();' . "\n" . '                $(\'.dealer_deactive_site\').show();' . "\n" . '                $(\'.dealer_contact\').show();' . "\n" . '            }else{' . "\n" . '                $(\'.dealer_limit_raffle_quantity\').hide();' . "\n" . '                $(\'.dealer_limit_quantity_numbers\').hide();' . "\n" . '                $(\'.dealer_deactive_site\').hide();' . "\n" . '                $(\'.dealer_contact\').hide();' . "\n" . '            }' . "\n" . '        });' . "\n\n" . '        $(\'#manage-system\').submit(function(e){' . "\n" . '            e.preventDefault();' . "\n" . '            $.ajax({' . "\n" . '                url:_base_url_+\'class/System.php?action=update_system\',' . "\n" . '                data: new FormData($(this)[0]),' . "\n" . '                cache: false,' . "\n" . '                contentType: false,' . "\n" . '                processData: false,' . "\n" . '                method: \'POST\',' . "\n" . '                type: \'POST\',' . "\n" . '                success:function(resp){' . "\n" . '                    var returnedData = JSON.parse(resp);' . "\n" . '                    if(returnedData.status == \'success\'){' . "\n" . '                        alert(\'Configurações salvas com sucesso!\');' . "\n" . '                        location.reload();' . "\n" . '                    }else{' . "\n" . '                        alert(\'Ops\');' . "\n" . '                    }' . "\n" . '                }' . "\n" . '            })' . "\n" . '        })' . "\n" . '    });' . "\n" . '</script>';

?>