"); return true; } return false; } function remove_tags($arg_str){ $val=preg_replace("/<.+>/U","",$arg_str); return $val; } function createDir($dir) { print($dir); if (!is_dir($dir)) { $result = mkdir($dir, 0777); return $result; } return true; } function utf2eng($text, $uperCase = false) { global $lang; if ($lang == "geo") { $arg = $text; $alpha_geo = explode(" ", "ა ბ გ დ ე ვ ზ თ ი კ ლ მ ნ ო პ ჟ რ ს ტ უ ფ ქ ღ ყ შ ჩ ც ძ წ ჭ ხ ჯ ჰ"); $alpha_eng = explode(" ", "a b g d e v z T i k l m n o p J r s t u f q R y S C c Z w W x j h"); $text = str_replace($alpha_geo, $alpha_eng, $arg); if ($uperCase) $text = strtoupper($text); } return $text; } //For editor function encodeHTML($sHTML) { $sHTML = preg_replace('/&/i', '&', $sHTML); $sHTML = preg_replace('//i', '>', $sHTML); return $sHTML; } function innovaEditor($textareaName, $text, $editorNumber, $height = "300px") { print(""); print(""); } function substring($str, $len, $sentence_end = "", $html_decode = true, $remove_tags = true) { $val = $str; $srtlen = strlen($val); if (true == $html_decode) { $val = html_entity_decode($val, ENT_QUOTES, "UTF-8"); } if (true == $remove_tags) { $val = remove_tags($val); } $substr_len = $len; $exactString = mb_substr($val, 0, $len, 'UTF-8'); if ("" != $sentence_end) { $before = mb_strrpos($exactString, $sentence_end, -1, "UTF-8"); $after = mb_strpos($val, $sentence_end, ($srtlen > $before) ? $before + 1 : $before, "UTF-8"); if (($before > $len / 2) && ($before > 1)) $substr_len = $before + 1; else if ($after > 1) $substr_len = $after + 1; else $substr_len = strlen($val); } $val = mb_substr($val, 0, $substr_len, 'UTF-8'); return $val; } function RemoveXSS($val) { // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed // this prevents some character re-spacing such as // note that you have to handle splits with \n, \r, and \t later since they *are* allowed in some inputs $val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val); // straight replacements, the user should never need these since they're normal characters // this prevents like $search = 'abcdefghijklmnopqrstuvwxyz'; $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $search .= '1234567890!@#$%^&*()'; $search .= '~`";:?+/={}[]-_|\'\\'; for ($i = 0; $i < strlen($search); $i++) { // ;? matches the ;, which is optional // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars // @ @ search for the hex values $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ; // @ @ 0{0,7} matches '0' zero to seven times $val = preg_replace('/(�{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ; } // now the only remaining whitespace attacks are \t, \n, and \r $ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base'); $ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload'); $ra = array_merge($ra1, $ra2); $found = true; // keep replacing as long as the previous round replaced something while ($found == true) { $val_before = $val; for ($i = 0; $i < sizeof($ra); $i++) { $pattern = '/'; for ($j = 0; $j < strlen($ra[$i]); $j++) { if ($j > 0) { $pattern .= '('; $pattern .= '(&#[xX]0{0,8}([9ab]);)'; $pattern .= '|'; $pattern .= '|(�{0,8}([9|10|13]);)'; $pattern .= ')*'; } $pattern .= $ra[$i][$j]; } $pattern .= '/i'; $replacement = substr($ra[$i], 0, 2).''.substr($ra[$i], 2); // add in <> to nerf the tag $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags if ($val_before == $val) { // no replacements were made, so exit the loop $found = false; } } } return $val; } //SQL Injection function quote_smart_post($value){ if ( get_magic_quotes_gpc() ){ $value = stripslashes( $value ); } $value = mysql_real_escape_string($value); return $value; } function quote_smart_get($value){ if ( get_magic_quotes_gpc() ){ $value = stripslashes( $value ); } $value = mysql_real_escape_string($value); $value = str_replace(' ', '', $value); return $value; } if ($_POST) { foreach (array_keys($_POST) as $var) { ${$var} = quote_smart_post(${$var}); } } if ($_GET) { foreach (array_keys($_GET) as $var) { $file1 = ''; if( isset($_GET['file']) ){ $file1 = $file; } ${$var} = quote_smart_get(${$var}); $file = $file1; } } //----- FOR SWF function flash($swf,$wmode,$width,$height){ $swf_trimmed=substr($swf,0,strlen($swf)-4); return " "; } function flash_with_vars($swf,$wmode,$width,$height,$vars){ $swf_trimmed=substr($swf,0,strlen($swf)-4); return " "; } function utf2text($text, $out="eng") { $arg = $text; $alpha_geo = explode(" ", "ა ბ გ დ ე ვ ზ თ ი კ ლ მ ნ ო პ ჟ რ ს ტ უ ფ ქ ღ ყ შ ჩ ც ძ წ ჭ ხ ჯ ჰ"); $alpha_eng = explode(" ", "a b g d e v z T i k l m n o p J r s t u f q R y S C c Z w W x j h"); if ("geo" == $out) { $val = str_replace($alpha_eng, $alpha_geo, $arg); } elseif ("eng" == $out) { $val = str_replace($alpha_geo, $alpha_eng, $arg); } return $val; } ?> define("_DN_footer_text","Developed with support from the United Nations Development Programme (UNDP) and Government of Sweden"); define("_Enter_personal_number","Enter personal number"); define("_you_are_now","you are now"); define("_Latest_News","Latest News");//
define("_News_Archive","News Archive");//
define("_WNews_Archive","Publications");//
define("_Videos","Video Gallery");//
define("_Photos","Photo Gallery");//
define("_Home","Home");//
define("_About_us","About us");//
define("_Contacts","Contacts");//
define("_Add","Add");//
define("_Email_OK","Your E-mail Was Successfully Added In Data Base!");//
define("_HOME","Home");//
define("_HOME_","You are now");//
define("_SITE_MAP","SITE MAP");//
define("_CONTACTS","CONTACTS");//
define("_Register_for_News","Register for News");//
define("_Email","E-mail");//
define("_Site_Map","Site Map");//
define("_Search_Result","Search Result");//
define("_Records_Found","Records Found");//
define("_Search","Search");//
define("_search","search");//
define("_News","News");//
define("_News1","News");//
define("_archive","Archive");//
define("_earchive","Events");//
define("_On_Page","You are here");//
define("_Service_list","Service list");//
define("_Quarterly","Quarterly");//
define("_Yearly","Annual");//
define("_Monthly","Monthly");//
define("_Back","Back");//
define("_Thank","Thank You");//
define("_SEE_MORE_","See More");//
define("_FOOTER_","All Rights Reserved © 2009 Penitentiary and Probation Training Centre
Created with Financial Support by European Union");//
?> PPTC.GE
       
value="_search" onFocus="if(this.value == '_search'){this.value = '';}" id="search_text" style="background-color: #544e74; height:19px; width:140px; color: #FFF; border: 0px; padding-left:5px;" name="search" />
"page" and $action <> "sitemap" and $action <> "projects_archive" and $action <> "projects" and $action <> "thanks" and $action <> "photogallery" and $action <> "gallery" and $action <> "videogallery" and $action <> "video" and $action <> "news_archive" and $action <> "news" and $action <> "list_archive" and $action <> "list" and $action <> "search" and $action <> "det_action" and $action <> "photogallery_view" and $action <> "certification" // and $action <> "map" and $action <> "map_region" and $action <> "statistics" and $action <> "0"){ $intro = 1; } if($action == "thanks"){ include "thanks.php"; } if($action == "0" or $intro == 1){ include "intro.php"; } if($action == "news"){ include "news.php"; } if($action == "det_other"){ include "det_other.php"; } if($action == "news_archive"){ include "news_archive.php"; } if($action == "projects"){ include "projects.php"; } if($action == "projects_archive"){ include "projects_archive.php"; } if($action == "page"){ include "page.php"; } if($action == "search"){ include "search.php"; } if($action == "video"){ include "video.php"; } if($action == "videogallery"){ include "videogallery.php"; } if($action == "gallery"){ include "photogallery.php"; } if($action == "photogallery_view"){ include "photogallery_view.php"; } if($action == "photogallery"){ include "photogallery1.php"; } if($action == "sitemap"){ include "site_map.php"; } if($action == "list"){ include "list.php"; } if($action == "list_archive"){ include "list_archive.php"; } if($action == "map"){ include "map.php"; } // if($action == "map_region"){ // include "map.php"; // } if($action == "statistics"){ include "statistics.php"; } if($action == "certification"){ include "certification.php"; } // if($_SERVER['REMOTE_ADDR'] == '31.146.139.180'){ // var_dump($action); // } ?>