View file games/bazar.php

File size: 8.33Kb
<?php
require_once"../template/start.php";require_once"../template/regglobals.php";require_once"../template/config.php";require_once"../template/siti_conf.php";require_once"../template/functions.php";require_once"../template/antidos.php";require_once"../template/cookies.php";require_once"../template/gzip.php";require_once"../template/header.php";require_once"../template/referer.php";include_once"../themes/$config_themes/index.php";include_once"../template/isset.php";if($gorod_otk==0){echo'<font color="#FF0000"><big><b>Доступ в город закрыт АДМИНИСТРАТОРОМ!</font></big></b><hr>';echo'<br><a href="../index.php?'.SID.'">На главную</a><br>';require_once"../../themes/$config_themes/foot.php";exit;}if(file_exists("lic.php")){echo'';}else{echo'<font color="#FF0000"><big><b>Отсутствуй файл с лицензионным соглашением!</font></big></b><hr>';echo'<br><a href="../index.php?'.SID.'">На главную</a><br>';require_once"../../themes/$config_themes/foot.php";exit;}$ryb=trim($udata[105]);$ohota=trim($udata[106]);$time=time();$time_otkup=round($udata[105]-$time);$time_ot=round($udata[106]-$time);$siti_st = file(BASEDIR."local/navigator/conf/bazar.dat"); $siti_b = explode("|",$siti_st[0]);if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!="") {if(empty($action)){echo'<div class=tpanel>Здарова, '.$log.'! ';echo'У тебя есть '.$udata[41].' монет. ';if($deist==1){if(isset($a1)){echo'<hr><font color="lightgreen">Продано</font><hr>';}}if($ryb<$time){ if($ohota<$time){$lines=file("../local/eda/$log.eda");$dt=explode("|",$lines[0]);echo'У тебя '.$dt[2].' % здоровья</div>';if($dt[4]!=""){echo '<a href="bazar.php?action=prod&amp;ulov=1&amp;'.SID.'">Продать '.$dt[4].' за '.$dt[6].' монет</a><br>';}if($dt[7]!=""){echo '<a href="bazar.php?action=prod&amp;ulov=2&amp;'.SID.'">Продать '.$dt[7].' за '.$dt[9].' монет</a><br>';}}else{echo '<b>Продать сможешь живность через '.formattime($time_ot).'</b><br>';}}else{echo '<b>Продать рыбку сможешь через '.formattime($time_otkup).'</b><br>';}if($udata[41]<10 and $udata[41]>0){echo '<hr> У вас слишком мало денег, чтобы что-то купить.';}else{echo '<div class=body>';$siti_b1=round($siti_b[1]/$siti_b[39]); echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[1].'&amp;'.SID.'">'.$siti_b[0].'-><a> '.$siti_b[1].' $ Здopoвьe: <font color="red">'.$siti_b1.'%</font><br>';$siti_b2=round($siti_b[4]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[4].'&amp;'.SID.'">'.$siti_b[3].'-><a> '.$siti_b[4].' $ Здopoвьe: <font color="red">'.$siti_b2.'%</font><br>';$siti_b3=round($siti_b[7]/$siti_b[39]); echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[7].'&amp;'.SID.'">'.$siti_b[6].'-><a> '.$siti_b[7].' $ Здopoвьe: <font color="red">'.$siti_b3.'%</font><br>';$siti_b4=round($siti_b[10]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[10].'&amp;'.SID.'">'.$siti_b[9].'-><a> '.$siti_b[10].' $ Здopoвьe: <font color="red">'.$siti_b4.'%</font><br>';$siti_b5=round($siti_b[13]/$siti_b[39]); echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[13].'&amp;'.SID.'">'.$siti_b[12].'-><a> '.$siti_b[13].' $ Здopoвьe: <font color="red">'.$siti_b5.'%</font><br>';$siti_b6=round($siti_b[16]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[16].'&amp;'.SID.'">'.$siti_b[15].'-><a> '.$siti_b[16].' $ Здopoвьe: <font color="red">'.$siti_b6.'%</font><br>';$siti_b7=round($siti_b[19]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[19].'&amp;'.SID.'">'.$siti_b[18].'-><a> '.$siti_b[19].' $ Здopoвьe: <font color="red">'.$siti_b7.'%</font><br>';$siti_b8=round($siti_b[22]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[22].'&amp;'.SID.'">'.$siti_b[21].'-><a> '.$siti_b[22].' $ Здopoвьe: <font color="red">'.$siti_b8.'%</font><br>';$siti_b9=round($siti_b[25]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[25].'&amp;'.SID.'">'.$siti_b[24].'-><a> '.$siti_b[25].' $ Здopoвьe: <font color="red">'.$siti_b9.'%</font><br>';$siti_b10=round($siti_b[28]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[28].'&amp;'.SID.'">'.$siti_b[27].'-><a> '.$siti_b[28].' $ Здopoвьe: <font color="red">'.$siti_b10.'%</font><br>';$siti_b11=round($siti_b[31]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[31].'&amp;'.SID.'">'.$siti_b[30].'-><a> '.$siti_b[31].' $ Здopoвьe: <font color="red">'.$siti_b11.'%</font><br>';$siti_b12=round($siti_b[34]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[34].'&amp;'.SID.'">'.$siti_b[33].'-><a> '.$siti_b[34].' $ Здopoвьe: <font color="red">'.$siti_b12.'%</font><br>';$siti_b13=round($siti_b[37]/$siti_b[39]);echo'&#187; <a href="bazar.php?action=pokupka&amp;pr='.$siti_b[37].'&amp;'.SID.'">'.$siti_b[36].'-><a> '.$siti_b[37].' $ Здopoвьe: <font color="red">'.$siti_b13.'%</font><br>';}}if($action=="prod"){$lines=file("../local/eda/$log.eda");$dt=explode("|",$lines[0]);$ufile = file(BASEDIR."local/profil/$log.prof"); $udata = explode(":||:",$ufile[0]);if($ulov==1){$udata[41]=round($udata[41]+$dt[6]);$dt[4]="2 лягушки";$dt[5]="200";$dt[6]="0";$dt[10]="0";}if($ulov==2){$udata[41]=round($udata[41]+$dt[9]);$dt[7]="2 лягушки";$dt[8]="200";$dt[9]="0";$dt[11]="0";}for ($u=0; $u<$config_userprofkey; $u++){$utext.=$udata[$u].':||:';}if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){$fp=fopen(BASEDIR."local/profil/$log.prof","a+"); flock ($fp,LOCK_EX); ftruncate ($fp,0); fputs($fp,$utext);fflush ($fp);flock ($fp,LOCK_UN);fclose($fp); unset($utext); }$text="|$dt[1]|$dt[2]|$dt[3]|$dt[4]|$dt[5]|$dt[6]|$dt[7]|$dt[8]|$dt[9]|$dt[10]|$dt[11]|$dt[12]|$dt[13]|$dt[14]|$dt[15]|$dt[16]|$dt[17]|$dt[18]|$dt[19]|$dt[20]";$text=stripslashes($text);$fp=fopen("../local/eda/$log.eda","a+");flock ($fp,LOCK_EX);ftruncate($fp,0);fputs($fp,"$text");fflush ($fp);flock ($fp,LOCK_UN);fclose($fp);chmod ("../local/eda/$log.eda", 0666);header ("location: bazar.php?deist=1&a1&");}if($action=="pokupka"){ if($udata[41]<=$pr){echo'Нет у тебя столько денег! Купи чё-нить подешевле или проваливай.<br>';}else{$ufile = file(BASEDIR."local/profil/$log.prof"); $udata = explode(":||:",$ufile[0]);$udata[41]=round($udata[41]-$pr);for ($u=0; $u<$config_userprofkey; $u++){$utext.=$udata[$u].':||:';}if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){$fp=fopen(BASEDIR."local/profil/$log.prof","a+"); flock ($fp,LOCK_EX); ftruncate ($fp,0); fputs($fp,$utext);fflush ($fp);flock ($fp,LOCK_UN);fclose($fp); unset($utext); }$lines=file("../local/eda/$log.eda");$dt=explode("|",$lines[0]);$dt[12]=$st[12]+$pr;$text="|$dt[1]|$dt[2]|$dt[3]|$dt[4]|$dt[5]|$dt[6]|$dt[7]|$dt[8]|$dt[9]|$dt[10]|$dt[11]|$dt[12]|$dt[13]|$dt[14]|$dt[15]|$dt[16]|$dt[17]|$dt[18]|$dt[19]|$dt[20]";$text=stripslashes($text);$fp=fopen("../local/eda/$log.eda","a+");flock ($fp,LOCK_EX);ftruncate($fp,0);fputs($fp,"$text");fflush ($fp);flock ($fp,LOCK_UN);fclose($fp);chmod ("../local/eda/$log.eda", 0666);$fish=round($pr/$siti_b[39]);echo'<a href="bazar.php?action=eda&amp;'.SID.'">Может сразу слопать? ('.$fish.' здоровья)</a><br>';}}if($action=="eda"){$lines=file("../local/eda/$log.eda");$dt=explode("|",$lines[0]);$fish=round($dt[12]/$siti_b[39]);$dt[2]=$dt[2]+$fish;if($dt[2]>100){$dt[2]="100";}$fish="0";$text="|$log|$dt[2]|$dt[3]|$dt[4]|$dt[5]|$dt[6]|$dt[7]|$dt[8]|$dt[9]|$dt[10]|$dt[11]|$fish|$dt[13]|$dt[14]|$dt[15]|$dt[16]|$dt[17]|$dt[18]|$dt[19]|$dt[20]";$text=stripslashes($text);$fp=fopen("../local/eda/$log.eda","a+");flock ($fp,LOCK_EX);ftruncate($fp,0);fputs($fp,"$text");fflush ($fp);flock ($fp,LOCK_UN);fclose($fp);chmod ("../local/eda/$log.eda", 0666);echo'<a href="bazar.php">Удачно! Купить еще?</a><br>';}}

else{sleep(1); header("location:../pages/vhod.php"); exit();}

echo'</div><div class="btm">&#187; <a href="index.php?'.SID.'">В город</a><br>';
echo'&#187; <a href="../pages/player.php?">В анкету</a><br>';
echo'&#187; <a href="../index.php?'.SID.'">На главную</a></div>';

include_once "../themes/$config_themes/foot.php";
?>