$tipo = addslashes($_GET['tipo']); if ($tipo) { $where1 = array("tipo" => $tipo, "sigla_idioma" => ""); $db_tex = $base->seleciona('textos', $where1, null); $up_where = json_encode($where1); if ($db_tex) { if (!empty($lang)) { $where2 = array("tipo" => $tipo, "sigla_idioma" => $lang); $db_tex = $base->seleciona('textos', $where2, null); $up_where = json_encode($where2); if ($db_tex) { $db_tex = $db_tex; } else { $db_idiom = $base->seleciona('idiomas', array('sigla' => $lang, "status" => 1), null); if ($db_idiom) { $base->inserir('textos', array('sigla_idioma' => $lang, "tipo" => $tipo)); $db_tex = $base->seleciona('textos', $where2, null); $up_where = json_encode($where2); } else { $db_tex = $base->seleciona('textos', $where1, null); $up_where = json_encode($where1); } } } $ln = $db_tex[0]; } } } else { $tipo = false; } if (!empty($ln)) {
if (isset($poste["img_atual"])) { unset($poste["img_atual"]); } if (!empty($_FILES["foto"]["type"])) { $ext_valida = array("jpeg", "jpg", "png"); $temp = explode(".", $_FILES["foto"]["name"]); $extencao_arquivo = strtolower(end($temp)); if (($_FILES["foto"]["type"] == "image/png" || $_FILES["foto"]["type"] == "image/jpg" || $_FILES["foto"]["type"] == "image/jpeg") && $_FILES["foto"]["size"] < 100000000 && in_array($extencao_arquivo, $ext_valida)) { if ($_FILES["foto"]["error"] > 0) { $resultado['msg'] = "Codigo do erro:" . $_FILES["foto"]["error"]; } else { $arquivo_tempor = $_FILES['foto']['tmp_name']; $poste["foto"] = md5(uniqid(time())) . "." . $extencao_arquivo; if (!file_exists("../../uploads/" . $tabela)) { mkdir("../../uploads/" . $tabela, 0777, true); } $local = "../../uploads/" . $tabela . "/" . $poste["foto"]; move_uploaded_file($arquivo_tempor, $local); $resultado['img_atual'] = $poste["foto"]; } } else { $resultado['msg'] = "erro"; exit; } } $id = $banco->inserir($tabela, $poste); $resultado['id'] = $id; } } echo json_encode($resultado); }
<?php $js = ""; if (!empty($_GET['lang'])) { $get_lang = addslashes($_GET['lang']); $js = json_encode(array("sigla_idioma" => $get_lang)); } else { $get_lang = false; } if ($get_lang) { $disable = ""; $db_trad = $base->seleciona('traducao', array("sigla_idioma" => $get_lang), null); if ($db_trad == true) { $dx = $db_trad[0]; $palavas2 = json_decode(stripslashes($dx->json), true); } else { $base->inserir('traducao', array("sigla_idioma" => $get_lang, "json" => json_encode($palavas))); $palavas2 = $palavas; } } else { $palavas2 = $palavas; $disable = "disabled"; } ?> <br> <br> <ul id="traducao" class="row"> <?php foreach ($palavas as $ide => $n) { echo "<li id='" . $ide . "' class='col-lg-6'><pre class='alert alert-dismissable alert-success' style='cursor: pointer;' id='" . strtolower($ide) . "' >" . $ide . "</pre><br>"; echo "<span data-togle='" . strtolower($ide) . "'>";
<a href="<?php echo adiciona_ao_get(array('exe' => 'lista'), array('id' => '')); ?> " class="btn btn-default"><i class="glyphicon glyphicon-list"></i></a> </div> <br> <?php if ($execulta == 'novo') { if (NIVEL_USUARIO == 5) { $arry_dados = array(); if (!empty($_POST)) { $arry_dados['nome'] = isset($_POST['nome']) ? addslashes($_POST['nome']) : ""; $arry_dados['login'] = isset($_POST['login']) ? addslashes($_POST['login']) : ""; $arry_dados['senha'] = isset($_POST['senha']) ? md5(addslashes($_POST['senha'])) : ""; $insert = $base->inserir($tabela, $arry_dados); if ($insert) { ?> <script>window.location = "index.php<?php echo adiciona_ao_get(array('exe' => 'lista')); ?> ";</script> <?php } } ?> <form action="" method="POST"> <h1>Novo usuario</h1> <div class="col-lg-6">