<?php
$log_a="admin"; // логин админа
$pass_a="admin"; // пароль админа
/*
*функции генерации данных
*/
function switchtext($text){ //функция, выбирающая символ (из 36) по номеру ($text)
switch ($text){
case 1:
$a="q";
break;
case 2:
$a="w";
break;
case 3:
$a="e";
break;
case 4:
$a="r";
break;
case 5:
$a="t";
break;
case 6:
$a="y";
break;
case 7:
$a="u";
break;
case 8:
$a="i";
break;
case 9:
$a="o";
break;
case 10:
$a="p";
break;
case 11:
$a="a";
break;
case 12:
$a="s";
break;
case 13:
$a="d";
break;
case 14:
$a="f";
break;
case 15:
$a="g";
break;
case 16:
$a="h";
break;
case 17:
$a="j";
break;
case 18:
$a="k";
break;
case 19:
$a="l";
break;
case 20:
$a="z";
break;
case 21:
$a="x";
break;
case 22:
$a="c";
break;
case 23:
$a="v";
break;
case 24:
$a="b";
break;
case 25:
$a="n";
break;
case 26:
$a="m";
break;
case 27:
$a=1;
break;
case 28:
$a=2;
break;
case 29:
$a=3;
break;
case 30:
$a=4;
break;
case 31:
$a=5;
break;
case 32:
$a=6;
break;
case 33:
$a=7;
break;
case 34:
$a=8;
break;
case 35:
$a=9;
break;
case 36:
$a=0;
break;
}//end switch
return $a;
}
function randtext(){//создаёт рандомный пароль длиной в $kol символов
mt_srand();
$kol=mt_rand(4,10);
$text="";
for ($i=1;$i<=$kol;$i++){
$t=mt_rand(1,36);
$text.=switchtext($t);
}
return $text;
}
/*
*функции перекодировки
*/
function unicode ($s) { if ( (ord($s)>=192) & (ord($s)<=255) ) $hexvalue=dechex(ord($s)+848); if ($s=="Ё") $hexvalue="401"; if ($s=="ё") $hexvalue="451"; return("�".$hexvalue.";");}
function utf_encode ($s) { return(preg_replace("/[А-яЁё]/e","unicode('\\0')",$s));} //функция декодирования в утф-8
function echou($s){
echo utf_encode($s);
}
function translit($st){
$st=str_replace("А","Рђ",$st);
$st=str_replace("Б","Р‘",$st);
$st=str_replace("В","Р’",$st);
$st=str_replace("Г","Р“",$st);
$st=str_replace("Д","Р”",$st);
$st=str_replace("Е","Р•",$st);
$st=str_replace("Ё","РЃ",$st);
$st=str_replace("Ж","Р–",$st);
$st=str_replace("З","Р—",$st);
$st=str_replace("И","Р?",$st);
$st=str_replace("Й","Р™",$st);
$st=str_replace("К","Рљ",$st);
$st=str_replace("Л","Р›",$st);
$st=str_replace("М","Рњ",$st);
$st=str_replace("Н","Рќ",$st);
$st=str_replace("О","Рћ",$st);
$st=str_replace("П","Рџ",$st);
$st=str_replace("Р","Р ",$st);
$st=str_replace("С","РЎ",$st);
$st=str_replace("Т","Рў",$st);
$st=str_replace("У","РЈ",$st);
$st=str_replace("Ф","Р¤",$st);
$st=str_replace("Х","РҐ",$st);
$st=str_replace("Ц","Р¦",$st);
$st=str_replace("Ч","Р§",$st);
$st=str_replace("Ш","РЁ",$st);
$st=str_replace("Щ","Р©",$st);
$st=str_replace("Ъ","РЄ",$st);
$st=str_replace("Ы","Р«",$st);
$st=str_replace("Ь","Р¬",$st);
$st=str_replace("Э","Р ",$st);
$st=str_replace("Ю","Р®",$st);
$st=str_replace("Я","РЇ",$st);
$st=str_replace("а","Р°",$st);
$st=str_replace("б","Р±",$st);
$st=str_replace("в","РІ",$st);
$st=str_replace("г","Рі",$st);
$st=str_replace("д","Рґ",$st);
$st=str_replace("е","Рµ",$st);
$st=str_replace("ё","С‘",$st);
$st=str_replace("ж","Р¶",$st);
$st=str_replace("з","Р·",$st);
$st=str_replace("и","Рё",$st);
$st=str_replace("й","Р№",$st);
$st=str_replace("к","Рє",$st);
$st=str_replace("л","Р»",$st);
$st=str_replace("м","Рј",$st);
$st=str_replace("н","РЅ",$st);
$st=str_replace("о","Рѕ",$st);
$st=str_replace("п","Рї",$st);
$st=str_replace("р","СЂ",$st);
$st=str_replace("с","СЃ",$st);
$st=str_replace("т","С‚",$st);
$st=str_replace("у","Сѓ",$st);
$st=str_replace("ф","С„",$st);
$st=str_replace("х","С…",$st);
$st=str_replace("ц","С†",$st);
$st=str_replace("ч","С‡",$st);
$st=str_replace("ш","С€",$st);
$st=str_replace("щ","С‰",$st);
$st=str_replace("ъ","СЉ",$st);
$st=str_replace("ы","С‹",$st);
$st=str_replace("ь","СЊ",$st);
$st=str_replace("э","СЌ",$st);
$st=str_replace("ю","СЋ",$st);
$st=str_replace("я","СЏ",$st);
$st=str_replace("А","Рђ",$st);
$st=str_replace("Б","Р‘",$st);
$st=str_replace("В","Р’",$st);
$st=str_replace("Г","Р“",$st);
$st=str_replace("Д","Р”",$st);
$st=str_replace("Е","Р•",$st);
$st=str_replace("Ё","РЃ",$st);
$st=str_replace("Ж","Р–",$st);
$st=str_replace("З","Р—",$st);
$st=str_replace("И","Р?",$st);
$st=str_replace("Й","Р™",$st);
$st=str_replace("К","Рљ",$st);
$st=str_replace("Л","Р›",$st);
$st=str_replace("М","Рњ",$st);
$st=str_replace("Н","Рќ",$st);
$st=str_replace("О","Рћ",$st);
$st=str_replace("П","Рџ",$st);
$st=str_replace("Р","Р ",$st);
$st=str_replace("С","РЎ",$st);
$st=str_replace("Т","Рў",$st);
$st=str_replace("У","РЈ",$st);
$st=str_replace("Ф","Р¤",$st);
$st=str_replace("Х","РҐ",$st);
$st=str_replace("Ц","Р¦",$st);
$st=str_replace("Ч","Р§",$st);
$st=str_replace("Ш","РЁ",$st);
$st=str_replace("Щ","Р©",$st);
$st=str_replace("Ъ","РЄ",$st);
$st=str_replace("Ы","Р«",$st);
$st=str_replace("Ь","Р¬",$st);
$st=str_replace("Э","Р ",$st);
$st=str_replace("Ю","Р®",$st);
$st=str_replace("Я","РЇ",$st);
$st=str_replace("а","Р°",$st);
$st=str_replace("б","Р±",$st);
$st=str_replace("в","РІ",$st);
$st=str_replace("г","Рі",$st);
$st=str_replace("д","Рґ",$st);
$st=str_replace("е","Рµ",$st);
$st=str_replace("ё","С‘",$st);
$st=str_replace("ж","Р¶",$st);
$st=str_replace("з","Р·",$st);
$st=str_replace("и","Рё",$st);
$st=str_replace("й","Р№",$st);
$st=str_replace("к","Рє",$st);
$st=str_replace("л","Р»",$st);
$st=str_replace("м","Рј",$st);
$st=str_replace("н","РЅ",$st);
$st=str_replace("о","Рѕ",$st);
$st=str_replace("п","Рї",$st);
$st=str_replace("р","СЂ",$st);
$st=str_replace("с","СЃ",$st);
$st=str_replace("т","С‚",$st);
$st=str_replace("у","Сѓ",$st);
$st=str_replace("ф","С„",$st);
$st=str_replace("х","С…",$st);
$st=str_replace("ц","С†",$st);
$st=str_replace("ч","С‡",$st);
$st=str_replace("ш","С€",$st);
$st=str_replace("щ","С‰",$st);
$st=str_replace("ъ","СЉ",$st);
$st=str_replace("ы","С‹",$st);
$st=str_replace("ь","СЊ",$st);
$st=str_replace("э","СЌ",$st);
$st=str_replace("ю","СЋ",$st);
$st=str_replace("я","СЏ",$st);
return $st;
}
function translit2($st){
$st=str_replace("А","Рђ",$st);
$st=str_replace("Б","Р‘",$st);
$st=str_replace("В","Р’",$st);
$st=str_replace("Г","Р“",$st);
$st=str_replace("Д","Р”",$st);
$st=str_replace("Е","Р•",$st);
$st=str_replace("Ё","РЃ",$st);
$st=str_replace("Ж","Р–",$st);
$st=str_replace("З","Р—",$st);
$st=str_replace("И","Р?",$st);
$st=str_replace("Й","Р™",$st);
$st=str_replace("К","Рљ",$st);
$st=str_replace("Л","Р›",$st);
$st=str_replace("М","Рњ",$st);
$st=str_replace("Н","Рќ",$st);
$st=str_replace("О","Рћ",$st);
$st=str_replace("П","Рџ",$st);
$st=str_replace("Р","Р",$st);
$st=str_replace("С","РЎ",$st);
$st=str_replace("Т","Рў",$st);
$st=str_replace("У","РЈ",$st);
$st=str_replace("Ф","Р¤",$st);
$st=str_replace("Х","РҐ",$st);
$st=str_replace("Ц","Р¦",$st);
$st=str_replace("Ч","Р§",$st);
$st=str_replace("Ш","РЁ",$st);
$st=str_replace("Щ","Р©",$st);
$st=str_replace("Ъ","РЄ",$st);
$st=str_replace("Ы","Р«",$st);
$st=str_replace("Ь","Р¬",$st);
$st=str_replace("Э","Р",$st);
$st=str_replace("Ю","Р®",$st);
$st=str_replace("Я","РЇ",$st);
$st=str_replace("а","Р°",$st);
$st=str_replace("б","Р±",$st);
$st=str_replace("в","РІ",$st);
$st=str_replace("г","Рі",$st);
$st=str_replace("д","Рґ",$st);
$st=str_replace("е","Рµ",$st);
$st=str_replace("ё","С‘",$st);
$st=str_replace("ж","Р¶",$st);
$st=str_replace("з","Р·",$st);
$st=str_replace("и","Рё",$st);
$st=str_replace("й","Р№",$st);
$st=str_replace("к","Рє",$st);
$st=str_replace("л","Р»",$st);
$st=str_replace("м","Рј",$st);
$st=str_replace("н","РЅ",$st);
$st=str_replace("о","Рѕ",$st);
$st=str_replace("п","Рї",$st);
$st=str_replace("р","СЂ",$st);
$st=str_replace("с","СЃ",$st);
$st=str_replace("т","С‚",$st);
$st=str_replace("у","Сѓ",$st);
$st=str_replace("ф","С„",$st);
$st=str_replace("х","С…",$st);
$st=str_replace("ц","С†",$st);
$st=str_replace("ч","С‡",$st);
$st=str_replace("ш","С€",$st);
$st=str_replace("щ","С‰",$st);
$st=str_replace("ъ","СЉ",$st);
$st=str_replace("ы","С‹",$st);
$st=str_replace("ь","СЊ",$st);
$st=str_replace("э","СЌ",$st);
$st=str_replace("ю","СЋ",$st);
$st=str_replace("я","СЏ",$st);
return $st;
}
function mailtrans($st){
$st=str_replace("Р№","й",$st);
$st=str_replace("С†","ц",$st);
$st=str_replace("Сѓ","у",$st);
$st=str_replace("Рє","к",$st);
$st=str_replace("Рµ","е",$st);
$st=str_replace("РЅ","н",$st);
$st=str_replace("Рі","г",$st);
$st=str_replace("С€","ш",$st);
$st=str_replace("С‰","щ",$st);
$st=str_replace("Р·","з",$st);
$st=str_replace("С…","х",$st);
$st=str_replace("СЉ","ъ",$st);
$st=str_replace("С„","ф",$st);
$st=str_replace("С‹","ы",$st);
$st=str_replace("РІ","в",$st);
$st=str_replace("Р°","а",$st);
$st=str_replace("Рї","п",$st);
$st=str_replace("СЂ","р",$st);
$st=str_replace("Рѕ","о",$st);
$st=str_replace("Р»","л",$st);
$st=str_replace("Рґ","д",$st);
$st=str_replace("Р¶","ж",$st);
$st=str_replace("СЌ","э",$st);
$st=str_replace("СЏ","я",$st);
$st=str_replace("С‡","ч",$st);
$st=str_replace("СЃ","с",$st);
$st=str_replace("Рј","м",$st);
$st=str_replace("Рё","и",$st);
$st=str_replace("С‚","т",$st);
$st=str_replace("СЊ","ь",$st);
$st=str_replace("Р±","б",$st);
$st=str_replace("СЋ","ю",$st);
$st=str_replace("Р™","Й",$st);
$st=str_replace("Р¦","Ц",$st);
$st=str_replace("РЈ","У",$st);
$st=str_replace("Рљ","К",$st);
$st=str_replace("Р•","Е",$st);
$st=str_replace("Рќ","Н",$st);
$st=str_replace("Р“","Г",$st);
$st=str_replace("РЁ","Ш",$st);
$st=str_replace("Р©","Щ",$st);
$st=str_replace("Р—","З",$st);
$st=str_replace("РҐ","Х",$st);
$st=str_replace("РЄ","Ъ",$st);
$st=str_replace("Р¤","Ф",$st);
$st=str_replace("Р«","Ы",$st);
$st=str_replace("Р’","В",$st);
$st=str_replace("Рђ","А",$st);
$st=str_replace("Рџ","П",$st);
$st=str_replace("Р ","Р",$st);
$st=str_replace("Рћ","О",$st);
$st=str_replace("Р›","Л",$st);
$st=str_replace("Р”","Д",$st);
$st=str_replace("Р–","Ж",$st);
$st=str_replace("Р","Э",$st);
$st=str_replace("РЇ","Я",$st);
$st=str_replace("Р§","Ч",$st);
$st=str_replace("РЎ","С",$st);
$st=str_replace("Рњ","М",$st);
$st=str_replace("Р?","И",$st);
$st=str_replace("Рў","Т",$st);
$st=str_replace("Р¬","Ь",$st);
$st=str_replace("Р‘","Б",$st);
$st=str_replace("Р®","Ю",$st);
$st=str_replace("й","й",$st);
$st=str_replace("ц","ц",$st);
$st=str_replace("у","у",$st);
$st=str_replace("к","к",$st);
$st=str_replace("е","е",$st);
$st=str_replace("н","н",$st);
$st=str_replace("г","г",$st);
$st=str_replace("ш","ш",$st);
$st=str_replace("щ","щ",$st);
$st=str_replace("з","з",$st);
$st=str_replace("х","х",$st);
$st=str_replace("ъ","ъ",$st);
$st=str_replace("ф","ф",$st);
$st=str_replace("ы","ы",$st);
$st=str_replace("в","в",$st);
$st=str_replace("а","а",$st);
$st=str_replace("п","п",$st);
$st=str_replace("р","р",$st);
$st=str_replace("о","о",$st);
$st=str_replace("л","л",$st);
$st=str_replace("д","д",$st);
$st=str_replace("ж","ж",$st);
$st=str_replace("э","э",$st);
$st=str_replace("я","я",$st);
$st=str_replace("ч","ч",$st);
$st=str_replace("с","с",$st);
$st=str_replace("м","м",$st);
$st=str_replace("и","и",$st);
$st=str_replace("т","т",$st);
$st=str_replace("ь","ь",$st);
$st=str_replace("б","б",$st);
$st=str_replace("ю","ю",$st);
$st=str_replace("Й","Й",$st);
$st=str_replace("Ц","Ц",$st);
$st=str_replace("У","У",$st);
$st=str_replace("К","К",$st);
$st=str_replace("Е","Е",$st);
$st=str_replace("Н","Н",$st);
$st=str_replace("Г","Г",$st);
$st=str_replace("Ш","Ш",$st);
$st=str_replace("Щ","Щ",$st);
$st=str_replace("З","З",$st);
$st=str_replace("Х","Х",$st);
$st=str_replace("Ъ","Ъ",$st);
$st=str_replace("Ф","Ф",$st);
$st=str_replace("Ы","Ы",$st);
$st=str_replace("В","В",$st);
$st=str_replace("А","А",$st);
$st=str_replace("П","П",$st);
$st=str_replace("Р","Р",$st);
$st=str_replace("О","О",$st);
$st=str_replace("Л","Л",$st);
$st=str_replace("Д","Д",$st);
$st=str_replace("Ж","Ж",$st);
$st=str_replace("Э","Э",$st);
$st=str_replace("Я","Я",$st);
$st=str_replace("Ч","Ч",$st);
$st=str_replace("С","С",$st);
$st=str_replace("М","М",$st);
$st=str_replace("И","И",$st);
$st=str_replace("Т","Т",$st);
$st=str_replace("Ь","Ь",$st);
$st=str_replace("Б","Б",$st);
$st=str_replace("Ю","Ю",$st);
$st=str_replace("й","й",$st);
$st=str_replace("ц","ц",$st);
$st=str_replace("у","у",$st);
$st=str_replace("к","к",$st);
$st=str_replace("е","е",$st);
$st=str_replace("н","н",$st);
$st=str_replace("г","г",$st);
$st=str_replace("ш","ш",$st);
$st=str_replace("щ","щ",$st);
$st=str_replace("з","з",$st);
$st=str_replace("х","х",$st);
$st=str_replace("ъ","ъ",$st);
$st=str_replace("ф","ф",$st);
$st=str_replace("ы","ы",$st);
$st=str_replace("в","в",$st);
$st=str_replace("а","а",$st);
$st=str_replace("п","п",$st);
$st=str_replace("р","р",$st);
$st=str_replace("о","о",$st);
$st=str_replace("л","л",$st);
$st=str_replace("д","д",$st);
$st=str_replace("ж","ж",$st);
$st=str_replace("э","э",$st);
$st=str_replace("я","я",$st);
$st=str_replace("ч","ч",$st);
$st=str_replace("с","с",$st);
$st=str_replace("м","м",$st);
$st=str_replace("и","и",$st);
$st=str_replace("т","т",$st);
$st=str_replace("ь","ь",$st);
$st=str_replace("б","б",$st);
$st=str_replace("ю","ю",$st);
$st=str_replace("Й","Й",$st);
$st=str_replace("Ц","Ц",$st);
$st=str_replace("У","У",$st);
$st=str_replace("К","К",$st);
$st=str_replace("Е","Е",$st);
$st=str_replace("Н","Н",$st);
$st=str_replace("Г","Г",$st);
$st=str_replace("Ш","Ш",$st);
$st=str_replace("Щ","Щ",$st);
$st=str_replace("З","З",$st);
$st=str_replace("Х","Х",$st);
$st=str_replace("Ъ","Ъ",$st);
$st=str_replace("Ф","Ф",$st);
$st=str_replace("Ы","Ы",$st);
$st=str_replace("В","В",$st);
$st=str_replace("А","А",$st);
$st=str_replace("П","П",$st);
$st=str_replace("Р","Р",$st);
$st=str_replace("О","О",$st);
$st=str_replace("Л","Л",$st);
$st=str_replace("Д","Д",$st);
$st=str_replace("Ж","Ж",$st);
$st=str_replace("Э","Э",$st);
$st=str_replace("Я","Я",$st);
$st=str_replace("Ч","Ч",$st);
$st=str_replace("С","С",$st);
$st=str_replace("М","М",$st);
$st=str_replace("И","И",$st);
$st=str_replace("Т","Т",$st);
$st=str_replace("Ь","Ь",$st);
$st=str_replace("Б","Б",$st);
$st=str_replace("Ю","Ю",$st);
$st=str_replace("[dlr]","$",$st);
$st=str_replace("[n]","\n",$st);
$st=str_replace("[sl]","\\",$st);
$st=str_replace("[sl2]","/",$st);
$st=convert_cyr_string($st,"w","k");
return $st;
}
function trimcode ($s){
$s=htmlspecialchars($s);
$s=strip_tags($s);
return $s;
}
function del($text)
{
$text=str_replace("&","&", $text);
// $text=str_replace("$","\$", $text);
$text=str_replace("$","$$", $text); //
$text=str_replace(">",">", $text);
$text=str_replace("<","<", $text);
$text=str_replace("~","˜", $text);
$text=str_replace("`","´", $text);
$text=str_replace('"',""", $text);
$text=str_replace("'",""", $text);
$text=str_replace("\n","<br/>", $text);
$text=str_replace("\r","<br/>", $text);
return $text;
}
?>