$value_continent) { $result.= ""; // Busco los PAISES de este CONTINENTE $results_countries = LIB_db_select_query("*", "t_util_combobox_countries", $connection, "CONTINENT_ID = ".$value_continent["CONTINENT_ID"]); if (isset($results_countries) && is_array($results_countries)) { foreach ($results_countries as $key_contry=>$value_country) { $selected = ""; if (isset($selected_country) && !empty($selected_country)) { if ($selected_country == $value_country["COUNTRY_ID"]) { $selected = " selected"; } } $result.= ""; } } else { $result = ""; } $result.= ""; } } else { $result = ""; } LIB_db_close($connection); return ($result); } function LIB_UTIL_generate_cities_select ($country_id, $selected_city=false) { global $GLOBAL_config; LIB_db_change_db("comunidad"); $connection = LIB_db_open(); $result = ""; // Buscamos las Ciudades del Pas pasado como parmetro if (isset($country_id) && !empty($country_id)) { $results_cities = LIB_db_select_query("*", "t_util_combobox_cities", $connection, "COUNTRY_ID = ".$country_id); if (isset($results_cities) && is_array($results_cities)) { foreach ($results_cities as $key_city=>$value_city) { $selected = ""; if (isset($selected_city) && !empty($selected_city)) { if ($selected_city == $value_city["CITY_ID"]) { $selected = " selected"; } } $result.= ""; } } else { $result = ""; } } LIB_db_close($connection); return ($result); } function LIB_UTIL_generate_states_select ($city_id, $selected_state=false) { global $GLOBAL_config; LIB_db_change_db("comunidad"); $connection = LIB_db_open(); $result = ""; // Buscamos las Ciudades del Pas pasado como parmetro if (isset($city_id) && !empty($city_id)) { $results_states = LIB_db_select_query("*", "t_util_combobox_states", $connection, "CITY_ID = ".$city_id); if (isset($results_states) && is_array($results_states)) { foreach ($results_states as $key_state=>$value_state) { $selected = ""; if (isset($selected_state) && !empty($selected_state)) { if ($selected_state == $value_state["STATE_ID"]) { $selected = " selected"; } } $result.= ""; } } else { // Ser que de ESTA CIUDAD no tenemos estados o provincias $result = "No hay provincias / estados"; } } LIB_db_close($connection); return ($result); } // Funcin que genera un ENLACE en los contenidos function LIB_UTIL_URL_to_link ($contentToParse) { // link URLs $contentToParse = eregi_replace("(([[:alnum:]]+://)|www\.)([^[:space:]]*)([[:alnum:]#?/&=])", "\\1\\3\\4", $contentToParse); // fix lazy URLs $contentToParse = eregi_replace("href=\"www","href=\"http://www", $contentToParse); // link mailtos $contentToParse = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1", $contentToParse); // truncates long urls that can cause display problems $contentToParse = preg_replace("/>(([[:alnum:]]+:\/\/)|www\.)([^[:space:]]{30,40})([^[:space:]]*)([^[:space:]]{10,20})([[:alnum:]#?\/&=])\\1\\3...\\5\\6<", $contentToParse); $contentToParse = stripslashes($contentToParse); return ($contentToParse); } // funcin para generar a partir de una cadena, n TAG de bsqueda LIMPIPO (sin caracteres especiales y optimizado para google) function LIB_UTIL_clear_string ($originalString) { // Generamos el tag de bsqueda $temp_string = strtolower($originalString); // Limpiamos el nombre de la provincia $b = array("","","","","","","","","","","","","","","","","", "", " ",",",".",";",":","","!","","?",'"',"'","(",")", "%", '', '', "---", "--", "/", "*", "\\", "_", ""); $c = array("a","e","i","o","u","a","e","i","o","u","a","e","i","o","u","n","c", "c", "-","","","","","","","","",'',"", "", "", "", "", "", "-", "-", "-", "", "", "-", ""); $temp_string = str_replace($b, $c, $temp_string); // Le pasamos otra limpieza para saegurar dobles guines y demas if (preg_match("/---/", $temp_string) || preg_match("/--/", $temp_string)) { $temp_string = str_replace($b, $c, $temp_string); } return($temp_string); } // funcin para generar a partir de una cadena, n TAG de bsqueda LIMPIPO (sin caracteres especiales y optimizado para google) function LIB_UTIL_clear_string_to_filename ($originalString) { // Generamos el tag de bsqueda $temp_string = strtolower($originalString); // Limpiamos el nombre de la provincia $b = array("","","","","","","","","","","","","","","","","", "", " ",",",";",":","","!","","?",'"',"'","(",")", "%", '', '', "---", "--", "/", "*", "\\", ""); $c = array("a","e","i","o","u","a","e","i","o","u","a","e","i","o","u","n","c", "c", "-","","","","","","","",'',"", "", "", "", "", "", "-", "-", "-", "", "", ""); $temp_string = str_replace($b, $c, $temp_string); // Le pasamos otra limpieza para saegurar dobles guines y demas if (preg_match("/---/", $temp_string) || preg_match("/--/", $temp_string)) { $temp_string = str_replace($b, $c, $temp_string); } return($temp_string); } //truncate a string only at a whitespace (by nogdog) function LIB_UTIL_truncate($text, $length, $end_string="...") { // Delete ALL html entities $text = strip_tags($text); $length = abs((int)$length); if(strlen($text) > $length) { $text = preg_replace("/^(.{1,$length})(\s.*|$)/s", '\\1 '.$end_string, $text); } return($text); } function LIB_UTIL_object2array($object) { return @json_decode(@json_encode($object),1); } function formatBytes($bytes, $precision = 2) { // $byte_value = 1024; $byte_value = 1000; $units = array('B' => 0, 'KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8); $value = 0; if ($bytes > 0) { // Generate automatic prefix by bytes // If wrong prefix given if (!isset($unit) || (isset($unit) && !array_key_exists($unit, $units))) { $pow = floor(log($bytes)/log($byte_value)); $unit = array_search($pow, $units); } // Calculate byte value by prefix $value = ($bytes/pow($byte_value,floor($units[$unit]))); $value = str_replace(',', '.', $value); } // If decimals is not numeric or decimals is less than 0 // then set default value if (!isset($decimals) || (isset($decimals) && (!is_numeric($decimals) || $decimals < 0))) { $decimals = 2; } // Format output return sprintf('%.' . $decimals . 'f '.$unit, $value); } ?> Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/vhosts/promanservicios.com/httpdocs/empleados/php/LIB_util.php:271) in /var/www/vhosts/promanservicios.com/httpdocs/empleados/php/GLOBAL_config.php on line 24 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/vhosts/promanservicios.com/httpdocs/empleados/php/LIB_util.php:271) in /var/www/vhosts/promanservicios.com/httpdocs/empleados/php/GLOBAL_config.php on line 24 Fatal error: Call to undefined function LIB_UTIL_clear_string() in /var/www/vhosts/promanservicios.com/httpdocs/empleados/php/GLOBAL_config.php on line 43