Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php goto uPkz5; QDf8U: function consulta_bd($campos, $table, $conditions, $orden) { $..

Decoded Output download

<?php  
 goto uPkz5; QDf8U: function consulta_bd($campos, $table, $conditions, $orden) { $conexion = $GLOBALS["conexion"]; if ($campos == "*") { $sql0 = "SHOW columns FROM {$table}"; $run0 = mysqli_query($conexion, $sql0); $cant_columnas = mysqli_affected_rows($conexion); } else { $columnas = explode(",", $campos); $cant_columnas = count($columnas); } $sql = "SELECT {$campos} FROM {$table}"; $whereConsulta = ($conditions != '' and $conditions != "false") ? true : false; if ($whereConsulta) { $sql .= " WHERE {$conditions}"; } $whereOrden = ($orden != '' and $orden != "false") ? true : false; if ($whereOrden) { $sql .= " ORDER BY {$orden}"; } if (!mysqli_query($conexion, $sql)) { die("Error description: " . mysqli_error($conexion) . "<br /><br />{$sql}"); } $resulset = array(); $run = mysqli_query($conexion, $sql); $i = 0; while ($line = mysqli_fetch_array($run)) { $j = 0; $resulsetInterior = array(); while ($j <= $cant_columnas - 1) { $line2 = !empty($line[$j]) ? $line[$j] : "false"; $stripslashes = stripslashes($line2); array_push($resulsetInterior, $stripslashes); $j++; } array_push($resulset, $resulsetInterior); $i++; } return $resulset; } goto O4A3Z; gdecQ: function prevnext($id, $tabla, $galeria_id) { $filas = consulta_bd("id", "img_{$tabla}", "galeria_id = {$galeria_id}", "id ASC"); $i = 0; while ($i <= count($filas) - 1) { $id_actual = $filas[$i][0]; if ($id_actual == $id) { $return[0] = $filas[$i - 1][0]; $return[1] = $filas[$i + 1][0]; break; } $i++; } return $return; } goto PlIW1; hVtuw: function imagenWeb($url, $file) { $nombre_fichero = $_ENV["S3_URL"] . $url . $file; if (empty($file)) { return false; } if (strpos($_SERVER["HTTP_ACCEPT"], "image/webp") !== false) { $supported = true; } else { $supported = false; } if ($file == '') { if ($supported) { $imagen = "sinFoto.webp"; } else { $imagen = "sinFoto.jpg"; } return $url . $imagen; die; } $extension = pathinfo($file, PATHINFO_EXTENSION); $nombre_base = basename($file, "." . $extension); $nombreWebP = $nombre_base . ".webp"; $imagen2 = $_ENV["S3_URL"] . $url . $nombreWebP; if ($supported) { if (url_exists($imagen2)) { $imagen = $_ENV["S3_URL"] . $url . $nombreWebP; } else { $imagen = $nombre_fichero; } } else { $imagen = $nombre_fichero; } return $imagen; } goto r6KRE; JM1XE: function fecha_sql_nh($fecha) { if (strtotime($fecha)) { $fecha_cl = date("d/m/Y", strtotime($fecha)); } else { $fecha_cl = date("d/m/Y"); } return $fecha_cl; } goto MG6b2; prPQf: function get_permiso($tabla_id, $action, $perfil_admin) { switch ($action) { case "a": $action = 1; break; case "b": $action = 2; break; case "c": $action = 3; break; case "other": $action = 4; break; } $res = consulta_bd("permiso_id", "tablas_perfiles", "perfil_id = {$perfil_admin} AND tabla_id = {$tabla_id}", ''); $permiso = isset($res[0][0]) ? $res[0][0] : NULL; if (($action == 3 or $action == 2 or $action == 4) and $permiso == 3) { return true; } elseif ($action == 1 and $permiso != 1 and $permiso != NULL) { return true; } else { return false; } } goto jRmpd; in62A: function get_env() { if (!isset($_SESSION["env"])) { $env = get_option("env"); return $env == '' ? "desarrollo" : $env; } else { return $_SESSION["env"]; } } goto JIYWV; HpQKx: function del_bd_generic($table, $column, $val) { $conexion = $GLOBALS["conexion_writer"]; $sql = "DELETE FROM {$table} WHERE {$column} = '{$val}'"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto u4_Y0; voKB0: function singular($string) { $penultima = substr($string, -2, 1); $antepenultima = substr($string, -3, 1); if ($penultima == "e") { if ($antepenultima == "t" or $antepenultima == "j" or $antepenultima == "v") { $singular = substr($string, 0, -1); } else { $singular = substr($string, 0, -2); } } else { $singular = substr($string, 0, -1); } return $singular; } goto BNkaI; cnqDs: function get_sec_op($op) { $value = substr($op, -1, 1); return $value; } goto voKB0; pYgTb: function select($tabla, $columnas, $cod, $nombre, $tab_index, $where, $submit, $selected, $bloqueado) { $conexion = $GLOBALS["conexion"]; if ($cod != '') { $columnas = "{$cod},{$columnas}"; } $sql = "SELECT {$columnas} FROM {$tabla}"; if ($where != '') { $sql .= " {$where}"; } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $mostrar = "<select class="select" " . $bloqueado . " name="" . $nombre . "" id="" . $nombre . "" "; if ($tab_index != '') { $mostrar .= "tabindex="" . $tab_index . """; } if ($submit == "1") { $mostrar .= "onchange="cambiaSelect(this.value, this.name)">"; } elseif ($submit == "2") { $mostrar .= "onchange="submit();""; } else { $mostrar .= ">"; } $mostrar .= "<option value="0">Seleccione...</option>"; while ($res = mysqli_fetch_array($run)) { $mostrar .= "<option value="" . $res[0] . """; if ($res[0] == $selected) { $mostrar .= " selected="selected""; } if ($res[1]) { $opcion = $res[1]; } else { $opcion = $res[0]; } $mostrar .= ">" . ucwords($opcion) . "</option>"; } $mostrar .= "</select>"; echo "{$mostrar}"; } goto UTQ2t; GshGA: function check_user_loged($hash, $user) { $conexion = $GLOBALS["conexion"]; $is = consulta_bd("*", "clientes", "id = '{$user}' AND session_hash = '{$hash}'", ''); $cant = mysqli_affected_rows($conexion); if (count($is) == 1) { return true; } else { return false; } } goto ltklc; YabZF: function get_table_name($id) { $q = consulta_bd_por_id("display", "tablas", '', $id, ''); $nombre_real = $q["display"]; return $nombre_real; } goto rCD7b; bVNQb: function preview($cadena, $numerocaracteres) { $numeropalabrascadena = count(explode(" ", $cadena)); $cadenadividida = explode(" ", $cadena); $cadenamostrar = ''; $cadenaaux = ''; $cadenacompleta = "si"; for ($i = 0; $i <= $numeropalabrascadena; $i++) { $cadenaaux = $cadenaaux . @$cadenadividida[$i] . " "; if (strlen($cadenaaux) <= $numerocaracteres) { $cadenamostrar = $cadenamostrar . @$cadenadividida[$i] . " "; } else { $cadenacompleta = "no"; } } if ($cadenacompleta == "no") { $cadenamostrar .= " ..."; } return $cadenamostrar; } goto uDzTo; HYdwH: function get_post($except) { $excepciones = explode(",", $except); $excepciones[] = "posicion_img"; foreach ($_POST as $key => $val) { $ok = true; foreach ($excepciones as $no) { if ($key == trim($no)) { $ok = false; } } if ($ok) { if (!is_array($val)) { $valurl = urlencode($val); $variables .= "&{$key}={$valurl}"; } } } return $variables; } goto yOzLb; r6KRE: function url_exists($url = NULL) { if (empty($url)) { return false; } stream_context_set_default(array("http" => array("method" => "HEAD"))); $headers = @get_headers($url); sscanf($headers[0], "HTTP/%*d.%*d %d", $httpcode); $accepted_response = array(200, 301, 302); if (in_array($httpcode, $accepted_response)) { return true; } else { return false; } } goto nT16S; JFmn0: function obtenerURL() { $host = $_SERVER["HTTP_HOST"]; $url = $_SERVER["REQUEST_URI"]; return "https://" . $host . $url; } goto G9s4b; Y7oON: function resize_foto($file, $altura, $ancho, $bn) { $size = getimagesize($file); $width = intval($size[0]); $height = intval($size[1]); $altura = intval($altura); $ancho = intval($ancho); if ($width > $ancho) { $p = $ancho / $width; $x = $p * $width; $y = $p * $height; if ($y > $altura) { $p = $altura / $y; $x = $p * $x; $y = $p * $y; } } elseif ($height > $altura) { $p = $altura / $height; $x = $p * $width; $y = $p * $height; if ($x > $width) { $p = $altura / $x; $x = $p * $x; $y = $p * $y; } } else { $x = $width; $y = $height; } $ext = strtolower(substr(strrchr($file ?? '', "."), 1)); $date = date("dhis"); $nombre = $date . "_resized." . $ext; switch ($ext) { case "jpg": $imagen_origen = imagecreatefromjpeg($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); imagefilter($imagen_origen2, IMG_FILTER_GRAYSCALE); } if (isset($x) and intval($x) > 0) { $imagen_destino = imagecreatetruecolor(intval($x), intval($y)); $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, intval($x), intval($y), intval($width), intval($height)); $src = imagejpeg($imagen_destino, $nombre, 100); } break; case "png": $imagen_destino = imagecreatetruecolor($x, $y); imagealphablending($imagen_destino, false); imagesavealpha($imagen_destino, true); $imagen_origen = imagecreatefrompng($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); } imagealphablending($imagen_origen, true); $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, $x, $y, $width, $height); $src = imagepng($imagen_destino, $nombre, 9); break; case "gif": $imagen_origen = imagecreatefromgif($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); } $imagen_destino = imagecreatetruecolor($x, $y); $transcolor = imagecolortransparent($imagen_origen); if ($transcolor != -1) { $trnprt_color = imagecolorsforindex($imagen_origen, $transcolor); $trnprt_indx = imagecolorallocatealpha($imagen_destino, $trnprt_color["red"], $trnprt_color["green"], $trnprt_color["blue"], $trnprt_color["alpha"]); imagefill($imagen_destino, 0, 0, $trnprt_indx); imagecolortransparent($imagen_destino, $trnprt_indx); } $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, $x, $y, $width, $height); $src = imagegif($imagen_destino, $nombre, 100); break; } return $nombre; } goto dgTi3; jRmpd: function is_boolean($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; return $type == "tinyint(1)" ? true : false; } goto nO0T3; onjVT: function has_array($array, $string) { foreach ($array as $a) { if (is_numeric(strrpos($string, trim($a)))) { $ok = true; break; } else { $ok = false; } } return $ok; } goto fTrQB; CIUul: function update_entry($exclusiones, $tabla, $conditions) { $values = "fecha_modificacion = NOW()"; foreach ($_POST as $key => $val) { if (!strpos(" " . $exclusiones, $key)) { $values .= ", {$key} = '{$val}'"; } } $insert = update_bd($tabla, $values, $conditions); if ($insert) { return true; } else { return false; } } goto KT6fJ; v88rT: function manage_files($col_archivos, $opcion, $tabla, $id) { $dir = "../../imagenes/{$tabla}"; $dir_docs = "../../docs/{$tabla}"; if (count($col_archivos) > 1) { foreach ($col_archivos as $row) { $row = trim($row); $file = $_FILES[$row]["name"]; if ($file != '' and $file != "false") { $file_ext = strtolower(substr(strrchr($_FILES[$row]["name"], "."), 1)); if ($opcion[trim($row)] and $opcion[$row] != '' and $opcion[$row] != "false") { $tamanos = explode(",", $opcion[trim($row)]); $width = intval($tamanos[0]); $height = intval($tamanos[1]); } else { $width = ($opcion["width"] != '' and $opcion["width"] != "false") ? (int) $opcion["width"] : 0; $height = ($opcion["height"] != '' and $opcion["height"] != "false") ? (int) $opcion["height"] : 0; } if ($width != 0 and $height != 0) { if ($file_ext == "jpg" or $file_ext == "gif" or $file_ext == "png") { $width_thumb = (int) $opcion["width_thumb"]; $height_thumb = (int) $opcion["height_thumb"]; $thumb = $width_thum != '' ? 1 : 0; $img = add_img(trim($row), $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, false); $error .= $img["error"]; $values .= $img["valores"]; } else { $error .= "Formato de archivo incorrecto.&tipo=error"; } } elseif ($file_ext != '' and $file_ext != "false") { $extensions = "doc, docx, ppt, pptx, xls, xlsx, pdf, dwg, swf"; $file = add_file($row, $dir_docs, $tabla, $id, $extensions); $error .= $file["error"]; $values .= $file["valores"]; } } } } else { $file = $_FILES[$col_archivos]["name"]; $file_ext = strtolower(substr(strrchr($_FILES[$col_archivos]["name"], "."), 1)); if ($opcion[trim($row)] and $opcion[$row] != '' and $opcion[$row] != "false") { $tamanos = explode(",", $opcion[trim($row)]); $width = intval($tamanos[0]); $height = intval($tamanos[1]); } else { $width = $opcion["width"] != '' ? (int) $opcion["width"] : 0; $height = $opcion["height"] != '' ? (int) $opcion["height"] : 0; } if ($width != 0 and $height != 0) { if ($file_ext == "jpg" or $file_ext == "gif" or $file_ext == "png") { $width_thumb = (int) $opcion["width_thumb"]; $height_thumb = (int) $opcion["height_thumb"]; $thumb = $width_thumb != '' ? 1 : 0; $img = add_img($col_archivos, $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, false); $error .= $img["error"]; $values .= $img["valores"]; } else { $error .= "Formato de archivo incorrecto.&tipo=error"; } } elseif ($file_ext != '' and $file_ext != "false") { $extensions = "doc, docx, ppt, pptx, xls, xlsx, pdf, dwg, swf"; $file = add_file(trim($col_archivos), $dir_docs, $tabla, $id, $extensions); $error .= $file["error"]; $values .= $file["valores"]; $entro = $values; } } return array("error" => $error, "values" => $values); } goto SKXX3; ag7l9: function get_valor_economico($valor) { $url = "https://moldeable.com/valores_economicos/{$valor}.php"; $lineas = file($url); return trim(strip_tags($lineas[0])); } goto KBoc5; PGRXF: function get_last($table) { $conexion = $GLOBALS["conexion"]; $sql = "SELECT id FROM {$table} ORDER BY id DESC LIMIT 1"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $last = $res[0]; return $last; } goto LuGrJ; zLsmA: function dias_transcurridos($fecha_i, $fecha_f) { $dias = (strtotime($fecha_i) - strtotime($fecha_f)) / 86400; $dias = abs($dias); if (strtotime($fecha_i) > strtotime($fecha_f)) { return "-" . $dias; } else { return $dias; } } goto P8YDy; ltklc: function webp($img) { $extension = pathinfo($img, PATHINFO_EXTENSION); $nombre_base = basename($img, "." . $extension); $nombreWebP = $nombre_base . ".webp"; return $nombreWebP; } goto Q92wT; JIYWV: function check_install() { if (file_exists("install.php")) { die(header("location:install.php")); } return false; } goto gdecQ; nT16S: function consulta_bd2($campos, $table, $conditions, $orden, $arrCondiciones) { $conexion = $GLOBALS["conexion"]; $columnas = explode(",", $campos); $cant_columnas = count($columnas); $sql = "SELECT {$campos} FROM {$table}"; if ($conditions != '') { $sql .= " WHERE {$conditions}"; } if ($orden != '') { $sql .= " ORDER BY {$orden}"; } if ($run = $conexion->prepare($sql)) { $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($run, $refArr); $run->execute(); $meta = $run->result_metadata(); while ($field = $meta->fetch_field()) { $params[] =& $row[$field->name]; } call_user_func_array(array($run, "bind_result"), $params); if (!$run) { die("Error description: " . $run->error); } $i = 0; while ($run->fetch()) { $j = 0; foreach ($row as $key => $val) { $c[$j] = $val; $j++; } $result[] = $c; $i++; } $run->close(); } else { printf("Errormessage: %s 
", $conexion->error); printf("consulta: %s 
", $sql); } return $result; } goto Q1S3a; JYUxP: function eng_sql($string) { $newstring = stripslashes($string); $new = addslashes($newstring); return $new; } goto hNqtB; A_S8s: function tiempoSesion() { $inactivo = 36000; if (isset($_SESSION["tiempo"])) { $vida_session = time() - $_SESSION["tiempo"]; $_SESSION["tiempoVidaSesion"] = $vida_session; if ($vida_session > $inactivo) { unset($_SESSION["usuario_id"]); unset($_SESSION["tiempo"]); unset($_SESSION["tiempoVidaSesion"]); return false; } else { return true; } } else { $_SESSION["tiempo"] = time(); return true; } } goto GshGA; vxwG9: function del_bd($table, $id) { $conexion = $GLOBALS["conexion_writer"]; $sql = sprintf("DELETE FROM {$table} WHERE id = '%d'", mysqli_real_escape_string($conexion, $id)); $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto BukG9; Yzft3: function is_dependent($name) { $buscar = "_id"; if (strrpos($name, $buscar)) { return true; } else { return false; } } goto Vy20M; Kosu3: function diferencia_fechas($date1, $date2) { $date1_seconds = strtotime($date1); $date2_seconds = strtotime($date2); $dif_seg = $date2_seconds - $date1_seconds; if ($dif_seg < 60) { $return = "hace {$dif_seg} segundos"; } else { $dif_min = floor($dif_seg / 60); if ($dif_min < 60) { if ($dif_min == 1) { $return = "hace {$dif_min} minuto"; } else { $return = "hace {$dif_min} minutos"; } } else { $dif_hora = floor($dif_min / 60); if ($dif_hora < 24) { if ($dif_hora == 1) { $return = "hace {$dif_hora} hora"; } else { $return = "hace {$dif_hora} horas"; } } else { $dif_dias = floor($dif_hora / 24); if ($dif_dias < 24) { if ($dif_dias == 1) { $hora_publicacion = date("H:m:s", $date1_seconds); $return = "ayer a las {$hora_publicacion}"; } else { $return = "hace {$dif_dias} das"; } } else { $date_1_b = date("m-d-Y", $date1_seconds); $return = "el {$date_1_b}"; } } } } return $return; } goto ZGpEO; vKK8h: function extension($nombre_archivo) { $nombre = explode(".", $nombre_archivo); $extension = end($nombre); return $extension; } goto nGiPB; Ynwkk: function formato_fecha($fecha, $idioma) { $fechas = explode("-", $fecha); $ano = $fechas[0]; $dia = $fechas[2]; if ($fechas[1] == "01") { if ($idioma == "esp") { $mes = "Enero"; } else { if ($idioma == "eng") { $mes = "January"; } } } else { if ($fechas[1] == "02") { if ($idioma == "esp") { $mes = "Febrero"; } else { if ($idioma == "eng") { $mes = "February"; } } } else { if ($fechas[1] == "03") { if ($idioma == "esp") { $mes = "Marzo"; } else { if ($idioma == "eng") { $mes = "March"; } } } else { if ($fechas[1] == "04") { if ($idioma == "esp") { $mes = "Abril"; } else { if ($idioma == "eng") { $mes = "April"; } } } else { if ($fechas[1] == "05") { if ($idioma == "esp") { $mes = "Mayo"; } else { if ($idioma == "eng") { $mes = "May"; } } } else { if ($fechas[1] == "06") { if ($idioma == "esp") { $mes = "Junio"; } else { if ($idioma == "eng") { $mes = "Jun"; } } } else { if ($fechas[1] == "07") { if ($idioma == "esp") { $mes = "Julio"; } else { if ($idioma == "eng") { $mes = "July"; } } } else { if ($fechas[1] == "08") { if ($idioma == "esp") { $mes = "Agosto"; } else { if ($idioma == "eng") { $mes = "August"; } } } else { if ($fechas[1] == "09") { if ($idioma == "esp") { $mes = "Septiembre"; } else { if ($idioma == "eng") { $mes = "September"; } } } else { if ($fechas[1] == "10") { if ($idioma == "esp") { $mes = "Octubre"; } else { if ($idioma == "eng") { $mes = "October"; } } } else { if ($fechas[1] == "11") { if ($idioma == "esp") { $mes = "Noviembre"; } else { if ($idioma == "eng") { $mes = "November"; } } } else { if ($fechas[1] == "12") { if ($idioma == "esp") { $mes = "Diciembre"; } else { if ($idioma == "eng") { $mes = "December"; } } } } } } } } } } } } } } if ($dia == '') { return ''; } else { if ($idioma == "esp") { return $dia . " de " . $mes . " del " . $ano; } else { return $mes . " " . $dia . " " . $ano; } } } goto zLsmA; yOzLb: function get_gets($except) { $excepciones = explode(",", $except); foreach ($_GET as $key => $val) { $ok = true; foreach ($excepciones as $no) { if ($key == trim($no)) { $ok = false; } } if ($ok) { $valurl = urlencode($val); $variables .= "&{$key}={$valurl}"; } } return $variables; } goto UsbuF; Q92wT: function logClientes($tipo, $cadena, $cardcode) { if (file_exists(__DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log")) { } else { $fileName = __DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log"; $contenidoInicial = "Log Clientes " . date("Y-m-d") . " 
"; file_put_contents($fileName, $contenidoInicial); } $arch = fopen(__DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log", "a+"); fwrite($arch, $tipo . ": " . $cadena . " 
"); fclose($arch); } goto GcwbB; hzrDZ: function update_bd($table, $values, $conditions) { $conexion = $GLOBALS["conexion_writer"]; $sql = "UPDATE {$table} SET {$values} "; if ($conditions != '') { $sql .= "WHERE {$conditions}"; } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto FVw9g; SKXX3: function is_animated_gif($filename) { $raw = file_get_contents($filename); $offset = 0; $frames = 0; while ($frames < 2) { $where1 = strpos($raw, "!", $offset); if ($where1 === false) { break; } else { $offset = $where1 + 1; $where2 = strpos($raw, ",", $offset); if ($where2 === false) { break; } else { if ($where1 + 8 == $where2) { $frames++; } $offset = $where2 + 1; } } } return $frames > 1; } goto T3lhr; ZGpEO: function select_paises() { $return = "<select name="select_pais"><option value="">Seleccione...</option><option value="Africa">Africa</option><option value="Argentina">Argentina</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Belgium">Belgium</option><option value="Brazil">Brazil</option><option value="Bulgaria">Bulgaria</option><option value="Canada">Canada</option><option value="Caribbean">Caribbean</option><option value="Central America">Central America</option><option value="Chile" selected="selected">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Costa Rica">Costa Rica</option><option value="Croatia">Croatia</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Dominican Republic">Dominican Republic</option><option value="Estonia">Estonia</option><option value="Finland">Finland</option><option value="France">France</option><option value="Germany">Germany</option><option value="Greece">Greece</option><option value="Guatemala">Guatemala</option><option value="Hong Kong">Hong Kong</option><option value="Hungary">Hungary</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Japan">Japan</option><option value="Korea">Korea</option><option value="Latvia">Latvia</option><option value="Lithuania">Lithuania</option><option value="Malaysia">Malaysia</option><option value="Mexico">Mexico</option><option value="Middle East">Middle East</option><option value="Morocco">Morocco</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Norway">Norway</option><option value="Panama">Panama</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Puerto Rico">Puerto Rico</option><option value="Romania">Romania</option><option value="Russian Federation">Russian Federation</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Taiwan">Taiwan</option><option value="Thailand">Thailand</option><option value="Turkey">Turkey</option><option value="Ukraine">Ukraine</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option></select>"; return $return; } goto HYdwH; LJso4: function enum_vals($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; $buscar = array("enum", "(", ")", "'"); $vals = str_replace($buscar, '', $type); return explode(",", $vals); } goto T6mW3; Q1S3a: function update_bd2($table, $values, $conditions, $arrCondiciones) { $conexion = $GLOBALS["conexion_writer"]; $sql = "UPDATE {$table} SET {$values} WHERE {$conditions}"; $stmt = $conexion->prepare($sql); $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($stmt, $refArr); $stmt->execute(); if ($run) { return true; } else { return false; } } goto ftE65; T6mW3: function img_tag($file, $w, $h) { $size = getimagesize($file); $width = $size[0]; $height = $size[1]; if ($width > $w) { $p = $w / $width; $x = $p * $width; $y = $p * $height; if ($y > $h) { $p = $h / $y; $x = $p * $x; $y = $p * $y; } } elseif ($height > $h) { $p = $h / $height; $x = $p * $width; $y = $p * $height; if ($x > $width) { $p = $h / $x; $x = $p * $x; $y = $p * $y; } } else { $x = $width; $y = $height; } return "<img src="" . $file . "" width="" . $x . "px" height="" . $y . "px" border="0">"; } goto e1kzm; qSlna: function obtener_tabla_id($tabla) { $filas = consulta_bd("id", "tablas", "nombre = '{$tabla}'", ''); $id = $filas[0][0]; return $id; } goto FOwg4; P8YDy: function previewDatos($dato) { $datoCodificado = ''; $caracteres = str_split($dato); foreach ($caracteres as $key => $valor) { if ($key > 3) { if ($valor == " ") { $datoF = " "; } elseif ($valor == "@") { $datoF = $valor; } else { $datoF = "*"; } } else { $datoF = $valor; } $datoCodificado .= $datoF; } return $datoCodificado; } goto yMOEV; XdvMZ: function obtener_tabla($val_op) { $filas = consulta_bd("nombre", "tablas", "id = '{$val_op}'", ''); $nombre = (is_countable($filas) and count($filas) > 0) ? $filas[0][0] : false; return $nombre; } goto qSlna; BNkaI: function get_real_name($nombre) { $real_name = str_replace("_", " ", $nombre); $palabras = explode(" ", $real_name); if (count($palabras) > 1) { $i == 0; foreach ($palabras as $palabra) { $nombre_final .= $i == 0 ? ucwords(ortografia($palabra)) : " " . ortografia($palabra); $i++; } } else { $nombre_final = ucwords(ortografia($nombre)); } return $nombre_final; } goto QYdQ9; rCD7b: function is_md5($var) { return preg_match("/^[A-Fa-f0-9]{32}$/", $var); } goto TGzmL; LuGrJ: function fecha_sql($fecha) { if (strtotime($fecha)) { $fecha_cl = date("d/m/Y - H:i", strtotime($fecha)); } else { $fecha_cl = date("d/m/Y - H:i"); } return $fecha_cl; } goto JM1XE; e1kzm: function is_date($string) { if (strlen($string) == 10 || strlen($string) == 19) { $dia = substr($string, 8, 2); $ano = substr($string, 0, 4); $mes = substr($string, 5, 2); if (is_numeric($dia) and is_numeric($mes) and is_numeric($ano)) { return checkdate($mes, $dia, $ano); } else { return false; } } else { return false; } } goto v88rT; u4_Y0: function delete_bd_where($table, $where) { $conexion = $GLOBALS["conexion_writer"]; $sql = "DELETE FROM {$table} WHERE {$where}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto hQHc5; hNqtB: function insert_entry($exclusiones, $tabla) { $keys = "fecha_creacion"; $vals = "NOW()"; foreach ($_POST as $key => $val) { if (!strpos(" " . $exclusiones, $key)) { $keys .= ", {$key}"; $vals .= ", '{$val}'"; } } $insert = insert_bd($tabla, $keys, $vals); if ($insert) { return true; } else { return false; } } goto CIUul; Vy20M: function column_is_related($column) { $is_id = substr($column, -3, 3); if ($is_id == "_id") { $parent_name = substr($column, 0, -3); return $parent_name; } else { return false; } } goto Toq55; OjbiE: function validar_rut($r, $dv) { $r = str_replace(".", '', trim($r)); $s = 1; for ($m = 0; $r != 0; $r /= 10) { $s = ($s + $r % 10 * (9 - $m++ % 6)) % 11; } return chr($s ? $s + 47 : 75) == strtoupper($dv); } goto Yzft3; BukG9: function truncate($table) { $conexion = $GLOBALS["conexion_writer"]; $sql = sprintf("DELETE FROM {$table}", $conexion); $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto HpQKx; T3lhr: function add_file($input_name, $dir, $tabla, $id, $extensions) { $conexion = $GLOBALS["conexion"]; if (!file_exists($dir . "/")) { $mk = mkdir($dir); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } if ($error == '') { if ($_FILES[$input_name]["name"]) { if ($_FILES[$input_name]["size"] < 209715200) { $file_name = str_replace(" ", "_", substr($_FILES[$input_name]["name"], 0, -4)); $file_name = str_replace(".", '', $file_name); $file_ext = strtolower(substr(strrchr($_FILES[$input_name]["name"], "."), 1)); $extension = explode(",", $extensions); $cant_ex = count($extension); $ok = false; foreach ($extension as $ex) { if ($file_ext == trim($ex)) { $ok = true; break; } } if ($ok) { $date = date("dmhis"); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir1 = "{$dir}/{$archivo}"; $move = move_uploaded_file($_FILES[$input_name]["tmp_name"], $dir1); if ($move) { if ($id) { $img_q = "SELECT {$input_name} FROM {$tabla} WHERE id = '{$id}'"; $run = mysqli_query($conexion, $img_q); $res = mysqli_fetch_array($run); $img = "{$dir}/" . $res[0]; if ($res[0] != '') { unlink($img); } } $values .= ", {$input_name} = '{$archivo}'"; } else { $error = "Error al cargar el archivo, por favor intntelo nuevamente.&tipo=error"; } } else { $error = "Tipo de archivo incorrecto, debe ser {$extensions} y es {$file_ext}&tipo=notificacion"; } } else { $error = "Tamao del archivo debe ser menor a 200MB &tipo=notificacion"; } } else { $error = "Error al procesar el archivo, archivo no encontrado.&tipo=error"; } } $return = array("error" => $error, "valores" => $values); return $return; } goto nG7M3; yMOEV: function sumaDiasHabiles() { $fechaInicial = date("Y-m-d"); $MaxDias = 2; for ($i = 0; $i < $MaxDias; $i++) { $Segundos = $Segundos + 86400; $caduca = date("D", time() + $Segundos); if ($caduca == "Sat") { $i--; } else { if ($caduca == "Sun") { $i--; } else { $FechaFinal = date("d-m-Y", time() + $Segundos); } } } return $FechaFinal; } goto JFmn0; nGiPB: function extraer_numero($cadena) { $numero = ''; for ($index = 0; $index < strlen($cadena); $index++) { if (is_numeric($cadena[$index])) { $numero .= $cadena[$index]; } } return $numero; } goto ag7l9; uPkz5: date_default_timezone_set("America/Santiago"); goto in62A; v03jA: function get_nombre_sitio($nombre) { $largo = strlen($nombre); $buscar = "_"; if (strrpos($nombre, $buscar)) { $nombre_real = ucwords(strtolower(substr(strrchr($nombre, "_"), 1))); } else { $nombre_real = ucwords($nombre); } return $nombre_real; } goto ri5bJ; gN_5x: function prepare_img($html) { $url_sitio = get_option("url_sitio"); return str_replace("src="../", "src="" . $url_sitio . "/", $html); } goto prPQf; yAOrQ: function num_hojas($page, $total, $limite_hoja, $op, $buscar) { if ($total > $limite_hoja) { $restantes = $total - $limite_hoja; $hojas = ceil($restantes / $limite_hoja); if ($page != 0) { $prev = $page; echo "<a href="index.php?op=" . $op . "&page=" . $prev . "&buscar=" . $buscar . "" class="page">Anterior</a> "; } $j = 0; while ($j <= $hojas) { $k = $j + 1; echo "<a href="index.php?op=" . $op . "&page=" . $k . "&buscar=" . $buscar . "" "; if ($page == $j) { echo "class="page_selected">"; } else { echo "class="page">"; } echo $k; echo "</a> "; $j++; } if ($page != $hojas) { $next = $page + 2; echo "<a href="index.php?op=" . $op . "&page=" . $next . "&buscar=" . $buscar . "" class="page" onclick="submit()">Siguiente</a> "; } } } goto PGRXF; nkYr4: function column_exists($table, $column) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW columns FROM {$table}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error() . "<br /><br />{$sql}"); $i = 0; $z = 0; while ($line = mysqli_fetch_array($run)) { $ok = false; if (trim($column) == $line[0]) { $ok = true; break; } $i++; } return $ok; } goto gN_5x; GIbdc: function is_inside($buscados, $string) { $exclusiones = explode(",", $buscados); $is_id = substr($string, -3, 3); if ($is_id != "_id") { foreach ($exclusiones as $no) { if ($string == trim($no)) { return true; break; } else { $ok = 1; } } } else { $ok = 1; } if ($ok) { return false; } } goto JYUxP; GIWji: function does_url_exists($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($code == 200) { $status = true; } else { $status = false; } curl_close($ch); return $status; } goto CZMcD; O4A3Z: function consulta_bd_por_id($campos, $table, $conditions, $id) { $conexion = $GLOBALS["conexion"]; if (is_numeric((int) $id)) { $sql = "SELECT {$campos} FROM {$table}"; if ($conditions != '') { $sql .= " WHERE {$conditions} AND id = '{$id}'"; } else { $sql .= " WHERE id = '{$id}'"; } } else { die("Error, identificador no vlido"); } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $line = mysqli_fetch_array($run); return $line; } goto hzrDZ; hQHc5: function show_columns($table, $exception) { $conexion = $GLOBALS["conexion"]; if ($exception != '') { $excepciones = explode(",", $exception); } $sql = "SHOW columns FROM {$table}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $i = 0; $z = 0; while ($line = mysqli_fetch_array($run)) { $ok = true; foreach ($excepciones as $val) { if (trim($val) == $line[0]) { $ok = false; } } if ($ok) { $resulset[$z] = "{$line["0"]}"; $z++; } $i++; } return $resulset; } goto yAOrQ; nO0T3: function is_enum($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; return substr_count($type, "enum") != 0 ? true : false; } goto LJso4; CZMcD: function imagen($url, $file) { $nombre_fichero = $url . $file; if (strpos($_SERVER["HTTP_ACCEPT"], "image/webp") !== false) { $supported = true; } else { $supported = false; } if ($file == '') { if ($supported) { $imagen = "sinFoto.webp"; } else { $imagen = "sinFoto.jpg"; } return $url . $imagen; die; } $extension = pathinfo($file, PATHINFO_EXTENSION); $nombre_base = basename($file, "." . $extension); $nombreWebP = $nombre_base . ".webp"; if ($supported) { if (file_exists($url . $nombreWebP)) { $imagen = $url . $nombreWebP; } else { $imagen = $nombre_fichero; } } else { $imagen = $nombre_fichero; } return $imagen; } goto hVtuw; G9s4b: function opciones($campo) { $conexion = $GLOBALS["conexion"]; $opciones = consulta_bd("valor", "opciones", "nombre = '{$campo}'", ''); if (is_countable($opciones) and count($opciones) > 0) { $valor = $opciones[0][0]; return $valor; } } goto GIWji; K_vKS: function del_file($file) { if (file_exists($file)) { $unlink = unlink($file); if ($unlink) { return true; } else { return false; } } else { return false; } } goto GIbdc; FVw9g: function insert_bd($table, $campos, $values) { $conexion = $GLOBALS["conexion_writer"]; $sql = "INSERT INTO {$table} ({$campos}) VALUES ({$values})"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto vxwG9; FOwg4: function comprobar_rut($sUsr) { $sUsr = str_replace(".", '', $sUsr); if (!preg_match("/(\d{7,8})-([\dK])/", strtoupper($sUsr), $aMatch)) { return false; } $sRutBase = substr(strrev($aMatch[1]), 0, 8); $sCodigoVerificador = $aMatch[2]; $iCont = 2; $iSuma = 0; for ($i = 0; $i <= strlen($sRutBase); $i++) { if ($iCont > 7) { $iCont = 2; } $iSuma += $sRutBase[$i] * $iCont; $iCont++; } $iDigito = 11 - $iSuma % 11; $sCaracter = substr("-123456789K0", $iDigito, 1); return $sCaracter == $sCodigoVerificador; } goto OjbiE; uDzTo: function comprobar_mail($email) { $mail_correcto = 0; if (strlen($email) >= 6 && substr_count($email, "@") == 1 && substr($email, 0, 1) != "@" && substr($email, strlen($email) - 1, 1) != "@") { if (!strstr($email, "'") && !strstr($email, """) && !strstr($email, "\") && !strstr($email, "$") && !strstr($email, " ")) { if (substr_count($email, ".") >= 1) { $term_dom = substr(strrchr($email, "."), 1); if (strlen($term_dom) > 1 && strlen($term_dom) < 5 && !strstr($term_dom, "@")) { $antes_dom = substr($email, 0, strlen($email) - strlen($term_dom) - 1); $caracter_ult = substr($antes_dom, strlen($antes_dom) - 1, 1); if ($caracter_ult != "@" && $caracter_ult != ".") { $mail_correcto = 1; } } } } } if ($mail_correcto) { return 1; } else { return 0; } } goto QDf8U; KBoc5: function url_amigables($url) { $find = array(" 
1", "", " 
d", "", "", "", "", "", "", "", "", ""); $repl = array("a", "e", "i", "o", "u", "n", "A", "E", "I", "O", "U", "N"); $url = str_replace($find, $repl, $url); $url = strtolower($url); $find = array(" ", "&", "
", "
", "+"); $url = str_replace($find, "-", $url); $find = array("/[^a-z0-9\-<>]/", "/[\-]+/", "/<[^>]*>/"); $repl = array('', "-", ''); $url = preg_replace($find, $repl, $url); return $url; } goto Ynwkk; dgTi3: function get_asociados($tabla, $asociados, $id) { $id_tabla = singular($tabla) . "_id"; $cantidad = consulta_bd("COUNT(*)", "{$asociados}", "{$id_tabla} = {$id}", ''); return $cantidad[0][0]; } goto vKK8h; PlIW1: function check_admin_loged($hash, $user) { $conexion = $GLOBALS["conexion"]; $is = consulta_bd("*", "administradores", "id = '{$user}' AND session_hash = '{$hash}'", ''); $cant = mysqli_affected_rows($conexion); if ($cant == 1) { return true; } else { return false; } } goto v03jA; UsbuF: function get_val_op($op) { $value = substr($op, 0, -1); return $value; } goto cnqDs; KT6fJ: function get_option($val) { $res = consulta_bd("valor", "opciones", "nombre = '{$val}'", ''); $respuesta = (is_countable($res) and count($res) > 0) ? $res[0][0] : false; return $respuesta; } goto nkYr4; fTrQB: function plural($string) { $ultima = substr($string, -1, 1); $vocales = array("a", "e", "i", "o", "u"); foreach ($vocales as $v) { if ($v == $ultima) { $ter = "s"; break; } else { $ter = "es"; } } $plural = "{$string}{$ter}"; return $plural; } goto XdvMZ; Toq55: function check_if_item_has_belongs_to($column) { $conexion = $GLOBALS["conexion"]; $nombre_tabla_hijo = plural(substr($column, 0, -3)); $id_tabla_hijo = consulta_bd("id", "tablas", "nombre = '{$nombre_tabla_hijo}'", ''); $id_tabla_hijo = $id_tabla_hijo[0][0]; $tabla = consulta_bd("valor", "opciones_tablas", "nombre = 'belongs_to' AND tabla_id = '{$id_tabla_hijo}'", ''); if (mysqli_affected_rows($conexion) > 0) { return $tabla[0][0]; } else { return false; } } goto K_vKS; nG7M3: function add_img($input_name, $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, $bn) { $conexion = $GLOBALS["conexion"]; if (opciones("s3_activo")) { $bucketName = $_ENV["S3_BUCKET"]; $IAM_KEY = $_ENV["S3_KEY"]; $IAM_SECRET = $_ENV["S3_SECRET"]; $s3 = new Aws\S3\S3Client(array("credentials" => array("key" => $IAM_KEY, "secret" => $IAM_SECRET), "version" => "latest", "region" => "us-east-2")); } if (!file_exists($dir . "/")) { $mk = mkdir($dir); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } if ($thumb) { $dir_thumb = "{$dir}/thumbs/"; if (!file_exists($dir_thumb)) { $mk = mkdir($dir_thumb); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } } if ($error == '') { if ($_FILES[$input_name]["name"]) { if ($_FILES[$input_name]["size"] < 200000000) { $file_name = substr($_FILES[$input_name]["name"], 0, -4); $file_name = str_replace(" ", "_", $file_name); $file_ext = strtolower(substr(strrchr($_FILES[$input_name]["name"], "."), 1)); if ($file_ext == "jpg" or $file_ext == "png" or $file_ext == "gif") { $date = date("dmhis"); $tmp_name = $date . "_" . $file_name . "." . $file_ext; $dir1 = "{$dir}/{$tmp_name}"; $move = move_uploaded_file($_FILES[$input_name]["tmp_name"], $dir1); if (!opciones("s3_activo")) { if ($move) { $animated_gif = is_animated_gif($dir1); if ($animated_gif) { $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $copy = rename($dir1, $dir2); } else { $new_file = resize_foto($dir1, $height, $width, false); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $copy = copy($new_file, $dir2); if (opciones("usar_webp")) { $archivoWebp = $date . "_" . $file_name . ".webp"; $dirWebp = "{$dir}/{$archivoWebp}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir2} -o {$dirWebp}"); } if ($thumb) { $new_file_thumb = resize_foto($dir1, $height_thumb, $width_thumb, false); $archivo_thumb = $date . "_" . $file_name . "." . $file_ext; $dir3 = "{$dir_thumb}/thumbs_{$archivo_thumb}"; $copy = copy($new_file_thumb, $dir3); if (opciones("usar_webp")) { $archivoWebp_thumb = $date . "_" . $file_name . ".webp"; $dirWebp2 = "{$dir_thumb}/{$archivoWebp_thumb}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir3} -o {$dirWebp2}"); } if ($bn) { $new_file_thumb_bn = resize_foto($dir1, $height_thumb, $width_thumb, true); $archivo_thumb_bn = $date . "_" . $file_name . "_bn." . $file_ext; $dir4 = "{$dir_thumb}/{$archivo_thumb_bn}"; $copy = copy($new_file_thumb_bn, $dir4); } } } if ($copy) { if (!$animated_gif) { unlink($new_file); unlink($dir1); } if ($id) { $img_q = "SELECT {$input_name} FROM {$tabla} WHERE id = '{$id}'"; $run = mysqli_query($conexion, $img_q); $res = mysqli_fetch_array($run); $img1 = "{$dir}/" . $res[0]; $img2 = "{$dir}/thumbs/" . $res[0]; if ($res[0] != '') { if (file_exists($img1)) { unlink($img1); } if (file_exists($img2)) { unlink($img2); } } } $values .= ", {$input_name} = '{$archivo}'"; } else { $size = getimagesize($dir); $error = "Error al copiar la imagen&tipo=error"; } } else { $error = "Error al cargar la imgen, por favor int 
9ntelo nuevamente y revise el tamao de la imagen.&tipo=ventana"; } } else { if ($file_ext == "jpg" or $file_ext == "png") { $new_file = resize_foto($dir1, $height, $width, false); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $dir2 = str_replace("../", '', $dir2); $result = $s3->putObject(array("Bucket" => $_ENV["S3_BUCKET"], "Key" => $dir2, "SourceFile" => $new_file, "ACL" => "public-read")); if (opciones("usar_webp")) { $archivoWebp = $date . "_" . $file_name . ".webp"; $dirWebp = "{$dir}/{$archivoWebp}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir2} -o {$dirWebp}"); } if ($thumb) { $new_file_thumb = resize_foto($dir1, $height_thumb, $width_thumb, false); $archivo_thumb = $date . "_" . $file_name . "." . $file_ext; $dir3 = "{$dir_thumb}/thumbs_{$archivo_thumb}"; $copy = copy($new_file_thumb, $dir3); if (opciones("usar_webp")) { $archivoWebp_thumb = $date . "_" . $file_name . ".webp"; $dirWebp2 = "{$dir_thumb}/{$archivoWebp_thumb}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir3} -o {$dirWebp2}"); } if ($bn) { $new_file_thumb_bn = resize_foto($dir1, $height_thumb, $width_thumb, true); $archivo_thumb_bn = $date . "_" . $file_name . "_bn." . $file_ext; $dir4 = "{$dir_thumb}/{$archivo_thumb_bn}"; $copy = copy($new_file_thumb_bn, $dir4); } } $values .= ", {$input_name} = '{$archivo}'"; } elseif ($file_ext == "gif") { $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $result = $s3->putObject(array("Bucket" => opciones("s3_bucket"), "Key" => $dir2, "SourceFile" => $_FILES[$input_name]["tmp_name"], "ACL" => "public-read")); $values .= ", {$input_name} = '{$archivo}'"; } else { $error = "Tipo de archivo incorrecto, debe ser JPG, GIF o PNG.&tipo=error"; } } } else { $error = "Tipo de archivo incorrecto, debe ser JPG, GIF o PNG.&tipo=error"; } } else { $error = "Tamao de la imagen debe ser menor a 5 Mb &tipo=notificacion"; } } } $return = array("error" => $error, "valores" => $values); return $return; } goto Y7oON; ri5bJ: function get_table_id($table) { $q = consulta_bd("id", "tablas", "nombre = '{$table}'", ''); $id = $q[0][0]; return $id; } goto YabZF; MG6b2: function fecha_hes($fecha, $formato, $lang) { $mes_o = date("m", strtotime($fecha)); $dia = date("d", strtotime($fecha)); $ano = date("Y", strtotime($fecha)); $hora = date("H:i:s", strtotime($fecha)); if ($lang == "esp") { switch ($mes_o) { case "01": $mes = "Enero"; break; case "02": $mes = "Febrero"; break; case "03": $mes = "Marzo"; break; case "04": $mes = "Abril"; break; case "05": $mes = "Mayo"; break; case "06": $mes = "Junio"; break; case "07": $mes = "Julio"; break; case "08": $mes = "Agosto"; break; case "09": $mes = "Septiembre"; break; case "10": $mes = "Octubre"; break; case "11": $mes = "Noviembre"; break; case "12": $mes = "Diciembre"; break; } $sep = "de"; $sep2 = "a las"; } elseif ($lang == "ing") { switch ($mes) { case "01": $mes = "January"; break; case "02": $mes = "February"; break; case "03": $mes = "March"; break; case "04": $mes = "April"; break; case "05": $mes = "May"; break; case "06": $mes = "June"; break; case "07": $mes = "July"; break; case "08": $mes = "August"; break; case "09": $mes = "September"; break; case "10": $mes = "October"; break; case "11": $mes = "November"; break; case "12": $mes = "December"; break; } $sep = ''; $sep2 = "at"; } switch ($formato) { case 1: return "{$dia} {$sep} {$mes} {$sep} {$ano}"; break; case 2: return "{$mes} {$sep} {$ano}"; break; case 3: return "{$dia}/{$mes_o}/{$ano} {$sep2}"; break; case 4: return "{$dia}/{$mes_o}/{$ano} {$sep2} {$hora}"; break; } } goto Kosu3; QYdQ9: function ortografia($palabra) { $conexion = $GLOBALS["conexion"]; $regla_aguda = array("n", "s", "i", "u"); $regla_aguda_not = array("ay", "ey", "oy", "uy", "au", "eu", "ou", "os"); $regla_aguda_verbo = array("a", "e", "o"); $regla_grave = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "p", "q", "r", "t", "v", "w", "x", "y", "z"); $vocales = array("a", "e", "i", "o", "u"); $vocales_acentos = array(" 
1", "", " 
d", "", ""); $ultima_letra = strtolower(substr($palabra, -1)); $penultima_letra = strtolower(substr($palabra, -2, 1)); $largo_palabra = strlen($palabra); $palabras_bd = consulta_bd("busqueda", "ortografia", '', ''); $cant = mysqli_affected_rows($conexion); if ($cant > 0) { foreach ($palabras_bd as $pal) { $exclusiones_bd[] = $pal[0]; } } else { $exclusiones_bd[] = ''; } if (has_array($exclusiones_bd, $palabra)) { $palabra_bd = consulta_bd("mostrar", "ortografia", "busqueda = '{$palabra}'", ''); return $palabra_bd[0][0] != '' ? $palabra_bd[0][0] : $palabra; } else { if ($largo_palabra > 2) { if (has_array($regla_aguda, $ultima_letra)) { $resto_palabra = substr($palabra, 0, -2); $dos_ultimas_letras = strtolower(substr($palabra, -2)); $tres_ultimas_letras = strtolower(substr($palabra, -3)); if ($ultima_letra == "s" and !has_array($vocales, $penultima_letra)) { } else { if (!has_array($regla_aguda_not, $ultima_letra) and $tres_ultimas_letras != "gen") { $cambio_aguda = str_replace($vocales, $vocales_acentos, $dos_ultimas_letras); $palabra = $resto_palabra . $cambio_aguda; } } return $palabra; } if (has_array($regla_grave, $ultima_letra)) { $resto_palabra = substr($palabra, 2); $primeras_dos_letras = substr($palabra, 0, 2); $cambio = str_replace($vocales, $volcales_acentos, $primeras_dos_letras); $palabra = $primeras_dos_letras . $resto_palabra; return $palabra; } else { if ($largo_palabra % 2 == 0 and $largo_palabra > 2) { $ultimas_cuatro = strtolower(substr($palabra, -4)); $sin_ultimas_cuatro = strtolower(substr($palabra, 0, -4)); $siguientes_dos = strtolower(substr($sin_ultimas_cuatro, -2)); $resto = strtolower(substr($palabra, 0, -6)); $primera_letra = strtolower(substr($palabra, 0, 1)); $cambio_esd = (!has_array(array("l"), $siguientes_dos) and !has_array($vocales, $primera_letra) or has_array($vocales, $primera_letra)) ? $siguientes_dos : str_replace($vocales, $vocales_acentos, $siguientes_dos); $palabra = $resto . $cambio_esd . $ultimas_cuatro; return $palabra; } else { return $palabra; } } } else { return $palabra; } } } goto onjVT; ftE65: function insert_bd2($table, $campos, $values, $arrCondiciones) { $conexion = $GLOBALS["conexion_writer"]; $sql = "INSERT INTO {$table} ({$campos}) VALUES ({$values})"; $stmt = $conexion->prepare($sql); $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($stmt, $refArr); $stmt->execute(); if ($run) { return true; } else { return false; } } goto A_S8s; TGzmL: function formato_moneda($numero, $moneda, $echo) { if ($numero != NULL) { $longitud = strlen($numero); $punto = substr($numero, -1, 1); $punto2 = substr($numero, 0, 1); $separador = "."; if ($punto == ".") { $numero = substr($numero, 0, $longitud - 1); $longitud = strlen($numero); } if ($punto2 == ".") { $numero = "0" . $numero; $longitud = strlen($numero); } $num_entero = strpos($numero, $separador); $centavos = substr($numero, $num_entero); $l_cent = strlen($centavos); if ($l_cent == 2) { $centavos = $centavos . "0"; } elseif ($l_cent == 3) { $centavos = $centavos; } elseif ($l_cent > 3) { $centavos = substr($centavos, 0, 3); } $entero = substr($numero, -$longitud, $longitud - $l_cent); if (!$num_entero) { $num_entero = $longitud; $centavos = ".00"; $entero = substr($numero, -$longitud, $longitud); } $start = floor($num_entero / 3); $res = $num_entero - $start * 3; if ($res == 0) { $coma = $start - 1; $init = 0; } else { $coma = $start; $init = 3 - $res; } $d = $init; $i = 0; $c = $coma; while ($i <= $num_entero) { if ($d == 3 && $c > 0) { $d = 0; $sep = "."; $c = $c - 1; } else { $sep = ''; } $final .= $sep . $entero[$i]; $i = $i + 1; $d = $d + 1; } } else { $final = 0; } if ($moneda == "pesos") { $moneda = "$"; if ($echo) { echo $moneda . " " . $final; } else { return $moneda . " " . $final; } } elseif ($moneda == "dolares") { $moneda = "USD"; if ($echo) { echo $moneda . " " . $final . $centavos; } else { return $moneda . " " . $final . $centavos; } } elseif ($moneda == "euros") { $moneda = "EUR"; if ($echo) { echo $final . $centavos . " " . $moneda; } else { return $final . $centavos . " " . $moneda; } } else { if ($echo) { echo $final; } else { return $final; } } } goto pYgTb; UTQ2t: function checkbox($valor, $activo, $id) { if ($valor == "1") { $checked = "checked="checked""; } else { $checked = ''; } if ($activo == "1") { $disabled = ''; } elseif ($activo == "0") { $disabled = "disabled="disabled""; } if ($id != '') { $name = "checkbox{$id}"; } else { $name = "checkbox"; } $mostrar = "<label> 
	  					<input name="" . "{$name}" . "" type="checkbox" id="checkbox" " . $checked . " " . $disabled . " value="1"/> 
					</label>"; echo "{$mostrar}"; } goto bVNQb; GcwbB: ?>

Did this file decode correctly?

Original Code

<?php 
 goto uPkz5; QDf8U: function consulta_bd($campos, $table, $conditions, $orden) { $conexion = $GLOBALS["conexion"]; if ($campos == "*") { $sql0 = "SHOW columns FROM {$table}"; $run0 = mysqli_query($conexion, $sql0); $cant_columnas = mysqli_affected_rows($conexion); } else { $columnas = explode(",", $campos); $cant_columnas = count($columnas); } $sql = "SELECT {$campos} FROM {$table}"; $whereConsulta = ($conditions != '' and $conditions != "false") ? true : false; if ($whereConsulta) { $sql .= " WHERE {$conditions}"; } $whereOrden = ($orden != '' and $orden != "false") ? true : false; if ($whereOrden) { $sql .= " ORDER BY {$orden}"; } if (!mysqli_query($conexion, $sql)) { die("Error description: " . mysqli_error($conexion) . "<br /><br />{$sql}"); } $resulset = array(); $run = mysqli_query($conexion, $sql); $i = 0; while ($line = mysqli_fetch_array($run)) { $j = 0; $resulsetInterior = array(); while ($j <= $cant_columnas - 1) { $line2 = !empty($line[$j]) ? $line[$j] : "false"; $stripslashes = stripslashes($line2); array_push($resulsetInterior, $stripslashes); $j++; } array_push($resulset, $resulsetInterior); $i++; } return $resulset; } goto O4A3Z; gdecQ: function prevnext($id, $tabla, $galeria_id) { $filas = consulta_bd("id", "img_{$tabla}", "galeria_id = {$galeria_id}", "id ASC"); $i = 0; while ($i <= count($filas) - 1) { $id_actual = $filas[$i][0]; if ($id_actual == $id) { $return[0] = $filas[$i - 1][0]; $return[1] = $filas[$i + 1][0]; break; } $i++; } return $return; } goto PlIW1; hVtuw: function imagenWeb($url, $file) { $nombre_fichero = $_ENV["S3_URL"] . $url . $file; if (empty($file)) { return false; } if (strpos($_SERVER["HTTP_ACCEPT"], "image/webp") !== false) { $supported = true; } else { $supported = false; } if ($file == '') { if ($supported) { $imagen = "sinFoto.webp"; } else { $imagen = "sinFoto.jpg"; } return $url . $imagen; die; } $extension = pathinfo($file, PATHINFO_EXTENSION); $nombre_base = basename($file, "." . $extension); $nombreWebP = $nombre_base . ".webp"; $imagen2 = $_ENV["S3_URL"] . $url . $nombreWebP; if ($supported) { if (url_exists($imagen2)) { $imagen = $_ENV["S3_URL"] . $url . $nombreWebP; } else { $imagen = $nombre_fichero; } } else { $imagen = $nombre_fichero; } return $imagen; } goto r6KRE; JM1XE: function fecha_sql_nh($fecha) { if (strtotime($fecha)) { $fecha_cl = date("d/m/Y", strtotime($fecha)); } else { $fecha_cl = date("d/m/Y"); } return $fecha_cl; } goto MG6b2; prPQf: function get_permiso($tabla_id, $action, $perfil_admin) { switch ($action) { case "a": $action = 1; break; case "b": $action = 2; break; case "c": $action = 3; break; case "other": $action = 4; break; } $res = consulta_bd("permiso_id", "tablas_perfiles", "perfil_id = {$perfil_admin} AND tabla_id = {$tabla_id}", ''); $permiso = isset($res[0][0]) ? $res[0][0] : NULL; if (($action == 3 or $action == 2 or $action == 4) and $permiso == 3) { return true; } elseif ($action == 1 and $permiso != 1 and $permiso != NULL) { return true; } else { return false; } } goto jRmpd; in62A: function get_env() { if (!isset($_SESSION["env"])) { $env = get_option("env"); return $env == '' ? "desarrollo" : $env; } else { return $_SESSION["env"]; } } goto JIYWV; HpQKx: function del_bd_generic($table, $column, $val) { $conexion = $GLOBALS["conexion_writer"]; $sql = "DELETE FROM {$table} WHERE {$column} = '{$val}'"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto u4_Y0; voKB0: function singular($string) { $penultima = substr($string, -2, 1); $antepenultima = substr($string, -3, 1); if ($penultima == "e") { if ($antepenultima == "t" or $antepenultima == "j" or $antepenultima == "v") { $singular = substr($string, 0, -1); } else { $singular = substr($string, 0, -2); } } else { $singular = substr($string, 0, -1); } return $singular; } goto BNkaI; cnqDs: function get_sec_op($op) { $value = substr($op, -1, 1); return $value; } goto voKB0; pYgTb: function select($tabla, $columnas, $cod, $nombre, $tab_index, $where, $submit, $selected, $bloqueado) { $conexion = $GLOBALS["conexion"]; if ($cod != '') { $columnas = "{$cod},{$columnas}"; } $sql = "SELECT {$columnas} FROM {$tabla}"; if ($where != '') { $sql .= " {$where}"; } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $mostrar = "<select class="select" " . $bloqueado . " name="" . $nombre . "" id="" . $nombre . "" "; if ($tab_index != '') { $mostrar .= "tabindex="" . $tab_index . """; } if ($submit == "1") { $mostrar .= "onchange="cambiaSelect(this.value, this.name)">"; } elseif ($submit == "2") { $mostrar .= "onchange="submit();""; } else { $mostrar .= ">"; } $mostrar .= "<option value="0">Seleccione...</option>"; while ($res = mysqli_fetch_array($run)) { $mostrar .= "<option value="" . $res[0] . """; if ($res[0] == $selected) { $mostrar .= " selected="selected""; } if ($res[1]) { $opcion = $res[1]; } else { $opcion = $res[0]; } $mostrar .= ">" . ucwords($opcion) . "</option>"; } $mostrar .= "</select>"; echo "{$mostrar}"; } goto UTQ2t; GshGA: function check_user_loged($hash, $user) { $conexion = $GLOBALS["conexion"]; $is = consulta_bd("*", "clientes", "id = '{$user}' AND session_hash = '{$hash}'", ''); $cant = mysqli_affected_rows($conexion); if (count($is) == 1) { return true; } else { return false; } } goto ltklc; YabZF: function get_table_name($id) { $q = consulta_bd_por_id("display", "tablas", '', $id, ''); $nombre_real = $q["display"]; return $nombre_real; } goto rCD7b; bVNQb: function preview($cadena, $numerocaracteres) { $numeropalabrascadena = count(explode(" ", $cadena)); $cadenadividida = explode(" ", $cadena); $cadenamostrar = ''; $cadenaaux = ''; $cadenacompleta = "si"; for ($i = 0; $i <= $numeropalabrascadena; $i++) { $cadenaaux = $cadenaaux . @$cadenadividida[$i] . " "; if (strlen($cadenaaux) <= $numerocaracteres) { $cadenamostrar = $cadenamostrar . @$cadenadividida[$i] . " "; } else { $cadenacompleta = "no"; } } if ($cadenacompleta == "no") { $cadenamostrar .= " ..."; } return $cadenamostrar; } goto uDzTo; HYdwH: function get_post($except) { $excepciones = explode(",", $except); $excepciones[] = "posicion_img"; foreach ($_POST as $key => $val) { $ok = true; foreach ($excepciones as $no) { if ($key == trim($no)) { $ok = false; } } if ($ok) { if (!is_array($val)) { $valurl = urlencode($val); $variables .= "&{$key}={$valurl}"; } } } return $variables; } goto yOzLb; r6KRE: function url_exists($url = NULL) { if (empty($url)) { return false; } stream_context_set_default(array("http" => array("method" => "HEAD"))); $headers = @get_headers($url); sscanf($headers[0], "HTTP/%*d.%*d %d", $httpcode); $accepted_response = array(200, 301, 302); if (in_array($httpcode, $accepted_response)) { return true; } else { return false; } } goto nT16S; JFmn0: function obtenerURL() { $host = $_SERVER["HTTP_HOST"]; $url = $_SERVER["REQUEST_URI"]; return "https://" . $host . $url; } goto G9s4b; Y7oON: function resize_foto($file, $altura, $ancho, $bn) { $size = getimagesize($file); $width = intval($size[0]); $height = intval($size[1]); $altura = intval($altura); $ancho = intval($ancho); if ($width > $ancho) { $p = $ancho / $width; $x = $p * $width; $y = $p * $height; if ($y > $altura) { $p = $altura / $y; $x = $p * $x; $y = $p * $y; } } elseif ($height > $altura) { $p = $altura / $height; $x = $p * $width; $y = $p * $height; if ($x > $width) { $p = $altura / $x; $x = $p * $x; $y = $p * $y; } } else { $x = $width; $y = $height; } $ext = strtolower(substr(strrchr($file ?? '', "."), 1)); $date = date("dhis"); $nombre = $date . "_resized." . $ext; switch ($ext) { case "jpg": $imagen_origen = imagecreatefromjpeg($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); imagefilter($imagen_origen2, IMG_FILTER_GRAYSCALE); } if (isset($x) and intval($x) > 0) { $imagen_destino = imagecreatetruecolor(intval($x), intval($y)); $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, intval($x), intval($y), intval($width), intval($height)); $src = imagejpeg($imagen_destino, $nombre, 100); } break; case "png": $imagen_destino = imagecreatetruecolor($x, $y); imagealphablending($imagen_destino, false); imagesavealpha($imagen_destino, true); $imagen_origen = imagecreatefrompng($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); } imagealphablending($imagen_origen, true); $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, $x, $y, $width, $height); $src = imagepng($imagen_destino, $nombre, 9); break; case "gif": $imagen_origen = imagecreatefromgif($file); if ($bn) { imagefilter($imagen_origen, IMG_FILTER_GRAYSCALE); } $imagen_destino = imagecreatetruecolor($x, $y); $transcolor = imagecolortransparent($imagen_origen); if ($transcolor != -1) { $trnprt_color = imagecolorsforindex($imagen_origen, $transcolor); $trnprt_indx = imagecolorallocatealpha($imagen_destino, $trnprt_color["red"], $trnprt_color["green"], $trnprt_color["blue"], $trnprt_color["alpha"]); imagefill($imagen_destino, 0, 0, $trnprt_indx); imagecolortransparent($imagen_destino, $trnprt_indx); } $res = imagecopyresampled($imagen_destino, $imagen_origen, 0, 0, 0, 0, $x, $y, $width, $height); $src = imagegif($imagen_destino, $nombre, 100); break; } return $nombre; } goto dgTi3; jRmpd: function is_boolean($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; return $type == "tinyint(1)" ? true : false; } goto nO0T3; onjVT: function has_array($array, $string) { foreach ($array as $a) { if (is_numeric(strrpos($string, trim($a)))) { $ok = true; break; } else { $ok = false; } } return $ok; } goto fTrQB; CIUul: function update_entry($exclusiones, $tabla, $conditions) { $values = "fecha_modificacion = NOW()"; foreach ($_POST as $key => $val) { if (!strpos(" " . $exclusiones, $key)) { $values .= ", {$key} = '{$val}'"; } } $insert = update_bd($tabla, $values, $conditions); if ($insert) { return true; } else { return false; } } goto KT6fJ; v88rT: function manage_files($col_archivos, $opcion, $tabla, $id) { $dir = "../../imagenes/{$tabla}"; $dir_docs = "../../docs/{$tabla}"; if (count($col_archivos) > 1) { foreach ($col_archivos as $row) { $row = trim($row); $file = $_FILES[$row]["name"]; if ($file != '' and $file != "false") { $file_ext = strtolower(substr(strrchr($_FILES[$row]["name"], "."), 1)); if ($opcion[trim($row)] and $opcion[$row] != '' and $opcion[$row] != "false") { $tamanos = explode(",", $opcion[trim($row)]); $width = intval($tamanos[0]); $height = intval($tamanos[1]); } else { $width = ($opcion["width"] != '' and $opcion["width"] != "false") ? (int) $opcion["width"] : 0; $height = ($opcion["height"] != '' and $opcion["height"] != "false") ? (int) $opcion["height"] : 0; } if ($width != 0 and $height != 0) { if ($file_ext == "jpg" or $file_ext == "gif" or $file_ext == "png") { $width_thumb = (int) $opcion["width_thumb"]; $height_thumb = (int) $opcion["height_thumb"]; $thumb = $width_thum != '' ? 1 : 0; $img = add_img(trim($row), $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, false); $error .= $img["error"]; $values .= $img["valores"]; } else { $error .= "Formato de archivo incorrecto.&tipo=error"; } } elseif ($file_ext != '' and $file_ext != "false") { $extensions = "doc, docx, ppt, pptx, xls, xlsx, pdf, dwg, swf"; $file = add_file($row, $dir_docs, $tabla, $id, $extensions); $error .= $file["error"]; $values .= $file["valores"]; } } } } else { $file = $_FILES[$col_archivos]["name"]; $file_ext = strtolower(substr(strrchr($_FILES[$col_archivos]["name"], "."), 1)); if ($opcion[trim($row)] and $opcion[$row] != '' and $opcion[$row] != "false") { $tamanos = explode(",", $opcion[trim($row)]); $width = intval($tamanos[0]); $height = intval($tamanos[1]); } else { $width = $opcion["width"] != '' ? (int) $opcion["width"] : 0; $height = $opcion["height"] != '' ? (int) $opcion["height"] : 0; } if ($width != 0 and $height != 0) { if ($file_ext == "jpg" or $file_ext == "gif" or $file_ext == "png") { $width_thumb = (int) $opcion["width_thumb"]; $height_thumb = (int) $opcion["height_thumb"]; $thumb = $width_thumb != '' ? 1 : 0; $img = add_img($col_archivos, $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, false); $error .= $img["error"]; $values .= $img["valores"]; } else { $error .= "Formato de archivo incorrecto.&tipo=error"; } } elseif ($file_ext != '' and $file_ext != "false") { $extensions = "doc, docx, ppt, pptx, xls, xlsx, pdf, dwg, swf"; $file = add_file(trim($col_archivos), $dir_docs, $tabla, $id, $extensions); $error .= $file["error"]; $values .= $file["valores"]; $entro = $values; } } return array("error" => $error, "values" => $values); } goto SKXX3; ag7l9: function get_valor_economico($valor) { $url = "https://moldeable.com/valores_economicos/{$valor}.php"; $lineas = file($url); return trim(strip_tags($lineas[0])); } goto KBoc5; PGRXF: function get_last($table) { $conexion = $GLOBALS["conexion"]; $sql = "SELECT id FROM {$table} ORDER BY id DESC LIMIT 1"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $last = $res[0]; return $last; } goto LuGrJ; zLsmA: function dias_transcurridos($fecha_i, $fecha_f) { $dias = (strtotime($fecha_i) - strtotime($fecha_f)) / 86400; $dias = abs($dias); if (strtotime($fecha_i) > strtotime($fecha_f)) { return "-" . $dias; } else { return $dias; } } goto P8YDy; ltklc: function webp($img) { $extension = pathinfo($img, PATHINFO_EXTENSION); $nombre_base = basename($img, "." . $extension); $nombreWebP = $nombre_base . ".webp"; return $nombreWebP; } goto Q92wT; JIYWV: function check_install() { if (file_exists("install.php")) { die(header("location:install.php")); } return false; } goto gdecQ; nT16S: function consulta_bd2($campos, $table, $conditions, $orden, $arrCondiciones) { $conexion = $GLOBALS["conexion"]; $columnas = explode(",", $campos); $cant_columnas = count($columnas); $sql = "SELECT {$campos} FROM {$table}"; if ($conditions != '') { $sql .= " WHERE {$conditions}"; } if ($orden != '') { $sql .= " ORDER BY {$orden}"; } if ($run = $conexion->prepare($sql)) { $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($run, $refArr); $run->execute(); $meta = $run->result_metadata(); while ($field = $meta->fetch_field()) { $params[] =& $row[$field->name]; } call_user_func_array(array($run, "bind_result"), $params); if (!$run) { die("Error description: " . $run->error); } $i = 0; while ($run->fetch()) { $j = 0; foreach ($row as $key => $val) { $c[$j] = $val; $j++; } $result[] = $c; $i++; } $run->close(); } else { printf("Errormessage: %s
", $conexion->error); printf("consulta: %s
", $sql); } return $result; } goto Q1S3a; JYUxP: function eng_sql($string) { $newstring = stripslashes($string); $new = addslashes($newstring); return $new; } goto hNqtB; A_S8s: function tiempoSesion() { $inactivo = 36000; if (isset($_SESSION["tiempo"])) { $vida_session = time() - $_SESSION["tiempo"]; $_SESSION["tiempoVidaSesion"] = $vida_session; if ($vida_session > $inactivo) { unset($_SESSION["usuario_id"]); unset($_SESSION["tiempo"]); unset($_SESSION["tiempoVidaSesion"]); return false; } else { return true; } } else { $_SESSION["tiempo"] = time(); return true; } } goto GshGA; vxwG9: function del_bd($table, $id) { $conexion = $GLOBALS["conexion_writer"]; $sql = sprintf("DELETE FROM {$table} WHERE id = '%d'", mysqli_real_escape_string($conexion, $id)); $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto BukG9; Yzft3: function is_dependent($name) { $buscar = "_id"; if (strrpos($name, $buscar)) { return true; } else { return false; } } goto Vy20M; Kosu3: function diferencia_fechas($date1, $date2) { $date1_seconds = strtotime($date1); $date2_seconds = strtotime($date2); $dif_seg = $date2_seconds - $date1_seconds; if ($dif_seg < 60) { $return = "hace {$dif_seg} segundos"; } else { $dif_min = floor($dif_seg / 60); if ($dif_min < 60) { if ($dif_min == 1) { $return = "hace {$dif_min} minuto"; } else { $return = "hace {$dif_min} minutos"; } } else { $dif_hora = floor($dif_min / 60); if ($dif_hora < 24) { if ($dif_hora == 1) { $return = "hace {$dif_hora} hora"; } else { $return = "hace {$dif_hora} horas"; } } else { $dif_dias = floor($dif_hora / 24); if ($dif_dias < 24) { if ($dif_dias == 1) { $hora_publicacion = date("H:m:s", $date1_seconds); $return = "ayer a las {$hora_publicacion}"; } else { $return = "hace {$dif_dias} d\xc3\255as"; } } else { $date_1_b = date("m-d-Y", $date1_seconds); $return = "el {$date_1_b}"; } } } } return $return; } goto ZGpEO; vKK8h: function extension($nombre_archivo) { $nombre = explode(".", $nombre_archivo); $extension = end($nombre); return $extension; } goto nGiPB; Ynwkk: function formato_fecha($fecha, $idioma) { $fechas = explode("-", $fecha); $ano = $fechas[0]; $dia = $fechas[2]; if ($fechas[1] == "01") { if ($idioma == "esp") { $mes = "Enero"; } else { if ($idioma == "eng") { $mes = "January"; } } } else { if ($fechas[1] == "02") { if ($idioma == "esp") { $mes = "Febrero"; } else { if ($idioma == "eng") { $mes = "February"; } } } else { if ($fechas[1] == "03") { if ($idioma == "esp") { $mes = "Marzo"; } else { if ($idioma == "eng") { $mes = "March"; } } } else { if ($fechas[1] == "04") { if ($idioma == "esp") { $mes = "Abril"; } else { if ($idioma == "eng") { $mes = "April"; } } } else { if ($fechas[1] == "05") { if ($idioma == "esp") { $mes = "Mayo"; } else { if ($idioma == "eng") { $mes = "May"; } } } else { if ($fechas[1] == "06") { if ($idioma == "esp") { $mes = "Junio"; } else { if ($idioma == "eng") { $mes = "Jun"; } } } else { if ($fechas[1] == "07") { if ($idioma == "esp") { $mes = "Julio"; } else { if ($idioma == "eng") { $mes = "July"; } } } else { if ($fechas[1] == "08") { if ($idioma == "esp") { $mes = "Agosto"; } else { if ($idioma == "eng") { $mes = "August"; } } } else { if ($fechas[1] == "09") { if ($idioma == "esp") { $mes = "Septiembre"; } else { if ($idioma == "eng") { $mes = "September"; } } } else { if ($fechas[1] == "10") { if ($idioma == "esp") { $mes = "Octubre"; } else { if ($idioma == "eng") { $mes = "October"; } } } else { if ($fechas[1] == "11") { if ($idioma == "esp") { $mes = "Noviembre"; } else { if ($idioma == "eng") { $mes = "November"; } } } else { if ($fechas[1] == "12") { if ($idioma == "esp") { $mes = "Diciembre"; } else { if ($idioma == "eng") { $mes = "December"; } } } } } } } } } } } } } } if ($dia == '') { return ''; } else { if ($idioma == "esp") { return $dia . " de " . $mes . " del " . $ano; } else { return $mes . " " . $dia . " " . $ano; } } } goto zLsmA; yOzLb: function get_gets($except) { $excepciones = explode(",", $except); foreach ($_GET as $key => $val) { $ok = true; foreach ($excepciones as $no) { if ($key == trim($no)) { $ok = false; } } if ($ok) { $valurl = urlencode($val); $variables .= "&{$key}={$valurl}"; } } return $variables; } goto UsbuF; Q92wT: function logClientes($tipo, $cadena, $cardcode) { if (file_exists(__DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log")) { } else { $fileName = __DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log"; $contenidoInicial = "Log Clientes " . date("Y-m-d") . "
"; file_put_contents($fileName, $contenidoInicial); } $arch = fopen(__DIR__ . "/log/CLIENTES_" . $cardcode . "_" . date("Y-m-d") . ".log", "a+"); fwrite($arch, $tipo . ": " . $cadena . "
"); fclose($arch); } goto GcwbB; hzrDZ: function update_bd($table, $values, $conditions) { $conexion = $GLOBALS["conexion_writer"]; $sql = "UPDATE {$table} SET {$values} "; if ($conditions != '') { $sql .= "WHERE {$conditions}"; } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto FVw9g; SKXX3: function is_animated_gif($filename) { $raw = file_get_contents($filename); $offset = 0; $frames = 0; while ($frames < 2) { $where1 = strpos($raw, "\0!\xf9\4", $offset); if ($where1 === false) { break; } else { $offset = $where1 + 1; $where2 = strpos($raw, "\0,", $offset); if ($where2 === false) { break; } else { if ($where1 + 8 == $where2) { $frames++; } $offset = $where2 + 1; } } } return $frames > 1; } goto T3lhr; ZGpEO: function select_paises() { $return = "<select name="select_pais"><option value="">Seleccione...</option><option value="Africa">Africa</option><option value="Argentina">Argentina</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Belgium">Belgium</option><option value="Brazil">Brazil</option><option value="Bulgaria">Bulgaria</option><option value="Canada">Canada</option><option value="Caribbean">Caribbean</option><option value="Central America">Central America</option><option value="Chile" selected="selected">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Costa Rica">Costa Rica</option><option value="Croatia">Croatia</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Dominican Republic">Dominican Republic</option><option value="Estonia">Estonia</option><option value="Finland">Finland</option><option value="France">France</option><option value="Germany">Germany</option><option value="Greece">Greece</option><option value="Guatemala">Guatemala</option><option value="Hong Kong">Hong Kong</option><option value="Hungary">Hungary</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Japan">Japan</option><option value="Korea">Korea</option><option value="Latvia">Latvia</option><option value="Lithuania">Lithuania</option><option value="Malaysia">Malaysia</option><option value="Mexico">Mexico</option><option value="Middle East">Middle East</option><option value="Morocco">Morocco</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Norway">Norway</option><option value="Panama">Panama</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Puerto Rico">Puerto Rico</option><option value="Romania">Romania</option><option value="Russian Federation">Russian Federation</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Taiwan">Taiwan</option><option value="Thailand">Thailand</option><option value="Turkey">Turkey</option><option value="Ukraine">Ukraine</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option></select>"; return $return; } goto HYdwH; LJso4: function enum_vals($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; $buscar = array("enum", "(", ")", "'"); $vals = str_replace($buscar, '', $type); return explode(",", $vals); } goto T6mW3; Q1S3a: function update_bd2($table, $values, $conditions, $arrCondiciones) { $conexion = $GLOBALS["conexion_writer"]; $sql = "UPDATE {$table} SET {$values} WHERE {$conditions}"; $stmt = $conexion->prepare($sql); $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($stmt, $refArr); $stmt->execute(); if ($run) { return true; } else { return false; } } goto ftE65; T6mW3: function img_tag($file, $w, $h) { $size = getimagesize($file); $width = $size[0]; $height = $size[1]; if ($width > $w) { $p = $w / $width; $x = $p * $width; $y = $p * $height; if ($y > $h) { $p = $h / $y; $x = $p * $x; $y = $p * $y; } } elseif ($height > $h) { $p = $h / $height; $x = $p * $width; $y = $p * $height; if ($x > $width) { $p = $h / $x; $x = $p * $x; $y = $p * $y; } } else { $x = $width; $y = $height; } return "<img src="" . $file . "" width="" . $x . "px" height="" . $y . "px" border="0">"; } goto e1kzm; qSlna: function obtener_tabla_id($tabla) { $filas = consulta_bd("id", "tablas", "nombre = '{$tabla}'", ''); $id = $filas[0][0]; return $id; } goto FOwg4; P8YDy: function previewDatos($dato) { $datoCodificado = ''; $caracteres = str_split($dato); foreach ($caracteres as $key => $valor) { if ($key > 3) { if ($valor == " ") { $datoF = " "; } elseif ($valor == "@") { $datoF = $valor; } else { $datoF = "*"; } } else { $datoF = $valor; } $datoCodificado .= $datoF; } return $datoCodificado; } goto yMOEV; XdvMZ: function obtener_tabla($val_op) { $filas = consulta_bd("nombre", "tablas", "id = '{$val_op}'", ''); $nombre = (is_countable($filas) and count($filas) > 0) ? $filas[0][0] : false; return $nombre; } goto qSlna; BNkaI: function get_real_name($nombre) { $real_name = str_replace("_", " ", $nombre); $palabras = explode(" ", $real_name); if (count($palabras) > 1) { $i == 0; foreach ($palabras as $palabra) { $nombre_final .= $i == 0 ? ucwords(ortografia($palabra)) : " " . ortografia($palabra); $i++; } } else { $nombre_final = ucwords(ortografia($nombre)); } return $nombre_final; } goto QYdQ9; rCD7b: function is_md5($var) { return preg_match("/^[A-Fa-f0-9]{32}$/", $var); } goto TGzmL; LuGrJ: function fecha_sql($fecha) { if (strtotime($fecha)) { $fecha_cl = date("d/m/Y - H:i", strtotime($fecha)); } else { $fecha_cl = date("d/m/Y - H:i"); } return $fecha_cl; } goto JM1XE; e1kzm: function is_date($string) { if (strlen($string) == 10 || strlen($string) == 19) { $dia = substr($string, 8, 2); $ano = substr($string, 0, 4); $mes = substr($string, 5, 2); if (is_numeric($dia) and is_numeric($mes) and is_numeric($ano)) { return checkdate($mes, $dia, $ano); } else { return false; } } else { return false; } } goto v88rT; u4_Y0: function delete_bd_where($table, $where) { $conexion = $GLOBALS["conexion_writer"]; $sql = "DELETE FROM {$table} WHERE {$where}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto hQHc5; hNqtB: function insert_entry($exclusiones, $tabla) { $keys = "fecha_creacion"; $vals = "NOW()"; foreach ($_POST as $key => $val) { if (!strpos(" " . $exclusiones, $key)) { $keys .= ", {$key}"; $vals .= ", '{$val}'"; } } $insert = insert_bd($tabla, $keys, $vals); if ($insert) { return true; } else { return false; } } goto CIUul; Vy20M: function column_is_related($column) { $is_id = substr($column, -3, 3); if ($is_id == "_id") { $parent_name = substr($column, 0, -3); return $parent_name; } else { return false; } } goto Toq55; OjbiE: function validar_rut($r, $dv) { $r = str_replace(".", '', trim($r)); $s = 1; for ($m = 0; $r != 0; $r /= 10) { $s = ($s + $r % 10 * (9 - $m++ % 6)) % 11; } return chr($s ? $s + 47 : 75) == strtoupper($dv); } goto Yzft3; BukG9: function truncate($table) { $conexion = $GLOBALS["conexion_writer"]; $sql = sprintf("DELETE FROM {$table}", $conexion); $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto HpQKx; T3lhr: function add_file($input_name, $dir, $tabla, $id, $extensions) { $conexion = $GLOBALS["conexion"]; if (!file_exists($dir . "/")) { $mk = mkdir($dir); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } if ($error == '') { if ($_FILES[$input_name]["name"]) { if ($_FILES[$input_name]["size"] < 209715200) { $file_name = str_replace(" ", "_", substr($_FILES[$input_name]["name"], 0, -4)); $file_name = str_replace(".", '', $file_name); $file_ext = strtolower(substr(strrchr($_FILES[$input_name]["name"], "."), 1)); $extension = explode(",", $extensions); $cant_ex = count($extension); $ok = false; foreach ($extension as $ex) { if ($file_ext == trim($ex)) { $ok = true; break; } } if ($ok) { $date = date("dmhis"); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir1 = "{$dir}/{$archivo}"; $move = move_uploaded_file($_FILES[$input_name]["tmp_name"], $dir1); if ($move) { if ($id) { $img_q = "SELECT {$input_name} FROM {$tabla} WHERE id = '{$id}'"; $run = mysqli_query($conexion, $img_q); $res = mysqli_fetch_array($run); $img = "{$dir}/" . $res[0]; if ($res[0] != '') { unlink($img); } } $values .= ", {$input_name} = '{$archivo}'"; } else { $error = "Error al cargar el archivo, por favor int\303\251ntelo nuevamente.&tipo=error"; } } else { $error = "Tipo de archivo incorrecto, debe ser {$extensions} y es {$file_ext}&tipo=notificacion"; } } else { $error = "Tama\xc3\xb1o del archivo debe ser menor a 200MB &tipo=notificacion"; } } else { $error = "Error al procesar el archivo, archivo no encontrado.&tipo=error"; } } $return = array("error" => $error, "valores" => $values); return $return; } goto nG7M3; yMOEV: function sumaDiasHabiles() { $fechaInicial = date("Y-m-d"); $MaxDias = 2; for ($i = 0; $i < $MaxDias; $i++) { $Segundos = $Segundos + 86400; $caduca = date("D", time() + $Segundos); if ($caduca == "Sat") { $i--; } else { if ($caduca == "Sun") { $i--; } else { $FechaFinal = date("d-m-Y", time() + $Segundos); } } } return $FechaFinal; } goto JFmn0; nGiPB: function extraer_numero($cadena) { $numero = ''; for ($index = 0; $index < strlen($cadena); $index++) { if (is_numeric($cadena[$index])) { $numero .= $cadena[$index]; } } return $numero; } goto ag7l9; uPkz5: date_default_timezone_set("America/Santiago"); goto in62A; v03jA: function get_nombre_sitio($nombre) { $largo = strlen($nombre); $buscar = "_"; if (strrpos($nombre, $buscar)) { $nombre_real = ucwords(strtolower(substr(strrchr($nombre, "_"), 1))); } else { $nombre_real = ucwords($nombre); } return $nombre_real; } goto ri5bJ; gN_5x: function prepare_img($html) { $url_sitio = get_option("url_sitio"); return str_replace("src="../", "src="" . $url_sitio . "/", $html); } goto prPQf; yAOrQ: function num_hojas($page, $total, $limite_hoja, $op, $buscar) { if ($total > $limite_hoja) { $restantes = $total - $limite_hoja; $hojas = ceil($restantes / $limite_hoja); if ($page != 0) { $prev = $page; echo "<a href="index.php?op=" . $op . "&page=" . $prev . "&buscar=" . $buscar . "" class="page">Anterior</a> "; } $j = 0; while ($j <= $hojas) { $k = $j + 1; echo "<a href="index.php?op=" . $op . "&page=" . $k . "&buscar=" . $buscar . "" "; if ($page == $j) { echo "class="page_selected">"; } else { echo "class="page">"; } echo $k; echo "</a> "; $j++; } if ($page != $hojas) { $next = $page + 2; echo "<a href="index.php?op=" . $op . "&page=" . $next . "&buscar=" . $buscar . "" class="page" onclick="submit()">Siguiente</a> "; } } } goto PGRXF; nkYr4: function column_exists($table, $column) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW columns FROM {$table}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error() . "<br /><br />{$sql}"); $i = 0; $z = 0; while ($line = mysqli_fetch_array($run)) { $ok = false; if (trim($column) == $line[0]) { $ok = true; break; } $i++; } return $ok; } goto gN_5x; GIbdc: function is_inside($buscados, $string) { $exclusiones = explode(",", $buscados); $is_id = substr($string, -3, 3); if ($is_id != "_id") { foreach ($exclusiones as $no) { if ($string == trim($no)) { return true; break; } else { $ok = 1; } } } else { $ok = 1; } if ($ok) { return false; } } goto JYUxP; GIWji: function does_url_exists($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($code == 200) { $status = true; } else { $status = false; } curl_close($ch); return $status; } goto CZMcD; O4A3Z: function consulta_bd_por_id($campos, $table, $conditions, $id) { $conexion = $GLOBALS["conexion"]; if (is_numeric((int) $id)) { $sql = "SELECT {$campos} FROM {$table}"; if ($conditions != '') { $sql .= " WHERE {$conditions} AND id = '{$id}'"; } else { $sql .= " WHERE id = '{$id}'"; } } else { die("Error, identificador no v\xc3\241lido"); } $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $line = mysqli_fetch_array($run); return $line; } goto hzrDZ; hQHc5: function show_columns($table, $exception) { $conexion = $GLOBALS["conexion"]; if ($exception != '') { $excepciones = explode(",", $exception); } $sql = "SHOW columns FROM {$table}"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); $i = 0; $z = 0; while ($line = mysqli_fetch_array($run)) { $ok = true; foreach ($excepciones as $val) { if (trim($val) == $line[0]) { $ok = false; } } if ($ok) { $resulset[$z] = "{$line["0"]}"; $z++; } $i++; } return $resulset; } goto yAOrQ; nO0T3: function is_enum($column, $table) { $conexion = $GLOBALS["conexion"]; $sql = "SHOW COLUMNS FROM {$table} WHERE field = '{$column}'"; $run = mysqli_query($conexion, $sql); $res = mysqli_fetch_array($run); $type = $res[1]; return substr_count($type, "enum") != 0 ? true : false; } goto LJso4; CZMcD: function imagen($url, $file) { $nombre_fichero = $url . $file; if (strpos($_SERVER["HTTP_ACCEPT"], "image/webp") !== false) { $supported = true; } else { $supported = false; } if ($file == '') { if ($supported) { $imagen = "sinFoto.webp"; } else { $imagen = "sinFoto.jpg"; } return $url . $imagen; die; } $extension = pathinfo($file, PATHINFO_EXTENSION); $nombre_base = basename($file, "." . $extension); $nombreWebP = $nombre_base . ".webp"; if ($supported) { if (file_exists($url . $nombreWebP)) { $imagen = $url . $nombreWebP; } else { $imagen = $nombre_fichero; } } else { $imagen = $nombre_fichero; } return $imagen; } goto hVtuw; G9s4b: function opciones($campo) { $conexion = $GLOBALS["conexion"]; $opciones = consulta_bd("valor", "opciones", "nombre = '{$campo}'", ''); if (is_countable($opciones) and count($opciones) > 0) { $valor = $opciones[0][0]; return $valor; } } goto GIWji; K_vKS: function del_file($file) { if (file_exists($file)) { $unlink = unlink($file); if ($unlink) { return true; } else { return false; } } else { return false; } } goto GIbdc; FVw9g: function insert_bd($table, $campos, $values) { $conexion = $GLOBALS["conexion_writer"]; $sql = "INSERT INTO {$table} ({$campos}) VALUES ({$values})"; $run = mysqli_query($conexion, $sql) or die(mysqli_error($conexion) . "<br /><br />{$sql}"); if ($run) { return true; } else { return false; } } goto vxwG9; FOwg4: function comprobar_rut($sUsr) { $sUsr = str_replace(".", '', $sUsr); if (!preg_match("/(\d{7,8})-([\dK])/", strtoupper($sUsr), $aMatch)) { return false; } $sRutBase = substr(strrev($aMatch[1]), 0, 8); $sCodigoVerificador = $aMatch[2]; $iCont = 2; $iSuma = 0; for ($i = 0; $i <= strlen($sRutBase); $i++) { if ($iCont > 7) { $iCont = 2; } $iSuma += $sRutBase[$i] * $iCont; $iCont++; } $iDigito = 11 - $iSuma % 11; $sCaracter = substr("-123456789K0", $iDigito, 1); return $sCaracter == $sCodigoVerificador; } goto OjbiE; uDzTo: function comprobar_mail($email) { $mail_correcto = 0; if (strlen($email) >= 6 && substr_count($email, "@") == 1 && substr($email, 0, 1) != "@" && substr($email, strlen($email) - 1, 1) != "@") { if (!strstr($email, "'") && !strstr($email, """) && !strstr($email, "\") && !strstr($email, "$") && !strstr($email, " ")) { if (substr_count($email, ".") >= 1) { $term_dom = substr(strrchr($email, "."), 1); if (strlen($term_dom) > 1 && strlen($term_dom) < 5 && !strstr($term_dom, "@")) { $antes_dom = substr($email, 0, strlen($email) - strlen($term_dom) - 1); $caracter_ult = substr($antes_dom, strlen($antes_dom) - 1, 1); if ($caracter_ult != "@" && $caracter_ult != ".") { $mail_correcto = 1; } } } } } if ($mail_correcto) { return 1; } else { return 0; } } goto QDf8U; KBoc5: function url_amigables($url) { $find = array("\xc3
1", "\xc3\251", "\xc3
d", "\303\263", "\xc3\xba", "\303\xb1", "\303\201", "\xc3\211", "\303\x8d", "\303\223", "\xc3\232", "\xc3\221"); $repl = array("a", "e", "i", "o", "u", "n", "A", "E", "I", "O", "U", "N"); $url = str_replace($find, $repl, $url); $url = strtolower($url); $find = array(" ", "&", "\r\n", "\n", "+"); $url = str_replace($find, "-", $url); $find = array("/[^a-z0-9\-<>]/", "/[\-]+/", "/<[^>]*>/"); $repl = array('', "-", ''); $url = preg_replace($find, $repl, $url); return $url; } goto Ynwkk; dgTi3: function get_asociados($tabla, $asociados, $id) { $id_tabla = singular($tabla) . "_id"; $cantidad = consulta_bd("COUNT(*)", "{$asociados}", "{$id_tabla} = {$id}", ''); return $cantidad[0][0]; } goto vKK8h; PlIW1: function check_admin_loged($hash, $user) { $conexion = $GLOBALS["conexion"]; $is = consulta_bd("*", "administradores", "id = '{$user}' AND session_hash = '{$hash}'", ''); $cant = mysqli_affected_rows($conexion); if ($cant == 1) { return true; } else { return false; } } goto v03jA; UsbuF: function get_val_op($op) { $value = substr($op, 0, -1); return $value; } goto cnqDs; KT6fJ: function get_option($val) { $res = consulta_bd("valor", "opciones", "nombre = '{$val}'", ''); $respuesta = (is_countable($res) and count($res) > 0) ? $res[0][0] : false; return $respuesta; } goto nkYr4; fTrQB: function plural($string) { $ultima = substr($string, -1, 1); $vocales = array("a", "e", "i", "o", "u"); foreach ($vocales as $v) { if ($v == $ultima) { $ter = "s"; break; } else { $ter = "es"; } } $plural = "{$string}{$ter}"; return $plural; } goto XdvMZ; Toq55: function check_if_item_has_belongs_to($column) { $conexion = $GLOBALS["conexion"]; $nombre_tabla_hijo = plural(substr($column, 0, -3)); $id_tabla_hijo = consulta_bd("id", "tablas", "nombre = '{$nombre_tabla_hijo}'", ''); $id_tabla_hijo = $id_tabla_hijo[0][0]; $tabla = consulta_bd("valor", "opciones_tablas", "nombre = 'belongs_to' AND tabla_id = '{$id_tabla_hijo}'", ''); if (mysqli_affected_rows($conexion) > 0) { return $tabla[0][0]; } else { return false; } } goto K_vKS; nG7M3: function add_img($input_name, $dir, $tabla, $id, $width, $height, $thumb, $width_thumb, $height_thumb, $bn) { $conexion = $GLOBALS["conexion"]; if (opciones("s3_activo")) { $bucketName = $_ENV["S3_BUCKET"]; $IAM_KEY = $_ENV["S3_KEY"]; $IAM_SECRET = $_ENV["S3_SECRET"]; $s3 = new Aws\S3\S3Client(array("credentials" => array("key" => $IAM_KEY, "secret" => $IAM_SECRET), "version" => "latest", "region" => "us-east-2")); } if (!file_exists($dir . "/")) { $mk = mkdir($dir); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } if ($thumb) { $dir_thumb = "{$dir}/thumbs/"; if (!file_exists($dir_thumb)) { $mk = mkdir($dir_thumb); if (!$mk) { $error = "Error al crear el directorio.&tipo=error"; } } } if ($error == '') { if ($_FILES[$input_name]["name"]) { if ($_FILES[$input_name]["size"] < 200000000) { $file_name = substr($_FILES[$input_name]["name"], 0, -4); $file_name = str_replace(" ", "_", $file_name); $file_ext = strtolower(substr(strrchr($_FILES[$input_name]["name"], "."), 1)); if ($file_ext == "jpg" or $file_ext == "png" or $file_ext == "gif") { $date = date("dmhis"); $tmp_name = $date . "_" . $file_name . "." . $file_ext; $dir1 = "{$dir}/{$tmp_name}"; $move = move_uploaded_file($_FILES[$input_name]["tmp_name"], $dir1); if (!opciones("s3_activo")) { if ($move) { $animated_gif = is_animated_gif($dir1); if ($animated_gif) { $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $copy = rename($dir1, $dir2); } else { $new_file = resize_foto($dir1, $height, $width, false); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $copy = copy($new_file, $dir2); if (opciones("usar_webp")) { $archivoWebp = $date . "_" . $file_name . ".webp"; $dirWebp = "{$dir}/{$archivoWebp}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir2} -o {$dirWebp}"); } if ($thumb) { $new_file_thumb = resize_foto($dir1, $height_thumb, $width_thumb, false); $archivo_thumb = $date . "_" . $file_name . "." . $file_ext; $dir3 = "{$dir_thumb}/thumbs_{$archivo_thumb}"; $copy = copy($new_file_thumb, $dir3); if (opciones("usar_webp")) { $archivoWebp_thumb = $date . "_" . $file_name . ".webp"; $dirWebp2 = "{$dir_thumb}/{$archivoWebp_thumb}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir3} -o {$dirWebp2}"); } if ($bn) { $new_file_thumb_bn = resize_foto($dir1, $height_thumb, $width_thumb, true); $archivo_thumb_bn = $date . "_" . $file_name . "_bn." . $file_ext; $dir4 = "{$dir_thumb}/{$archivo_thumb_bn}"; $copy = copy($new_file_thumb_bn, $dir4); } } } if ($copy) { if (!$animated_gif) { unlink($new_file); unlink($dir1); } if ($id) { $img_q = "SELECT {$input_name} FROM {$tabla} WHERE id = '{$id}'"; $run = mysqli_query($conexion, $img_q); $res = mysqli_fetch_array($run); $img1 = "{$dir}/" . $res[0]; $img2 = "{$dir}/thumbs/" . $res[0]; if ($res[0] != '') { if (file_exists($img1)) { unlink($img1); } if (file_exists($img2)) { unlink($img2); } } } $values .= ", {$input_name} = '{$archivo}'"; } else { $size = getimagesize($dir); $error = "Error al copiar la imagen&tipo=error"; } } else { $error = "Error al cargar la im\303\241gen, por favor int\xc3
9ntelo nuevamente y revise el tama\303\xb1o de la imagen.&tipo=ventana"; } } else { if ($file_ext == "jpg" or $file_ext == "png") { $new_file = resize_foto($dir1, $height, $width, false); $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $dir2 = str_replace("../", '', $dir2); $result = $s3->putObject(array("Bucket" => $_ENV["S3_BUCKET"], "Key" => $dir2, "SourceFile" => $new_file, "ACL" => "public-read")); if (opciones("usar_webp")) { $archivoWebp = $date . "_" . $file_name . ".webp"; $dirWebp = "{$dir}/{$archivoWebp}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir2} -o {$dirWebp}"); } if ($thumb) { $new_file_thumb = resize_foto($dir1, $height_thumb, $width_thumb, false); $archivo_thumb = $date . "_" . $file_name . "." . $file_ext; $dir3 = "{$dir_thumb}/thumbs_{$archivo_thumb}"; $copy = copy($new_file_thumb, $dir3); if (opciones("usar_webp")) { $archivoWebp_thumb = $date . "_" . $file_name . ".webp"; $dirWebp2 = "{$dir_thumb}/{$archivoWebp_thumb}"; $path_lib_webp = opciones("path_lib_webp"); $salida = shell_exec("{$path_lib_webp} -q 80 {$dir3} -o {$dirWebp2}"); } if ($bn) { $new_file_thumb_bn = resize_foto($dir1, $height_thumb, $width_thumb, true); $archivo_thumb_bn = $date . "_" . $file_name . "_bn." . $file_ext; $dir4 = "{$dir_thumb}/{$archivo_thumb_bn}"; $copy = copy($new_file_thumb_bn, $dir4); } } $values .= ", {$input_name} = '{$archivo}'"; } elseif ($file_ext == "gif") { $archivo = $date . "_" . $file_name . "." . $file_ext; $dir2 = "{$dir}/{$archivo}"; $result = $s3->putObject(array("Bucket" => opciones("s3_bucket"), "Key" => $dir2, "SourceFile" => $_FILES[$input_name]["tmp_name"], "ACL" => "public-read")); $values .= ", {$input_name} = '{$archivo}'"; } else { $error = "Tipo de archivo incorrecto, debe ser JPG, GIF o PNG.&tipo=error"; } } } else { $error = "Tipo de archivo incorrecto, debe ser JPG, GIF o PNG.&tipo=error"; } } else { $error = "Tama\303\261o de la imagen debe ser menor a 5 Mb &tipo=notificacion"; } } } $return = array("error" => $error, "valores" => $values); return $return; } goto Y7oON; ri5bJ: function get_table_id($table) { $q = consulta_bd("id", "tablas", "nombre = '{$table}'", ''); $id = $q[0][0]; return $id; } goto YabZF; MG6b2: function fecha_hes($fecha, $formato, $lang) { $mes_o = date("m", strtotime($fecha)); $dia = date("d", strtotime($fecha)); $ano = date("Y", strtotime($fecha)); $hora = date("H:i:s", strtotime($fecha)); if ($lang == "esp") { switch ($mes_o) { case "01": $mes = "Enero"; break; case "02": $mes = "Febrero"; break; case "03": $mes = "Marzo"; break; case "04": $mes = "Abril"; break; case "05": $mes = "Mayo"; break; case "06": $mes = "Junio"; break; case "07": $mes = "Julio"; break; case "08": $mes = "Agosto"; break; case "09": $mes = "Septiembre"; break; case "10": $mes = "Octubre"; break; case "11": $mes = "Noviembre"; break; case "12": $mes = "Diciembre"; break; } $sep = "de"; $sep2 = "a las"; } elseif ($lang == "ing") { switch ($mes) { case "01": $mes = "January"; break; case "02": $mes = "February"; break; case "03": $mes = "March"; break; case "04": $mes = "April"; break; case "05": $mes = "May"; break; case "06": $mes = "June"; break; case "07": $mes = "July"; break; case "08": $mes = "August"; break; case "09": $mes = "September"; break; case "10": $mes = "October"; break; case "11": $mes = "November"; break; case "12": $mes = "December"; break; } $sep = ''; $sep2 = "at"; } switch ($formato) { case 1: return "{$dia} {$sep} {$mes} {$sep} {$ano}"; break; case 2: return "{$mes} {$sep} {$ano}"; break; case 3: return "{$dia}/{$mes_o}/{$ano} {$sep2}"; break; case 4: return "{$dia}/{$mes_o}/{$ano} {$sep2} {$hora}"; break; } } goto Kosu3; QYdQ9: function ortografia($palabra) { $conexion = $GLOBALS["conexion"]; $regla_aguda = array("n", "s", "i", "u"); $regla_aguda_not = array("ay", "ey", "oy", "uy", "au", "eu", "ou", "os"); $regla_aguda_verbo = array("a", "e", "o"); $regla_grave = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "p", "q", "r", "t", "v", "w", "x", "y", "z"); $vocales = array("a", "e", "i", "o", "u"); $vocales_acentos = array("\303
1", "\xc3\251", "\303
d", "\303\263", "\xc3\xba"); $ultima_letra = strtolower(substr($palabra, -1)); $penultima_letra = strtolower(substr($palabra, -2, 1)); $largo_palabra = strlen($palabra); $palabras_bd = consulta_bd("busqueda", "ortografia", '', ''); $cant = mysqli_affected_rows($conexion); if ($cant > 0) { foreach ($palabras_bd as $pal) { $exclusiones_bd[] = $pal[0]; } } else { $exclusiones_bd[] = ''; } if (has_array($exclusiones_bd, $palabra)) { $palabra_bd = consulta_bd("mostrar", "ortografia", "busqueda = '{$palabra}'", ''); return $palabra_bd[0][0] != '' ? $palabra_bd[0][0] : $palabra; } else { if ($largo_palabra > 2) { if (has_array($regla_aguda, $ultima_letra)) { $resto_palabra = substr($palabra, 0, -2); $dos_ultimas_letras = strtolower(substr($palabra, -2)); $tres_ultimas_letras = strtolower(substr($palabra, -3)); if ($ultima_letra == "s" and !has_array($vocales, $penultima_letra)) { } else { if (!has_array($regla_aguda_not, $ultima_letra) and $tres_ultimas_letras != "gen") { $cambio_aguda = str_replace($vocales, $vocales_acentos, $dos_ultimas_letras); $palabra = $resto_palabra . $cambio_aguda; } } return $palabra; } if (has_array($regla_grave, $ultima_letra)) { $resto_palabra = substr($palabra, 2); $primeras_dos_letras = substr($palabra, 0, 2); $cambio = str_replace($vocales, $volcales_acentos, $primeras_dos_letras); $palabra = $primeras_dos_letras . $resto_palabra; return $palabra; } else { if ($largo_palabra % 2 == 0 and $largo_palabra > 2) { $ultimas_cuatro = strtolower(substr($palabra, -4)); $sin_ultimas_cuatro = strtolower(substr($palabra, 0, -4)); $siguientes_dos = strtolower(substr($sin_ultimas_cuatro, -2)); $resto = strtolower(substr($palabra, 0, -6)); $primera_letra = strtolower(substr($palabra, 0, 1)); $cambio_esd = (!has_array(array("l"), $siguientes_dos) and !has_array($vocales, $primera_letra) or has_array($vocales, $primera_letra)) ? $siguientes_dos : str_replace($vocales, $vocales_acentos, $siguientes_dos); $palabra = $resto . $cambio_esd . $ultimas_cuatro; return $palabra; } else { return $palabra; } } } else { return $palabra; } } } goto onjVT; ftE65: function insert_bd2($table, $campos, $values, $arrCondiciones) { $conexion = $GLOBALS["conexion_writer"]; $sql = "INSERT INTO {$table} ({$campos}) VALUES ({$values})"; $stmt = $conexion->prepare($sql); $refArr = $arrCondiciones; $ref = new ReflectionClass("mysqli_stmt"); $method = $ref->getMethod("bind_param"); $method->invokeArgs($stmt, $refArr); $stmt->execute(); if ($run) { return true; } else { return false; } } goto A_S8s; TGzmL: function formato_moneda($numero, $moneda, $echo) { if ($numero != NULL) { $longitud = strlen($numero); $punto = substr($numero, -1, 1); $punto2 = substr($numero, 0, 1); $separador = "."; if ($punto == ".") { $numero = substr($numero, 0, $longitud - 1); $longitud = strlen($numero); } if ($punto2 == ".") { $numero = "0" . $numero; $longitud = strlen($numero); } $num_entero = strpos($numero, $separador); $centavos = substr($numero, $num_entero); $l_cent = strlen($centavos); if ($l_cent == 2) { $centavos = $centavos . "0"; } elseif ($l_cent == 3) { $centavos = $centavos; } elseif ($l_cent > 3) { $centavos = substr($centavos, 0, 3); } $entero = substr($numero, -$longitud, $longitud - $l_cent); if (!$num_entero) { $num_entero = $longitud; $centavos = ".00"; $entero = substr($numero, -$longitud, $longitud); } $start = floor($num_entero / 3); $res = $num_entero - $start * 3; if ($res == 0) { $coma = $start - 1; $init = 0; } else { $coma = $start; $init = 3 - $res; } $d = $init; $i = 0; $c = $coma; while ($i <= $num_entero) { if ($d == 3 && $c > 0) { $d = 0; $sep = "."; $c = $c - 1; } else { $sep = ''; } $final .= $sep . $entero[$i]; $i = $i + 1; $d = $d + 1; } } else { $final = 0; } if ($moneda == "pesos") { $moneda = "$"; if ($echo) { echo $moneda . " " . $final; } else { return $moneda . " " . $final; } } elseif ($moneda == "dolares") { $moneda = "USD"; if ($echo) { echo $moneda . " " . $final . $centavos; } else { return $moneda . " " . $final . $centavos; } } elseif ($moneda == "euros") { $moneda = "EUR"; if ($echo) { echo $final . $centavos . " " . $moneda; } else { return $final . $centavos . " " . $moneda; } } else { if ($echo) { echo $final; } else { return $final; } } } goto pYgTb; UTQ2t: function checkbox($valor, $activo, $id) { if ($valor == "1") { $checked = "checked="checked""; } else { $checked = ''; } if ($activo == "1") { $disabled = ''; } elseif ($activo == "0") { $disabled = "disabled="disabled""; } if ($id != '') { $name = "checkbox{$id}"; } else { $name = "checkbox"; } $mostrar = "<label>
	  					<input name="" . "{$name}" . "" type="checkbox" id="checkbox" " . $checked . " " . $disabled . " value="1"/>
					</label>"; echo "{$mostrar}"; } goto bVNQb; GcwbB: ?>

Function Calls

None

Variables

None

Stats

MD5 63b208750bc35bebe33f5293c3d06da3
Eval Count 0
Decode Time 104 ms