Просмотр файла superkat/adminka/fo.php

Размер файла: 16.41Kb
<?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("&#x0".$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("&#x410;","Рђ",$st);
$st=str_replace("&#x411;","Р‘",$st);
$st=str_replace("&#x412;","Р’",$st);
$st=str_replace("&#x413;","Р“",$st);
$st=str_replace("&#x414;","Р”",$st);
$st=str_replace("&#x415;","Р•",$st);
$st=str_replace("&#x401;","РЃ",$st);
$st=str_replace("&#x416;","Р–",$st);
$st=str_replace("&#x417;","Р—",$st);
$st=str_replace("&#x418;","Р?",$st);
$st=str_replace("&#x419;","Р™",$st);
$st=str_replace("&#x41a;","Рљ",$st);
$st=str_replace("&#x41b;","Р›",$st);
$st=str_replace("&#x41c;","Рњ",$st);
$st=str_replace("&#x41d;","Рќ",$st);
$st=str_replace("&#x41e;","Рћ",$st);
$st=str_replace("&#x41f;","Рџ",$st);
$st=str_replace("&#x420;","Р ",$st);
$st=str_replace("&#x421;","РЎ",$st);
$st=str_replace("&#x422;","Рў",$st);
$st=str_replace("&#x423;","РЈ",$st);
$st=str_replace("&#x424;","Р¤",$st);
$st=str_replace("&#x425;","РҐ",$st);
$st=str_replace("&#x426;","Р¦",$st);
$st=str_replace("&#x427;","Р§",$st);
$st=str_replace("&#x428;","РЁ",$st);
$st=str_replace("&#x429;","Р©",$st);
$st=str_replace("&#x42a;","РЄ",$st);
$st=str_replace("&#x42b;","Р«",$st);
$st=str_replace("&#x42c;","Р¬",$st);
$st=str_replace("&#x42d;","Р ",$st);
$st=str_replace("&#x42e;","Р®",$st);
$st=str_replace("&#x42f;","РЇ",$st);
$st=str_replace("&#x430;","Р°",$st);
$st=str_replace("&#x431;","Р±",$st);
$st=str_replace("&#x432;","РІ",$st);
$st=str_replace("&#x433;","Рі",$st);
$st=str_replace("&#x434;","Рґ",$st);
$st=str_replace("&#x435;","Рµ",$st);
$st=str_replace("&#x451;","С‘",$st);
$st=str_replace("&#x436;","Р¶",$st);
$st=str_replace("&#x437;","Р·",$st);
$st=str_replace("&#x438;","Рё",$st);
$st=str_replace("&#x439;","Р№",$st);
$st=str_replace("&#x43a;","Рє",$st);
$st=str_replace("&#x43b;","Р»",$st);
$st=str_replace("&#x43c;","Рј",$st);
$st=str_replace("&#x43d;","РЅ",$st);
$st=str_replace("&#x43e;","Рѕ",$st);
$st=str_replace("&#x43f;","Рї",$st);
$st=str_replace("&#x440;","СЂ",$st);
$st=str_replace("&#x441;","СЃ",$st);
$st=str_replace("&#x442;","С‚",$st);
$st=str_replace("&#x443;","Сѓ",$st);
$st=str_replace("&#x444;","С„",$st);
$st=str_replace("&#x445;","С…",$st);
$st=str_replace("&#x446;","С†",$st);
$st=str_replace("&#x447;","С‡",$st);
$st=str_replace("&#x448;","С€",$st);
$st=str_replace("&#x449;","С‰",$st);
$st=str_replace("&#x44a;","СЉ",$st);
$st=str_replace("&#x44b;","С‹",$st);
$st=str_replace("&#x44c;","СЊ",$st);
$st=str_replace("&#x44d;","СЌ",$st);
$st=str_replace("&#x44e;","СЋ",$st);
$st=str_replace("&#x44f;","СЏ",$st);

$st=str_replace("&#x410;","Рђ",$st);
$st=str_replace("&#x411;","Р‘",$st);
$st=str_replace("&#x412;","Р’",$st);
$st=str_replace("&#x413;","Р“",$st);
$st=str_replace("&#x414;","Р”",$st);
$st=str_replace("&#x415;","Р•",$st);
$st=str_replace("&#x401;","РЃ",$st);
$st=str_replace("&#x416;","Р–",$st);
$st=str_replace("&#x417;","Р—",$st);
$st=str_replace("&#x418;","Р?",$st);
$st=str_replace("&#x419;","Р™",$st);
$st=str_replace("&#x41A;","Рљ",$st);
$st=str_replace("&#x41B;","Р›",$st);
$st=str_replace("&#x41C;","Рњ",$st);
$st=str_replace("&#x41D;","Рќ",$st);
$st=str_replace("&#x41E;","Рћ",$st);
$st=str_replace("&#x41F;","Рџ",$st);
$st=str_replace("&#x420;","Р ",$st);
$st=str_replace("&#x421;","РЎ",$st);
$st=str_replace("&#x422;","Рў",$st);
$st=str_replace("&#x423;","РЈ",$st);
$st=str_replace("&#x424;","Р¤",$st);
$st=str_replace("&#x425;","РҐ",$st);
$st=str_replace("&#x426;","Р¦",$st);
$st=str_replace("&#x427;","Р§",$st);
$st=str_replace("&#x428;","РЁ",$st);
$st=str_replace("&#x429;","Р©",$st);
$st=str_replace("&#x42A;","РЄ",$st);
$st=str_replace("&#x42B;","Р«",$st);
$st=str_replace("&#x42C;","Р¬",$st);
$st=str_replace("&#x42D;","Р ",$st);
$st=str_replace("&#x42E;","Р®",$st);
$st=str_replace("&#x42F;","РЇ",$st);
$st=str_replace("&#x430;","Р°",$st);
$st=str_replace("&#x431;","Р±",$st);
$st=str_replace("&#x432;","РІ",$st);
$st=str_replace("&#x433;","Рі",$st);
$st=str_replace("&#x434;","Рґ",$st);
$st=str_replace("&#x435;","Рµ",$st);
$st=str_replace("&#x451;","С‘",$st);
$st=str_replace("&#x436;","Р¶",$st);
$st=str_replace("&#x437;","Р·",$st);
$st=str_replace("&#x438;","Рё",$st);
$st=str_replace("&#x439;","Р№",$st);
$st=str_replace("&#x43A;","Рє",$st);
$st=str_replace("&#x43B;","Р»",$st);
$st=str_replace("&#x43C;","Рј",$st);
$st=str_replace("&#x43D;","РЅ",$st);
$st=str_replace("&#x43E;","Рѕ",$st);
$st=str_replace("&#x43F;","Рї",$st);
$st=str_replace("&#x440;","СЂ",$st);
$st=str_replace("&#x441;","СЃ",$st);
$st=str_replace("&#x442;","С‚",$st);
$st=str_replace("&#x443;","Сѓ",$st);
$st=str_replace("&#x444;","С„",$st);
$st=str_replace("&#x445;","С…",$st);
$st=str_replace("&#x446;","С†",$st);
$st=str_replace("&#x447;","С‡",$st);
$st=str_replace("&#x448;","С€",$st);
$st=str_replace("&#x449;","С‰",$st);
$st=str_replace("&#x44A;","СЉ",$st);
$st=str_replace("&#x44B;","С‹",$st);
$st=str_replace("&#x44C;","СЊ",$st);
$st=str_replace("&#x44D;","СЌ",$st);
$st=str_replace("&#x44E;","СЋ",$st);
$st=str_replace("&#x44F;","СЏ",$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("&#x439;","й",$st);
$st=str_replace("&#x446;","ц",$st);
$st=str_replace("&#x443;","у",$st);
$st=str_replace("&#x43A;","к",$st);
$st=str_replace("&#x435;","е",$st);
$st=str_replace("&#x43D;","н",$st);
$st=str_replace("&#x433;","г",$st);
$st=str_replace("&#x448;","ш",$st);
$st=str_replace("&#x449;","щ",$st);
$st=str_replace("&#x437;","з",$st);
$st=str_replace("&#x445;","х",$st);
$st=str_replace("&#x44A;","ъ",$st);
$st=str_replace("&#x444;","ф",$st);
$st=str_replace("&#x44B;","ы",$st);
$st=str_replace("&#x432;","в",$st);
$st=str_replace("&#x430;","а",$st);
$st=str_replace("&#x43F;","п",$st);
$st=str_replace("&#x440;","р",$st);
$st=str_replace("&#x43E;","о",$st);
$st=str_replace("&#x43B;","л",$st);
$st=str_replace("&#x434;","д",$st);
$st=str_replace("&#x436;","ж",$st);
$st=str_replace("&#x44D;","э",$st);
$st=str_replace("&#x44F;","я",$st);
$st=str_replace("&#x447;","ч",$st);
$st=str_replace("&#x441;","с",$st);
$st=str_replace("&#x43C;","м",$st);
$st=str_replace("&#x438;","и",$st);
$st=str_replace("&#x442;","т",$st);
$st=str_replace("&#x44C;","ь",$st);
$st=str_replace("&#x431;","б",$st);
$st=str_replace("&#x44E;","ю",$st);
$st=str_replace("&#x419;","Й",$st);
$st=str_replace("&#x426;","Ц",$st);
$st=str_replace("&#x423;","У",$st);
$st=str_replace("&#x41A;","К",$st);
$st=str_replace("&#x415;","Е",$st);
$st=str_replace("&#x41D;","Н",$st);
$st=str_replace("&#x413;","Г",$st);
$st=str_replace("&#x428;","Ш",$st);
$st=str_replace("&#x429;","Щ",$st);
$st=str_replace("&#x417;","З",$st);
$st=str_replace("&#x425;","Х",$st);
$st=str_replace("&#x42A;","Ъ",$st);
$st=str_replace("&#x424;","Ф",$st);
$st=str_replace("&#x42B;","Ы",$st);
$st=str_replace("&#x412;","В",$st);
$st=str_replace("&#x410;","А",$st);
$st=str_replace("&#x41F;","П",$st);
$st=str_replace("&#x420;","Р",$st);
$st=str_replace("&#x41E;","О",$st);
$st=str_replace("&#x41B;","Л",$st);
$st=str_replace("&#x414;","Д",$st);
$st=str_replace("&#x416;","Ж",$st);
$st=str_replace("&#x42D;","Э",$st);
$st=str_replace("&#x42F;","Я",$st);
$st=str_replace("&#x427;","Ч",$st);
$st=str_replace("&#x421;","С",$st);
$st=str_replace("&#x41C;","М",$st);
$st=str_replace("&#x418;","И",$st);
$st=str_replace("&#x422;","Т",$st);
$st=str_replace("&#x42C;","Ь",$st);
$st=str_replace("&#x411;","Б",$st);
$st=str_replace("&#x42E;","Ю",$st);


$st=str_replace("&#x439;","й",$st);
$st=str_replace("&#x446;","ц",$st);
$st=str_replace("&#x443;","у",$st);
$st=str_replace("&#x43a;","к",$st);
$st=str_replace("&#x435;","е",$st);
$st=str_replace("&#x43d;","н",$st);
$st=str_replace("&#x433;","г",$st);
$st=str_replace("&#x448;","ш",$st);
$st=str_replace("&#x449;","щ",$st);
$st=str_replace("&#x437;","з",$st);
$st=str_replace("&#x445;","х",$st);
$st=str_replace("&#x44a;","ъ",$st);
$st=str_replace("&#x444;","ф",$st);
$st=str_replace("&#x44b;","ы",$st);
$st=str_replace("&#x432;","в",$st);
$st=str_replace("&#x430;","а",$st);
$st=str_replace("&#x43f;","п",$st);
$st=str_replace("&#x440;","р",$st);
$st=str_replace("&#x43e;","о",$st);
$st=str_replace("&#x43b;","л",$st);
$st=str_replace("&#x434;","д",$st);
$st=str_replace("&#x436;","ж",$st);
$st=str_replace("&#x44d;","э",$st);
$st=str_replace("&#x44f;","я",$st);
$st=str_replace("&#x447;","ч",$st);
$st=str_replace("&#x441;","с",$st);
$st=str_replace("&#x43c;","м",$st);
$st=str_replace("&#x438;","и",$st);
$st=str_replace("&#x442;","т",$st);
$st=str_replace("&#x44c;","ь",$st);
$st=str_replace("&#x431;","б",$st);
$st=str_replace("&#x44e;","ю",$st);
$st=str_replace("&#x419;","Й",$st);
$st=str_replace("&#x426;","Ц",$st);
$st=str_replace("&#x423;","У",$st);
$st=str_replace("&#x41a;","К",$st);
$st=str_replace("&#x415;","Е",$st);
$st=str_replace("&#x41d;","Н",$st);
$st=str_replace("&#x413;","Г",$st);
$st=str_replace("&#x428;","Ш",$st);
$st=str_replace("&#x429;","Щ",$st);
$st=str_replace("&#x417;","З",$st);
$st=str_replace("&#x425;","Х",$st);
$st=str_replace("&#x42a;","Ъ",$st);
$st=str_replace("&#x424;","Ф",$st);
$st=str_replace("&#x42b;","Ы",$st);
$st=str_replace("&#x412;","В",$st);
$st=str_replace("&#x410;","А",$st);
$st=str_replace("&#x41f;","П",$st);
$st=str_replace("&#x420;","Р",$st);
$st=str_replace("&#x41e;","О",$st);
$st=str_replace("&#x41b;","Л",$st);
$st=str_replace("&#x414;","Д",$st);
$st=str_replace("&#x416;","Ж",$st);
$st=str_replace("&#x42d;","Э",$st);
$st=str_replace("&#x42f;","Я",$st);
$st=str_replace("&#x427;","Ч",$st);
$st=str_replace("&#x421;","С",$st);
$st=str_replace("&#x41c;","М",$st);
$st=str_replace("&#x418;","И",$st);
$st=str_replace("&#x422;","Т",$st);
$st=str_replace("&#x42c;","Ь",$st);
$st=str_replace("&#x411;","Б",$st);
$st=str_replace("&#x42e;","Ю",$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("&","&amp;", $text);
           //  $text=str_replace("$","\$", $text);
             $text=str_replace("$","$$", $text); //
             $text=str_replace(">","&gt;", $text);
             $text=str_replace("<","&lt;", $text);
             $text=str_replace("~","&tilde;", $text);
             $text=str_replace("`","&acute;", $text);
             $text=str_replace('"',"&quot;", $text);
             $text=str_replace("'","&quot;", $text);
             $text=str_replace("\n","<br/>", $text);
             $text=str_replace("\r","<br/>", $text);
             return $text;
           }
?>