$p_w) { $len = strlen($str_word)+strlen($p_w); //$str_word .= " ".strlen($p_w)." ".$cnt_chars; if ($len <= $cnt_chars) { $str_word .= " ".$p_w; } else { $flag_big = true; break; } } } if ($flag_big) { $str_word .= "..."; } return trim($str_word); } function get_r_date($ts=0, $lang='ru') { if ($lang == 'en') { $mon_arr = array(1 => "January ", 2 => "February ", 3 => "March ", 4 => "April ", 5 => "May ", 6 => "June ", 7 => "July ", 8 => "August ", 9 => "September ", 10 => "October ", 11 => "November ", 12 => "December"); } else { $mon_arr = array(1 => "января", 2 => "февраля", 3 => "марта", 4 => "апреля", 5 => "мая", 6 => "июня", 7 => "июля", 8 => "августа", 9 => "сентября", 10 => "октября", 11 => "ноября", 12 => "декабря"); } $s = date("j", $ts)." ".$mon_arr[date("n", $ts)]." ".date("Y", $ts); return $s; } function get_r_date_min($ts=0, $lang='ru') { if ($lang == 'en') { $mon_arr = array(1 => "January ", 2 => "February ", 3 => "March ", 4 => "April ", 5 => "May ", 6 => "June ", 7 => "July ", 8 => "August ", 9 => "September ", 10 => "October ", 11 => "November ", 12 => "December"); } else { $mon_arr = array(1 => "Январь", 2 => "Февраль", 3 => "Март", 4 => "Апрель", 5 => "Май", 6 => "Июнь", 7 => "Июль", 8 => "Август", 9 => "Сентябрь", 10 => "Октябрь", 11 => "Ноябрь", 12 => "Декабрь"); } $s = $mon_arr[date("n", $ts)]." ".date("Y", $ts); return $s; } function get_date_small($ts=0) { if (date("j", $ts) < 10) { $s = "0".date("j", $ts).".".date("m", $ts); } else { $s = date("j", $ts).".".date("m", $ts); } return $s; } function get_r_date_time($ts=0) { $mon_arr = array(1 => "января", 2 => "февраля", 3 => "марта", 4 => "апреля", 5 => "мая", 6 => "июня", 7 => "июля", 8 => "августа", 9 => "сентября", 10 => "октября", 11 => "ноября", 12 => "декабря"); //$mon_arr = array(1 => "Января", 2 => "Февраля", 3 => "Марта", 4 => "Апреля", 5 => "Мая", 6 => "Июня", 7 => "Июля", 8 => "Августа", 9 => "Сентября", 10 => "Октября", 11 => "Ноября", 12 => "Декабря"); //$s = date("j", $ts)." ".$mon_arr[date("n", $ts)]." ".date("Y", $ts)." ".date("H", $ts).":".date("i", $ts); $s = date("j", $ts)." ".$mon_arr[date("n", $ts)].", ".date("H", $ts).":".date("i", $ts); return $s; } function get_r_time($ts=0) { $s = date("H", $ts).":".date("i", $ts); return $s; } function get_time($ts=0) { $s = date("H", $ts).":".date("i", $ts); return $s; } function get_ext_file($file_name) { $pos_dot = strrpos($file_name, "."); $ext = substr($file_name, $pos_dot+1); return $ext; } function get_lang_date_time($ts = 0, $lang = 'ru') { if ($lang == 'en') { $mon_arr = array(1 => "January ", 2 => "February ", 3 => "March ", 4 => "April ", 5 => "May ", 6 => "June ", 7 => "July ", 8 => "August ", 9 => "September ", 10 => "October ", 11 => "November ", 12 => "December"); } else if ($lang == 'kz') { $mon_arr = array(1 => "қаңтар ", 2 => "ақпан ", 3 => "наурыз ", 4 => "сәуір ", 5 => "мамыр ", 6 => "маусым ", 7 => "шілде ", 8 => "тамыз ", 9 => "қыркүйек ", 10 => "қазан ", 11 => "қараша ", 12 => "желтоқсан"); } else { $mon_arr = array(1 => "января", 2 => "февраля", 3 => "марта", 4 => "апреля", 5 => "мая", 6 => "июня", 7 => "июля", 8 => "августа", 9 => "сентября", 10 => "октября", 11 => "ноября", 12 => "декабря"); } $s = date("j", $ts)." ".$mon_arr[date("n", $ts)]." ".date("Y", $ts).", ".date("H", $ts).":".date("i", $ts);; return $s; } function get_name_not_ext($file_name) { $path_parts = pathinfo($file_name); $pos_dot = strrpos($path_parts["basename"], "."); $name = substr($file_name, 0, $pos_dot); return $name; } function my_resize($in_file, $new_name, $ext, $max_size) { $error_code = 1; $size = getimagesize($in_file); $in_width = $size[0]; $in_height = $size[1]; if (!$in_width || !$in_height) { return $error_code; } //echo("
Orig size:".$in_width."x".$in_height.""); if ($in_width > $max_size || $in_height > $max_size) { if ($in_width > $in_height) { $new_width = $max_size; $new_height = ($new_width / $in_width) * $in_height; } else { $new_height = $max_size; $new_width = ($new_height / $in_height) * $in_width; } } else { //echo $in_file.">>>".$new_name; copy($in_file, $new_name); return 0; /* $new_width = $in_width; $new_height = $in_height; */ } switch($ext) { case 'gif': $im1 = imagecreatefromgif($in_file); break; case 'jpg': $im1 = imagecreatefromjpeg($in_file); break; case 'png': $im1 = imagecreatefrompng($in_file); break; } //imagegif($im1,$new_name); //$im1 = @imagecreatefromstring($in_file); $im2 = @imagecreatetruecolor($new_width, $new_height); if (!$im1 || !$im2) { return $error_code; } $res = imagecopyresampled($im2, $im1, '0', '0', '0', '0', $new_width, $new_height, $in_width, $in_height); if (!$res) { return $error_code; } switch($ext) { case 'gif': imagegif($im2,$new_name); break; case 'jpg': imagejpeg($im2,$new_name); break; case 'png': imagepng($im2,$new_name); break; } } function my_resize_width($in_file, $new_name, $ext, $max_size, $corner_radius = false) { $error_code = 1; $size = getimagesize($in_file); $in_width = $size[0]; $in_height = $size[1]; if (!$in_width || !$in_height) { return $error_code; } //echo("
Orig size:".$in_width."x".$in_height.""); if ($in_width > $max_size) { $new_width = $max_size; $new_height = ($new_width / $in_width) * $in_height; } else { //echo $in_file.">>>".$new_name; copy($in_file, $new_name); return 0; /* $new_width = $in_width; $new_height = $in_height; */ } switch($ext) { case 'gif': $im1 = imagecreatefromgif($in_file); break; case 'jpg': $im1 = imagecreatefromjpeg($in_file); break; case 'png': $im1 = imagecreatefrompng($in_file); break; } //imagegif($im1,$new_name); //$im1 = @imagecreatefromstring($in_file); if ($corner_radius) { $endsize = $corner_radius; $startsize = $endsize*3-1; $arcsize = $startsize*2+1; } $im2 = @imagecreatetruecolor($new_width, $new_height); if (!$im1 || !$im2) { return $error_code; } $res = imagecopyresampled($im2, $im1, '0', '0', '0', '0', $new_width, $new_height, $in_width, $in_height); if (!$res) { return $error_code; } switch($ext) { case 'gif': imagegif($im2,$new_name); break; case 'jpg': imagejpeg($im2,$new_name,85); break; case 'png': imagepng($im2,$new_name); break; } } function my_resize_height($in_file, $new_name, $ext, $max_size, $corner_radius = false) { $error_code = 1; $size = getimagesize($in_file); $in_width = $size[0]; $in_height = $size[1]; if (!$in_width || !$in_height) { return $error_code; } //echo("
Orig size:".$in_width."x".$in_height.""); if ($in_height > $max_size) { $new_height = $max_size; $new_width = ($new_height / $in_height) * $in_width; } else { //echo $in_file.">>>".$new_name; copy($in_file, $new_name); return 0; /* $new_width = $in_width; $new_height = $in_height; */ } switch($ext) { case 'gif': $im1 = imagecreatefromgif($in_file); break; case 'jpg': $im1 = imagecreatefromjpeg($in_file); break; case 'png': $im1 = imagecreatefrompng($in_file); break; } //imagegif($im1,$new_name); //$im1 = @imagecreatefromstring($in_file); if ($corner_radius) { $endsize = $corner_radius; $startsize = $endsize*3-1; $arcsize = $startsize*2+1; } $im2 = @imagecreatetruecolor($new_width, $new_height); if (!$im1 || !$im2) { return $error_code; } $res = imagecopyresampled($im2, $im1, '0', '0', '0', '0', $new_width, $new_height, $in_width, $in_height); if (!$res) { return $error_code; } switch($ext) { case 'gif': imagegif($im2,$new_name); break; case 'jpg': imagejpeg($im2,$new_name,85); break; case 'png': imagepng($im2,$new_name); break; } } //Специальный ресайз, стреч по max_size_w и обрезает снизу по max_size_h function my_resize_special($in_file, $new_name, $ext, $max_size_w, $max_size_h) { $error_code = 1; $size = getimagesize($in_file); $in_width = $size[0]; $in_height = $size[1]; if (!$in_width || !$in_height) { return $error_code; } //echo("
Orig size:".$in_width."x".$in_height.""); if ($in_width == $max_size_w && $in_height == $max_size_h) { copy($in_file, $new_name); return 0; } else { $new_width = $max_size_w; $new_height = ($new_width / $in_width) * $in_height; } switch($ext) { case 'gif': $im1 = imagecreatefromgif($in_file); break; case 'jpg': $im1 = imagecreatefromjpeg($in_file); break; case 'png': $im1 = imagecreatefrompng($in_file); break; } $im2 = @imagecreatetruecolor($new_width, $new_height); $im3 = @imagecreatetruecolor($max_size_w, $max_size_h); if (!$im1 || !$im2 || !$im3) { return $error_code; } //Стречем сделаем нужный п ширине $res = imagecopyresampled($im2, $im1, '0', '0', '0', '0', $new_width, $new_height, $in_width, $in_height); if (!$res) { return $error_code; } //Скопируем нужный верхний кусочек картинки отбросив нижнюю часть $res = imagecopy($im3, $im2, 0, 0, 0, 0, $max_size_w, $max_size_h); if (!$res) { return $error_code; } $handle = fopen($new_name, 'w'); fclose($handle); switch($ext) { case 'gif': imagegif($im3,$new_name); break; case 'jpg': imagejpeg($im3,$new_name,85); break; case 'png': imagepng($im3,$new_name); break; } } function check_input_email($email = '') { $mes = ""; if ($email != "") { if (!preg_match ("/(\S+)\@(\S+)\.(\S+)/",$email)) { $mes .= "Неверный синтаксис email."; } elseif (strchr ($email,"'") || strchr ($email,'"') || strchr ($email,"/") || strchr ($email,"&") || strchr ($email,",") || strchr ($email,";") || strchr ($email,"\\")) { $mes .= "Запрещенный символ в строке E-mail."; } } else { $mes .= "E-mail отсутствует."; } return $mes; } function is_parsed($body) { $tree_xml = "".stripslashes($body).""; $xsl_file = str_replace("//", "/", $_SERVER["DOCUMENT_ROOT"]."/_symp/_xslt/_adm/head_adm.xsl"); $xsl = new DOMDocument; $xsl->load($xsl_file); // Load the XML source //set_error_handler('HandleXmlError'); $xml = new DOMDocument; $res = $xml->loadXML($tree_xml); if (!$res) { return false; } restore_error_handler(); // Configure the transformer $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); // attach the xsl rules $valid_html = $proc->transformToXML($xml); if ($valid_html === false) { return false; } else { return true; } } /* function HandleXmlError($errno, $errstr, $errfile, $errline) { if ($errno==E_WARNING && (substr_count($errstr,"DOMDocument::loadXML()")>0)) { return true; } else { return false; } } function is_parsed($body) { $xml = "".stripslashes($body).""; $xslt = "/_symp/_xslt/_adm/head_adm.xsl"; $xslt = str_replace("//", "/", $_SERVER["DOCUMENT_ROOT"] . $xslt); $xslt_filename = basename($xslt); $xslt_basedir = "file://".dirname($xslt)."/"; $xh = xslt_create(); xslt_set_base($xh, $xslt_basedir); // XSL Path $arguments = array("/_xml" => $xml); $valid_html = @xslt_process($xh, "arg:/_xml", $xslt_basedir."/".$xslt_filename, NULL, $arguments); if ($valid_html) { return true; } else { return false; } } */ /* function mailer($to, $subject, $message) { $message = str_replace('№', 'No', $message); $message = str_replace('«', '«', $message); $message = str_replace('»', '»', $message); $message = ' '.convert_cyr_string($message,"w","k").' '; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=KOI8-R\r\n"; $headers .= "From: ".P_HEAD_MAIL." <".P_HEAD_MAIL.">\r\n"; //print $message; return @mail($to, convert_cyr_string($subject,"w","k"), $message, $headers); } */ function mailer($to, $subject, $message) { $message = ' '.$message.' '; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: ".P_HEAD_MAIL." <".P_HEAD_MAIL.">\r\n"; //print wordwrap($message, 76, "\r\n", 0); return @mail($to, $subject, wordwrap($message, 76, "\r\n", 0), $headers); } function mailer_no_wordwrap($to, $subject, $message) { $message = ' '.$message.' '; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: ".P_HEAD_MAIL." <".P_HEAD_MAIL.">\r\n"; //print wordwrap($message, 76, "\r\n", 0); return @mail($to, $subject, $message, $headers); } /* function my_chunk_split($in_str) { $size = 75; $out_str = ""; $start_pos = 0; $stop_pos = 0; while ($start_pos <= strlen($in_str)) { $temp_str = ""; $new_size = $size; $temp_str = substr($in_str, $start_pos, $new_size); $space_pos = strrpos($temp_str, " "); if ($space_num !== false) { $new_size = $space_pos; $temp_str = substr($in_str, $start_pos, $new_size); } $out_str .= $temp_str."\r\n"; $start_pos = $new_size + 1; } return $out_str; } */ function get_x_ip() { if (getenv('HTTP_X_FORWARDED_FOR')) { $str_ip = getenv('HTTP_X_FORWARDED_FOR'); } else if (getenv('HTTP_X_FORWARDED')) { $str_ip = getenv('HTTP_X_FORWARDED'); } else if (getenv('HTTP_FORWARDED_FOR')) { $str_ip = getenv('HTTP_FORWARDED_FOR'); } else if (getenv('HTTP_FORWARDED')) { $str_ip = getenv('HTTP_FORWARDED'); } else { $str_ip = ""; } return $str_ip; } function select_url($text, $class = '') { $lower_text = strtolower($text); $orign_text = $text; if ($class){ $css = ' class="'.$css.'"'; } else { $css = ''; } $sfind[] = 'http://'; $sfind[] = 'ftp://'; $spec = "href="; $efind[] = "\n"; $efind[] = "\t"; $efind[] = "\r"; $efind[] = "<"; //tag $efind[] = " "; $flag_find = 1; $last_p2 = 0; while ($flag_find == 1){ //найдем первый символ $p1 = strlen($lower_text); $pos = 0; foreach($sfind as $value){ $plus_next = 0; do { $back = false; $pos = strpos($lower_text, $value, $last_p2 + $plus_next); if ($pos !== false && $pos <= $p1){ $sback = substr($lower_text, $pos-strlen($spec)-2, strlen($spec)+2); //echo 'sback = "'.$sback.'"
'; $back = strpos($sback, $spec); //echo 'back = '.$back.'
'; if ($back === false){ $p1 = $pos; } } // echo 'back = '.$back.'
'; $plus_next = $pos - $last_p2 + 1; } while($back !== false); } //echo 'p1 = '.$p1.'
'; //найдем последний символ $p2 = strlen($lower_text); $pos = 0; foreach($efind as $value){ $pos = strpos($lower_text, $value, $p1); if ($pos !== false && $pos <= $p2) { $p2 = $pos; } } //echo 'p2 = '.$p2.'
'; if ($p1 == strlen($lower_text)){ $flag_find = 0; } else { $one_flag = 1; if ($p2 == 0 || $p2 === false){ $p2 = strlen($lower_text); } $out_text .= substr($orign_text, $last_p2, $p1-$last_p2); $href = substr($orign_text, $p1, $p2-$p1); // echo 'href - '.$href.'
'; $out_text .= ''.trim($href).''; //$in_text = substr($in_text, $p2); //echo $in_text.'
'; $flag_find = 1; $last_p2 = $p2; } } if ($one_flag) { $out_text .= substr($orign_text, $last_p2); } else { $out_text = $text; } return trim($out_text); } function cyr_to_en($str) { $in_str = strtolower($str); $in_str = str_replace("а", "a", $in_str); $in_str = str_replace("б", "b", $in_str); $in_str = str_replace("в", "v", $in_str); $in_str = str_replace("г", "g", $in_str); $in_str = str_replace("д", "d", $in_str); $in_str = str_replace("е", "e", $in_str); $in_str = str_replace("ё", "io", $in_str); $in_str = str_replace("ж", "j", $in_str); $in_str = str_replace("з", "z", $in_str); $in_str = str_replace("и", "i", $in_str); $in_str = str_replace("й", "ii", $in_str); $in_str = str_replace("к", "k", $in_str); $in_str = str_replace("л", "l", $in_str); $in_str = str_replace("м", "m", $in_str); $in_str = str_replace("н", "n", $in_str); $in_str = str_replace("о", "o", $in_str); $in_str = str_replace("п", "p", $in_str); $in_str = str_replace("р", "r", $in_str); $in_str = str_replace("с", "s", $in_str); $in_str = str_replace("т", "t", $in_str); $in_str = str_replace("у", "u", $in_str); $in_str = str_replace("ф", "f", $in_str); $in_str = str_replace("х", "h", $in_str); $in_str = str_replace("ц", "c", $in_str); $in_str = str_replace("ч", "ch", $in_str); $in_str = str_replace("ш", "sh", $in_str); $in_str = str_replace("щ", "sh", $in_str); $in_str = str_replace("ъ", "", $in_str); $in_str = str_replace("ы", "i", $in_str); $in_str = str_replace("ь", "", $in_str); $in_str = str_replace("э", "e", $in_str); $in_str = str_replace("ю", "ju", $in_str); $in_str = str_replace("я", "ja", $in_str); return $in_str; } function str2mail($str) { return '=?utf-8?B?'.base64_encode($str).'?='; } function replace_links($text) { $text = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "\\0", $text); $text = ereg_replace("(^| )(www([.]?[a-zA-Z0-9_/-])*)", "\\1\\2", $text); return $text; } function cyr_count($in_number, $cyr_type1, $cyr_type2, $cyr_type3) { if (intval(substr($in_number,-2,2)) >= 10 && intval(substr($in_number,-2,2)) <= 14) { $cnt_des = 0; } else { $cnt_des = intval(substr($in_number,-1,1)); } switch ($cnt_des) { case 1: $cnt_str = $cyr_type1; break; case 2: case 3: case 4: $cnt_str = $cyr_type2; break; case 5: case 6: case 7: case 8: case 9: case 0: $cnt_str = $cyr_type3; break; default: $cnt_str = ""; } return $cnt_str; } function date_i18n($format, $timestamp, $sel_lang = 'en') { $translation_ru = array( "am" => "дп", "pm" => "пп", "AM" => "ДП", "PM" => "ПП", "Monday" => "Понедельник", "Mon" => "Пн", "Tuesday" => "Вторник", "Tue" => "Вт", "Wednesday" => "Среда", "Wed" => "Ср", "Thursday" => "Четверг", "Thu" => "Чт", "Friday" => "Пятница", "Fri" => "Пт", "Saturday" => "Суббота", "Sat" => "Сб", "Sunday" => "Воскресенье", "Sun" => "Вс", "January" => "Январь", "Jan" => "янв", "February" => "Февраль", "Feb" => "фев", "March" => "Март", "Mar" => "мар", "April" => "Апрель", "Apr" => "апр", "May" => "Май", "May" => "Май", "June" => "Июнь", "Jun" => "июн", "July" => "Июль", "Jul" => "июл", "August" => "Август", "Aug" => "авг", "September" => "Сентябрь", "Sep" => "сен", "October" => "Октябрь", "Oct" => "окт", "November" => "Ноябрь", "Nov" => "ноя", "December" => "Декабрь", "Dec" => "дек", "st" => "ое", "nd" => "ое", "rd" => "е", "th" => "ое", ); $translation_kz = array( "am" => "тд", "pm" => "тк", "AM" => "ТД", "PM" => "ТК", "Monday" => "Дүйсенбі", "Mon" => "Дс", "Tuesday" => "Бейсенбі", "Tue" => "Бс", "Wednesday" => "Сәрсенбі", "Wed" => "Ср", "Thursday" => "Сейсенбі", "Thu" => "Сс", "Friday" => "Жұма", "Fri" => "Жм", "Saturday" => "Сенбі", "Sat" => "Сн", "Sunday" => "Жексенбі", "Sun" => "Жк", "January" => "қаңтар", "Jan" => "қаң", "February" => "ақпан", "Feb" => "ақп", "March" => "наурыз", "Mar" => "нау", "April" => "сәуір", "Apr" => "сәу", "May" => "мамыр", "May" => "мамыр", "June" => "маусым", "Jun" => "мау", "July" => "шілде", "Jul" => "шіл", "August" => "тамыз", "Aug" => "там", "September" => "қыркүйек", "Sep" => "қырк", "October" => "қазан", "Oct" => "қаз", "November" => "қараша", "Nov" => "қар", "December" => "желтоқсан", "Dec" => "желт", "st" => "ші", "nd" => "ші", "rd" => "ші", "th" => "ші", ); switch ($sel_lang) { default: return date($format, $timestamp); break; case 'ru': case 'Ru': case 'RU': case 'rus': case 'Rus': case 'RUS': return strtr(date($format, $timestamp), $translation_ru); break; case 'kz': case 'Kz': case 'Kz': case 'kaz': case 'Kaz': case 'KAZ': return strtr(date($format, $timestamp), $translation_kz); break; } } // date_i18n function date_i18n_2($format, $timestamp, $sel_lang = 'en') { $translation_ru = array( "am" => "дп", "pm" => "пп", "AM" => "ДП", "PM" => "ПП", "Monday" => "Понедельник", "Mon" => "Пн", "Tuesday" => "Вторник", "Tue" => "Вт", "Wednesday" => "Среда", "Wed" => "Ср", "Thursday" => "Четверг", "Thu" => "Чт", "Friday" => "Пятница", "Fri" => "Пт", "Saturday" => "Суббота", "Sat" => "Сб", "Sunday" => "Воскресенье", "Sun" => "Вс", "January" => "Января", "Jan" => "янв", "February" => "Февраля", "Feb" => "фев", "March" => "Марта", "Mar" => "мар", "April" => "Апреля", "Apr" => "апр", "May" => "Май", "May" => "Май", "June" => "Июня", "Jun" => "июн", "July" => "Июля", "Jul" => "июл", "August" => "Августа", "Aug" => "авг", "September" => "Сентября", "Sep" => "сен", "October" => "Октября", "Oct" => "окт", "November" => "Ноября", "Nov" => "ноя", "December" => "Декабря", "Dec" => "дек", "st" => "ое", "nd" => "ое", "rd" => "е", "th" => "ое", ); $translation_kz = array( "am" => "тд", "pm" => "тк", "AM" => "ТД", "PM" => "ТК", "Monday" => "Дүйсенбі", "Mon" => "Дс", "Tuesday" => "Бейсенбі", "Tue" => "Бс", "Wednesday" => "Сәрсенбі", "Wed" => "Ср", "Thursday" => "Сейсенбі", "Thu" => "Сс", "Friday" => "Жұма", "Fri" => "Жм", "Saturday" => "Сенбі", "Sat" => "Сн", "Sunday" => "Жексенбі", "Sun" => "Жк", "January" => "қаңтар", "Jan" => "қаң", "February" => "ақпан", "Feb" => "ақп", "March" => "наурыз", "Mar" => "нау", "April" => "сәуір", "Apr" => "сәу", "May" => "мамыр", "May" => "мамыр", "June" => "маусым", "Jun" => "мау", "July" => "шілде", "Jul" => "шіл", "August" => "тамыз", "Aug" => "там", "September" => "қыркүйек", "Sep" => "қырк", "October" => "қазан", "Oct" => "қаз", "November" => "қараша", "Nov" => "қар", "December" => "желтоқсан", "Dec" => "желт", "st" => "ші", "nd" => "ші", "rd" => "ші", "th" => "ші", ); switch ($sel_lang) { default: return date($format, $timestamp); break; case 'ru': case 'Ru': case 'RU': case 'rus': case 'Rus': case 'RUS': return strtr(date($format, $timestamp), $translation_ru); break; case 'kz': case 'Kz': case 'Kz': case 'kaz': case 'Kaz': case 'KAZ': return strtr(date($format, $timestamp), $translation_kz); break; } } // date_i18n_2 /** * Получает инфоблоки по $const_name и возвращает в массив. Если такой константы нет, возвращает массив с одним пустым полем или с $tmp_str * @param string $const_name Имя константы * @param string $lang Язык блока * @param string $tmp_str Строка, если константы нет. По умолчанию "" * @param int $shuffle Перемешивать ли массив. По умолчанию 1 * @return array Массив со значениями * */ function shuffle_blocks($const_name, $lang="ru", $tmp_str = "", $shuffle = 1) { $array = array(); $infoSQL = "SELECT * FROM info_block WHERE const_name LIKE '{$const_name}' and lang = '{$lang}' and flag_delete = '0'"; $info_qRS = mysql_query($infoSQL); if( mysql_num_rows($info_qRS) ) { while($info_row = mysql_fetch_object($info_qRS)) { $array[] = $info_row; } } else { $array[] = $tmp_str; } if( $shuffle == 1 ) shuffle($array); return $array; } ?> $h) { if ($k < 16) { $base[$k] = ($h ^ $i_l) >> ($k % 2); } else { $base[$k] = ($h ^ $i_r) >> ($k % 4); } } if ($flag == "encrypt") { $arr_password = array(); for ($i = 0; $i < strlen($password); $i+=4) { $b4 = ord($password[$i+3]) << 24; $b3 = ord($password[$i+2]) << 16; $b2 = ord($password[$i+1]) << 8; $b1 = ord($password[$i]); $arr_password[] = $b1 | $b2 | $b3 | $b4; } $c = 0; $arr_res = array(); foreach($arr_password as $v) { $arr_res[] = $v ^ $base[$c]; $c++; if ($c == 31) $c = 0; } return base64_encode(serialize($arr_res)); } else if ($flag == "decrypt") { $arr_password = unserialize(base64_decode($password)); $c = 0; if (is_array($arr_password)) { foreach($arr_password as $v) { $two_chars = $v ^ $base[$c]; $res .= chr($two_chars & 0x000000FF); if ($d = ($two_chars >> 8 & 0x000000FF)) $res .= chr($d); if ($d = ($two_chars >> 16 & 0x000000FF)) $res .= chr($d); if ($d = ($two_chars >> 24 & 0x000000FF)) $res .= chr($d); $c++; if ($c == 31) $c = 0; } } return $res; } } function code_password2($password) { $key = 0x401ADFB7; return main_crypt($flag="encrypt", substr($password, 0, 20), $key); } function encode_password2($password) { $key = 0x401ADFB7; return main_crypt($flag = "decrypt", $password, $key); } ?>Error:'.$SQL.'
'.mysql_error()); if (mysql_num_rows($qRS)) { $row = mysql_fetch_object($qRS); return $row->flag_access; } else { return 0; } } function rubricator_is_user_access($rubricator_id) { $SQL = "select flag_user_access from rubricator where rubricator_id='".intval($rubricator_id)."'"; $qRS = mysql_query($SQL) or die('
Error:'.$SQL.'
'.mysql_error()); if (mysql_num_rows($qRS)) { $row = mysql_fetch_object($qRS); return $row->flag_user_access; } else { return 0; } } ?>processText ('"Вы все еще кое-как верстаете в "Ворде"? - Тогда мы идем к вам!"'); */ class RemoteTypograf { var $_entityType = 4; var $_useBr = 1; var $_useP = 1; var $_maxNobr = 3; var $_encoding = 'UTF-8'; function RemoteTypograf ($encoding) { if ($encoding) $this->_encoding = $encoding; } function htmlEntities() { $this->_entityType = 1; } function xmlEntities() { $this->_entityType = 2; } function mixedEntities() { $this->_entityType = 4; } function noEntities() { $this->_entityType = 3; } function br ($value) { $this->_useBr = $value ? 1 : 0; } function p ($value) { $this->_useP = $value ? 1 : 0; } function nobr ($value) { $this->_maxNobr = $value ? $value : 0; } function processText ($text) { $original_text = $text; $text = str_replace ('&', '&', $text); $text = str_replace ('<', '<', $text); $text = str_replace ('>', '>', $text); $SOAPBody = '_encoding . '"?> ' . $text . ' ' . $this->_entityType . ' ' . $this->_useBr . ' ' . $this->_useP . ' ' . $this->_maxNobr . ' '; $host = 'typograf.artlebedev.ru'; $SOAPRequest = 'POST /webservices/typograf.asmx HTTP/1.1 Host: typograf.artlebedev.ru Content-Type: text/xml Content-Length: ' . strlen ($SOAPBody). ' SOAPAction: "http://typograf.artlebedev.ru/webservices/ProcessText" '. $SOAPBody; $remoteTypograf = @fsockopen ($host, 80, $errno, $errstr, 30); if (!$remoteTypograf) { echo "Типограф: $errstr ($errno)"."
\n"; return $original_text; } else { fwrite ($remoteTypograf, $SOAPRequest); $typografResponse = ''; while (!feof ($remoteTypograf)) { $typografResponse .= fread ($remoteTypograf, 8192); } fclose ($remoteTypograf); $startsAt = strpos ($typografResponse, '') + 19; $endsAt = strpos ($typografResponse, ''); $typografResponse = substr ($typografResponse, $startsAt, $endsAt - $startsAt - 1); $typografResponse = str_replace ('&', '&', $typografResponse); $typografResponse = str_replace ('<', '<', $typografResponse); $typografResponse = str_replace ('>', '>', $typografResponse); return $typografResponse; } } } ?> 4 && $number%100<20)? 2 : $cases[min($number%10, 5)] ]; } function getCatalogs($kws) { if (count($kws)>0) { $sql = "SELECT id FROM ".LOD_CATALOG." WHERE name IN ("; for ($i=0; $iid; } return $cats; } } return false; } function getIp() { $ip=0; if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; } return ip2long($ip); } function saveQuery($city, $cats, $q, $nq, $res) { $fq = "'".addslashes($q)."'"; $fnq = "'".addslashes($nq)."'"; $catsStr = "'".implode($cats,',')."'"; $sql = 'SELECT query FROM '.LOD_QUERIES.' WHERE cityId = '.$city.' AND cats = '.$catsStr.' AND query = '.$fq; $msql = mq($sql); if (mnr($msql)) { $sql = 'UPDATE '.LOD_QUERIES.' SET nquery = '.$fnq.', qres = '.$res.', qcnt = qcnt+1 WHERE cityId = '.$city.' AND cats = '.$catsStr.' AND query = '.$fq; mq($sql); } else { $sql = 'INSERT INTO '.LOD_QUERIES.' (cityId, cats, query, nquery, qres) VALUES ('.$city.', '.$catsStr.', '.$fq.', '.$fnq.', '.$res.')'; mq($sql); } $sql = 'INSERT INTO '.LOD_QUERIES_IPS.' (ip, cityId, cats, query, nquery, qres) VALUES ('.getIp().','.$city.', '.$catsStr.', '.$fq.', '.$fnq.', '.$res.')'; mq($sql); } function getResult($id, $q, $sx, $i) { $sql = "SELECT ".LOD_COMPANYS.".name as comp, ".LOD_COMPANYS.".mcu, ".LOD_GOODS.".name, ".LOD_GOODS.".price, ".LOD_GOODS.".priceOpt, ".LOD_CITY.".name as city_name FROM ".LOD_CITY.", ".LOD_GOODS." left join ".LOD_COMPANYS." on ".LOD_COMPANYS.".id = ".LOD_GOODS.".companyId WHERE ".LOD_GOODS.".id = ".$id." and ".LOD_COMPANYS.".city = ".LOD_CITY.".id"; $obj = mfo(mq($sql)); $txt = $obj->name; $ex = $sx->BuildExcerpts(array($txt), $i, $q, array()); $ex[0] = $ex[0]; $ex[1] = $obj->comp; $ex[2] = $obj->price; $ex[3] = $obj->priceOpt; $ex[4] = $obj->mcu; $ex[5] = $obj->city_name; return $ex; } function getResults($ids, $q, $sx, $index) { $inq = "("; for ($i=0; $iid] = $obj; // $txts[] = $obj->name; $txts[] = $obj->name; } $exts = $sx->BuildExcerpts($txts, $index, $q, array()); $i = 0; foreach ($objs as $obj) { // $obj->name = $exts[$i++]; $obj->name = $exts[$i++]; } return $objs; } function mnr($mysql_result) { if ($mysql_result) return mysql_num_rows($mysql_result); else return 0; } function mq($sql) { return mysql_query($sql); } function mfo($mysql_result) { if ($mysql_result) { return mysql_fetch_object($mysql_result); } } function mf($mysql_result) { return mysql_fetch_array($mysql_result); } function vd($vr) { // Выдает свойства объекта echo '
';
	var_dump($vr);
	echo '
'; } function gvd($vr) { // Выдает свойства объекта ob_start(); echo '
';
	var_dump($vr);
	echo '
'; $retVal .= ob_get_contents(); ob_end_clean(); return $retVal; } function gv($var, $htmlspecicalchars = false) { $var = $_GET[$var] ? $_GET[$var] : ($_POST[$var] ? $_POST[$var] : NULL); if ($htmlspecicalchars) $var = htmlspecialchars($var); return $var; } function gen_sid() { srand((double) microtime( ) * 1000000); return substr(uniqid(rand( )).uniqid(rand( )), 0, 36); } function ads($data) { // Ставит у объектов, массивов или просто строк слешу перед апострофами if (is_array($data) || is_object($data)) { foreach($data as $k=>$v) { $result[$k] = addslashes($v); } } else { $result = addslashes($data); } return $result; } function daysBetween($date1, $date2) { // Показывает количество дней прошедших по этим датам $result = false; if ($date1 && $date2) { $d1 = explode("-", $date1); $d2 = explode("-", $date2); $year1 = $d1[0]; $month1 = $d1[1]; $day1 = $d1[2]; $year2 = $d2[0]; $month2 = $d2[1]; $day2 = $d2[2]; $deadline1 = mktime(0, 0, 0, $month1, $day1, $year1, 0); $deadline2 = mktime(0, 0, 0, $month2, $day2, $year2, 0); $result = round( ($deadline2 - $deadline1) / (60 * 60 * 24) ); } return $result; } function hoursBetween($date1, $date2) { // Показывает количество часов прошедших по этим датам $result = false; if ($date1 && $date2) { $d1 = explode("-", $date1); $d2 = explode("-", $date2); $h1 = explode(" ", $d1[2]); $h2 = explode(" ", $d2[2]); $d1[2] = $h1[0]; $d2[2] = $h2[0]; $h1 = explode(":", $h1[1]); $h2 = explode(":", $h2[1]); $year1 = $d1[0]; $month1 = $d1[1]; $day1 = $d1[2]; $hour1 = $h1[0]; $min1 = $h1[1]; $sec1 = $h1[2]; $year2 = $d2[0]; $month2 = $d2[1]; $day2 = $d2[2]; $hour2 = $h2[0]; $min2 = $h2[1]; $sec2 = $h2[2]; $deadline1 = mktime($hour1, $min1, $sec1, $month1, $day1, $year1); $deadline2 = mktime($hour2, $min2, $sec2, $month2, $day2, $year2); $result = round(($deadline2 - $deadline1) / (60 * 60)); } return $result; } function check_email($email) { // Проверка email адреса if (eregi('^([a-z0-9_]|\\-|\\.)+'.'@'.'(([a-z0-9_]|\\-)+\\.)+'.'[a-z0-9]{2,4}$', $email)) { return true; } else { return false; } } function check_url($url) { // Проверка url if (eregi('^(([a-z0-9_]|\\-)+\\.)+'.'[a-z0-9]{2,4}$', $url)) { return true; } else { return false; } } function check_broser($braus) { // Выдает тип браузера if (eregi("Opera", $braus)) {$broser = "Opera";} else if (eregi("MSIE", $braus)) {$broser = "Explorer";} else if (eregi("Mozilla", $braus)) $broser = "Netscape"; if($broser == '') $broser = 'Robot'; return $broser; } ?> Processing.kz - Our Partners

Partners

Our Partners

         

Visa  International-international payment system providing payment transaction services being the basis of the similarly named association. VISA International Service Association is the leading payment system in the world. Visa offers secure and simple solutions for consumers, retailers and businesses, banks, other providers of payment services and governments.  Visa payment cards are accepted all over the world.
Visa enables cardholders, retailers and banks to do business with each other. Visa connects payment systems and offers products and services that make payments faster, more convenient and more secure. 

  

MasterCard Worldwide—international payment system that combines the 22,000 financial institutions in 210 countries around the world.

.  The company’s central office is located in New York, USA. It was established in 1966 by agreement between several American banks on establishment of Interbank Card Association. Modern name of the payment system was adopted in 1979.
Members of MasterCard International payment system offer a wide range of card products for individuals and legal entities. Payment cards offer to consumers solutions making payments more secure, convenient and controllable as compared to any other payment method. Payment cards enable consumers to buy goods in shops, on the Internet, from catalogs and on the phone. They save buyer’s time and money allowing to attract and retain more clients and to develop own business.

  

 

JSC Halyk Bank of Kazakhstan — the biggest universal commercial bank in the Republic of Kazakhstan. It has been working successfully for the benefit of its clients for 88 years.  It is one of the most reliable and diversified financial institutions in Kazakhstan. JSC Halyk Bank of Kazakhstan was established after reorganization of Savings Bank of the Republic of Kazakhstan and worked for many years as the agent of the Government of the Republic of Kazakhstan in the sphere of payment of pensions and benefits.  In 2001 Halyk Bank was privatized. This allowed to restructure business and enable the bank to provide its clients with the widest range of high quality services.  The bank issues cards of Visa International, MasterCard International and China Union Pay payment systems and still remains the leader of the Kazakhstan market of payment cards. Total number of the Bank’s payment cards in circulation exceeded 2.7 million, which is about 40% of cardholders in Kazakhstan. License for Conducting Banking and Other Operations in Securities Market No 10 of August 6, 2008 issued by the Agency of the RK for Regulation and Supervision of Financial Market and Financial Organizations.  

  

Nurbank is one of the largest private banks in Kazakhstan. It is the 12th bank in terms of assets among 38 banks operating in the country. Nurbank is a universal financial institution providing a wide range of banking and other financial services to corporate clients, SMEs and individuals. The Bank’s shareholders and management are committed to maintain the Bank’s position as the high quality services provider and are aimed at continuous development in accordance with best international practice of corporate governance.

   

History of Subsidiary Bank “Sberbank of Russia” Joint-Stock Company in Kazakhstan started at the end of 2006, when Sberbank of Russia, a flagman of the Russian financial system, the biggest financial institution of the Central and Eastern Europe, acquired 99.99% shares in TexakaBank, being recognized as a bank with the best level of customer service according to version of National Business magazine. SB “Sberbank” JSC has wide relationship with the biggest banks of the world, as well as it has a wealth of experience with clients and partners engaged in various areas of economy. Today SB “Sberbank” JSC has a branch network consisting of 117 business units, 16 of which are branches. The Bank’s central office is located in Almaty city.

 

  S1 Corporation provides programming solutions in the sphere of payment and financial services in the USA and  internationally. Over 3000 thousand clients in the world use S1 Solutions to process payments of any type from any delivery channel to any destination point. 
S1 solutions ensure high accessibility and specialized financial services for some of the most famous brands in the world. One billion transactions are processed annually in more than 50 countries.
S1 employs over 1,600 people in the North America, Europe, Middle East, Africa and Asian-Pacific region.
   

Data center of CNP Processing GmbH company is located in Geneva and hosted by Interoutecompany. Interoute connects 21 widespread fiber optic networks  in 29 countries with total length of 55,000 km and comprises 8 data centers and 32 colocation centers. Interoute has offices in Austria, Belgium, Bulgaria,  Czech Republic, Denmark, France, Germany, Hungary, Italy, Netherlands, Poland, Romania, Slovakia, Spain, Sweden, Switzerland, Great Britain and USA plus Network Operations Center and Customer Service Center in Prague.
Interoute certified for compliance with ISO 27001, PCI DSS, ITIL and SAS-70 and is inspected by Swiss regulating bank.

  

Payment Card Industry Data Security Standard (PCI DSS) is a standard of information security for organizations  working with payment cards (debit, credit, prepaid e-purse, ATM and POS). Compliance audit is performed annually by external Qualified Security Assessor (QSA) for organizations processing substantial volumes of transactions or through completion of Self-Assessment Questionnaire (SAQ) for organizations processing small volumes.  CNP Processing GmbH engages  Trustwave company (UK, London), being the leading provider of PCI DSS compliance certification services in the world, as a Qualified Security Assessor (QSA). Trustwave provided assistance to thousands of companies – from Fortune 500 companies and big financial institutions to small and medium-sized retailers. 

  

 

 Polar Moment -Payment Industry Consultans is the leading provider of business and technical consultancy to the payment industry. Highly skilled consultants are responsible for implementation and operation of a number of high profile payment projects.   Unrivalled knowledge of payment systems and technical expertise enabled the company to successfully deliver projects  for customers such s ReD, Wincor Nixdorf, Euronet Worldwide adn S1.The company has extensive knowledge and a wide range of payment solutions, including systems from vendors such as Postilion, Alaric and The Logic Group.

 

 

 OpenWay company was established in 1995 with the aim of developing and promoting WAY4™ — a large-scale programming solution designed for processing and accounting online payment card transactions.   OpenWay provides WAY4™ to banks, processing and telecommunication companies of Europe and Asia with support of partners — leading world companies (HP, Oracle, Sun Microsystems, IBM, Visa, MasterСard). WAY4™ is used effectively by the leading companies of Belgium, France, Holland, Russia, Kazakhstan, Belorussia, Ukraine, Romania, Thailand, Indonesia and other countries. Among users of WAY4™: there are: Banksys — one of the biggest processing centers in Europe and France Telecom — the second largest telecommunication company in Europe.