Вход Регистрация
Файл: DarkAge/menu.php
Строк: 369
<?
Error_Reporting
(E_ALL & ~E_NOTICE);
include_once(
"files/zag.php");
if (
md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {

//===============\
function chet($n) {
    
$drob $n/2;
    if(
eregi("^[0-9]{1,25}$",$drob)){$n 0;}else{$n 1;}
    return 
$n;}
//============\

function menu($str,$theme,$domain){
    
$str str_replace("n",'',$str);
    
$str str_replace("r",'',$str);
    
$ex explode("^|^",$str);
    if(
$ex[1]==1){print '<img src = "menu.gif" alt="" /> ';}
    if(
$ex[0] ==1){print $ex[2].'<br/>';}
    if(
$ex[0] == 2){print '<a href="'.$ex[3].'?log='.$log.'&amp;pas='.$pas.'">'.$ex[2].'</a><br/>';}
    if(
$ex[0] == 3){print '<img src="'.$ex[4].'" alt="'.$ex[2].'" /><br/>';}
    if(
$ex[0] == 4){print '<a href="'.$ex[3].'"><img src="'.$ex[4].'" alt="'.$ex[2].'" /></a><br/>';}}
    
$ffd $udata[20];
$zahvat = @file("data/clan/zahvat/$ffd.dat");
$zadat explode(":||:",$zahvat[0]);
$dzzz=$zadat[1]; 
$dzzs=$zadat[0]; 
if (
$udata[0]!==$dzzs){echo"В доступе отказано!";
}else{
$menushka $udata[20];
$mf 'files/castle/'.$menushka.'.dat';
switch(
$_GET['act']){
/////////////////
default:
if (!
file_exists($mf)){            print'<img src = "menu.gif" alt="" /> <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=start">Создать город</a><br/>';}
                    print
'<img src = "menu.gif" alt="" /> <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">Удалить Обьект</a><br/>';
                    print
'<img src = "menu.gif" alt="" /> <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">Добавить Обьект</a><br/>';
break;        
//////////////////
    
case 'start':
        if(
file_exists($mf)){print '<div class="warning">Город уже создан!<br/>Нажав кнопку "создать" вернутся стандартные постройки города!</div>';}
        print 
'<form action = "menu.php?log='.$log.'&amp;pas='.$pas.'&act=startact" method="post">
            Продолжить?<br/>
            <input type = "hidden" name ="h" value="ok" />
            <input type = "submit" value="Создать" /></form>'
;
        break;
//====================================
case 'startact':
    if(!empty(
$_POST['h'])){
        
$text "2^|^0^|^[Телепорт]^|^gk.php?^|^^|^n";
        
$fp = @fopen($mf,"w");
        
chmod($mf,0666);
        if(
fwrite($fp,$text)){print '<div class="done">Город создан успешно!</div>';}else{print '<div class="error">Город не создан!</div>';}
        
fclose($fp);}
        print 
'&lt; <a href="office.php?log='.$log.'&amp;pas='.$pas.'">назад</a>';
break;
////////////////////

//====================================
case 'buildr':
$cost 10000000;
if (
$udata[8]<$cost){print"У ва недостаточно денег!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{
$menushka $udata[20];
$mff 'files/castle/'.$menushka.'r.dat';
$text "<? include "files/r.dat" ?>";
$fp=fopen($mff,"w");
flock ($fp,LOCK_EX);
fputs($fp,"$text");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="50000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';
$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

print 
'Рынок создан!<br />';
print 
''.$imgr.'<a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}    
break;
////////////////////
case 'change':
include_once
"files/zag.php";
    if(!
file_exists($mf)){print 'Сначала создайте город!';}else{
    
$file file($mf);
    
$c count($file);
    for(
$i=0;$i<$c;$i++){
        
$ex explode("^|^",$file[$i]);
        if(
$ex[0] == 1){$type 'Текст';}else{
                if(
$ex[0] == 2){$type 'ссылка';}else{
                        if(
$ex[0] == 3){$type 'картинка';}else{
                            if(
$ex[0] == 4){$type 'Ссылка-картинка';}}}}
                            
$u explode(".",$login);
if(
$log=="$u[0].GM"){    print'<a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add&amp;i='.$i.'">Добавить объект</a>';print'<a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change2&amp;i='.$i.'">';    }    print '<br/>'.$type.' ( '.iconv_substr($ex[2],0,15,"utf-8").')';if($log=="$u[0].GM"){print'</a>';}print' [ <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=del&amp;i='.$i.'"><b>del</b></a> ]<br />';}
if(
$log=="$u[0].GM"){        if($i!=0){print '<div class="a'.chet($i).'"> <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add&amp;i='.$i.'">Добавить объект</a></div>';}}
        }
        break;

//======================
    
case 'change2';
    
$i $_GET['i'];
    
$file file($mf);
    
$str $file[$i];
    if(empty(
$str)){print '<div class="error">Объект не найден!</div>';}else{
    
$str str_replace("n",'',$str);
    
$ex explode("^|^",$str);
    
$ccount($ex);
    if(
$c<4){print '<div class="error">Объект не найден!</div>';}else{
    if(
$ex[0] == 1){$type 'Текст';}else{
                if(
$ex[0] == 2){$type 'ссылка';}else{
                        if(
$ex[0] == 3){$type 'картинка';}else{
                            if(
$ex[0] == 4){$type 'Ссылка-картинка';}}}}
            if(
$ex[1]==1){$chek='CHECKED';}            
                    
    print 
'<form action="menu.php?log='.$log.'&amp;pas='.$pas.'&act=changeact" method="post" />
        Тип объекта:<br/>
            <select name = "type">
            <option value = "'
.$ex[0].'" SELECTED >'.$type.'</option> 
            <option value = "1">Текст</option>
            <option value = "2">Телепорт</option>
            <option value = "3">Картинка</option>
            <option value = "4">Ссылка-картинка</option></select><br/>
        <input type = "checkbox" name="chek" '
.$chek.' />Значек меню<br/>
            Путь<br/>
            <select name = "text">
            <option value = "Телепорт">Телепорт</option>
            <option value = "Магазин">Магазин</option>
            <option value = "Храм">Храм</option>
            <option value = "Гильдия">Гильдия</option>
            <option value = "Магазин вещей">Магазин вещей</option>
            <option value = "Хижина">Хижина</option>
            <option value = "Банк">Банк</option>
            <option value = "Склад">Склад</option></select><br/>
            Адрес<br/>
            <input name ="fact" value="'
.$ex[3].'" /><br/>
            Адрес картинки<br/>
            <input name="im" value="'
.$ex[4].'" /><br/>
        <input type = "hidden" name = "i" value="'
.$i.'" />
            <input type ="submit" value="Изменить" /></form>'
;}}
            
                
    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
    break;
//======================

    
case 'changeact':
        if(!empty(
$_POST['type'])){
            
$chek $_POST['chek'];
            if(
$chek == 'on'){$chek '1';}
            
$i $_POST['i'];
            
$type $_POST['type']; $type trim(stripslashes(htmlspecialchars($type)));
            
$text $_POST['text']; $text trim(stripslashes(htmlspecialchars($text)));
            
$fact $_POST['fact'];    $vid trim(stripslashes(htmlspecialchars($fact)));
            
$im $_POST['im'];    $im trim(stripslashes(htmlspecialchars($im)));
            
        
$file file($mf);
        
$file[$i] = "$type^|^$chek^|^$text^|^$fact^|^$imn";
        
$fp fopen($mf,"w");
        if(
fwrite($fp,implode("",$file))){print '<div clase="done">Успешно изменено</div>';}else{print '<div class="error">Ошибка записи</div>';}
        
fclose($fp);
    }
    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
        break;
//===================
        
case 'add':
            if(isset(
$_GET['i'])){
        
$i $_GET['i'];
        
        print 
'<div class="subtitle">Добавить на строку '.($i+1).'</div>';
        print 
'<form action="menu.php?log='.$log.'&amp;pas='.$pas.'&act=addact" method="post" />
        Тип объекта:<br/>
            <select name = "type">
            <option value = "1">Текст</option>
            <option value = "2">Ссылка</option>
            <option value = "3">Картинка</option>
            <option value = "4">Ссылка-картинка</option></select><br/>
        <input type = "checkbox" name="chek" CHECKED />Значек меню<br/>
            Текст<br/>
            <input type="text" name="text" value="" /><br/>
            Адрес<br/>
            <input name ="fact" value="" /><br/>
            Адрес картинки<br/>
            <input name="im" value="" /><br/>
        <input type = "hidden" name = "i" value="'
.$i.'" />
            <input type ="submit" value="Изменить" /></form>'
;
        }
print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
        break;
//=======================
    
case 'addact':
        
            if(!empty(
$_POST['type'])){
            
$chek $_POST['chek'];
            if(
$chek == 'on'){$chek '1';}
            
$i $_POST['i'];
            
$type $_POST['type']; $type trim(stripslashes(htmlspecialchars($type)));
            
$text $_POST['text']; $text trim(stripslashes(htmlspecialchars($text)));
            
$fact $_POST['fact'];    $vid trim(stripslashes(htmlspecialchars($fact)));
            
$im $_POST['im'];    $im trim(stripslashes(htmlspecialchars($im)));
            
        
$file file($mf);
        
$c count($file);
        
$do $file[$i];
        
$do str_replace("n",'',$do);
        
$do str_replace("r",'',$do);
        if(
$i!=$c){

        
$file[$i] = "$type^|^$chek^|^$text^|^$fact^|^$imn$don";}else{
        
$file[$i] = "$type^|^$chek^|^$text^|^$fact^|^$imn$do";}
        
$fp fopen($mf,"w");
        if(
fwrite($fp,implode("",$file))){print '<div clase="done">Успешно добавленно</div>';}else{print '<div class="error">Ошибка записи</div>';}
        
fclose($fp);
    }
    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';    
    break;
//=========================

    
case 'del':
        if(isset(
$_GET['i'])){
            
$i $_GET['i'];
            print 
'<div class="warning">Удалить объект?</div>';
            print 
'<div class="selectdown"><a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=delact&amp;i='.$i.'">ДА!</div>';
    }
    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
        break;
//========================

        
case 'delact':
            
            if(isset(
$_GET['i'])){
                
$i $_GET['i'];
                
$file file($mf);
                unset(
$file[$i]);
                
$fp fopen($mf,"w");
                if(
fwrite($fp,implode("",$file))){print '<div class="done">Успешно удалено</div>';}else{print '<div class="error">Ошибка записи</div>';}
                
fclose($fp);}
    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
                    break;
//=========================
//===================
        
case 'add2':
        
print
'ЦЕНА КАЖДОЙ ПОСТРОЙКИ 10.000.000 АДЕН!</b><br /><Form><Input Type="hidden" Name="select value">
 <Select Name="sel" Size="1" OnChange="top.location.href = this.options[this.selectedIndex].value;">
            <Option selected value=#>Выбери обьект</Option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addteleport">Телепорт</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addshop">Магазин</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addhram">Храм</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addguild">Гильдия</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addshop2">Магазин вещей</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addhome">Хижина</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addbank">Банк</option>
            <option value = "menu.php?log='
.$log.'&pas='.$pas.'&act=addsklad">Склад</option>
            </select><br/>
</Select></Form>
'
;
print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=change">назад</a>';
        break;
//=======================
    
case 'addteleport':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{
$text="2^|^1^|^[Телепорт]^|^gk.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

print 
'<div clase="done">Телепорт Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================


//=======================
    
case 'addshop':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Магазин^|^weaponandarmor.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Магазин Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addhram':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Храм^|^hram.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);

fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

print 
'<div clase="done">Храм Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addguild':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Гильдия^|^guild.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Гильдия Успешно добавленa<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addshop2':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Магазин вещей^|^by.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Магазин вещей Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addhome':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Хижина^|^home.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Хижина Успешно добавленa<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addbank':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Банк^|^bank.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Банк Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

//=======================
    
case 'addsklad':
$cost 10000000;
if (
$udata[8]<$cost){print"НЕ ХВАТАЕТ ДЕНЕГ!!!";
print 
'<div class="back">&lt; <a href="togorod.php?log='.$log.'&amp;pas='.$pas.'&gorod='.$udata[20].'">назад</a>';}
else{

$text="2^|^1^|^Склад^|^sklad.php?^|^";

$fp=fopen($mf,"a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("data/reg/$log.dat"); 
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$uda="10000000";
$aden=$aden-$uda;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 


print 
'<div clase="done">Склад Успешно добавлен<br />У вас осталось '.$udata[8].'аден</div>';

    print 
'<div class="back">&lt; <a href="menu.php?log='.$log.'&amp;pas='.$pas.'&act=add2">назад</a>';    }
    break;
//=========================

}
}}
else{echo
"&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!";}

include_once
"files/down.php";
?>
Онлайн: 3
Реклама