Файл: world-faces.ru/world-faces.ru/fermer/shop_udobr.php
Строк: 41
<?php
include_once '../i.php';
$set['title']='Моя ферма!';
verh();
err();
aut();
if(mysql_result(mysql_query("SELECT count(id) FROM `my_apps` where `id_us` = '".$us['id']."' and `id_app` = '1'"),0)==0){
pdo();
$app = DB::$dbs->queryFetch("SELECT * FROM `apps` where `id` = ? limit 1",array(1));
function ret($type){
$type = str_replace('И','и',$type);
$type = str_replace('а','ы',$type);
$type = str_replace('П','п',$type);
$type = str_replace('ие','ия',$type);
return $type;
}
echo '<div class="title" align="center">Запуск '.ret($app['type']).' | <a href="/play">закрыть</a></div>';
echo '<div class="prof"><img src="'.$app['img'].'" align="middle" alt="'.$app['name'].'"/><b>'.$app['name'].'</b><br/>'.$app['opis'].'</div>';
echo '<div class="app">Запустили уже <b>'.DB::$dbs->querySingle("SELECT count(id) FROM `my_apps` where `id_app` = '1'").'</b> человек! <a href="?add"><input type="submit" value="Запустить '.$app['name'].'!"/></a></div>';
if(isset($_GET['add'])){
DB::$dbs->query("INSERT INTO `my_apps` set `id_us` = ?, `id_app` = ?",array($us['id'],1));
$text = 'запустил'.(($us['pol']==0)?'а':'').' приложение <b>[url='.$app['src'].']"'.$app['name'].'"[/url]</b>!';
DB::$dbs->query("INSERT INTO `lenta_saita` set `user` = ?, `time` = ?,`action` = ?",array($us['nick'],time(),$text));
header('location:'.$app['src'].'');
}
niz(); exit;
}
$buy_ok = (isset($_GET['buy_ok'])) ? $_GET['buy_ok'] : NULL;
$buy_no = (isset($_GET['buy_no'])) ? $_GET['buy_no'] : NULL;
$id = (isset($_GET['id'])) ? $_GET['id'] : NULL;
if(isset($buy_ok))msg('Куплено!');
if(isset($buy_no))echo "<div class='err'>Не хватает денег!</div>";
aut();
echo '<center><img src="/fermer/img/shop.gif" /> </center>';
include 'inc/str.php';
if(isset($id)){
include 'inc/shop_udobr_info.php';
}else{
include 'inc/shop_udobr_index.php';
}
echo "<div class='foot'>";
if(isset($id))echo "» <a href='shop.php'>Магазин семян</a><br/>";
echo "» <a href='my.php'>Моя ферма</a><br/>";
echo "« <a href='index.php'>Назад</a><br/>";
echo "</div>";
include_once '../sys/inc/tfoot.php';
?>