Файл: empire/install.php
Строк: 127
<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Мой сайт';
include_once '../sys/inc/thead.php';
title();
err();
aut();
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `empire` WHERE `id_u`='".$user['id']."'"),0)==''){
mysql_query("CREATE TABLE IF NOT EXISTS `empire` (
`id` int(11) NOT NULL auto_increment,
`id_u` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`narod` int(11) NOT NULL default '10',
`eda` int(11) NOT NULL default '10',
`derevo` int(11) NOT NULL default '10',
`gelezo` int(11) NOT NULL default '10',
`zoloto` int(11) NOT NULL default '100',
`push` int(11) NOT NULL,
`vek` int(11) NOT NULL default '1',
`time_h` int(11) NOT NULL,
`time_nap` int(11) NOT NULL,
`narod_abs` int(11) NOT NULL default '0',
`dr_l` int(11) NOT NULL default '0',
`eda_l` int(11) NOT NULL default '0',
`gelezo_l` int(11) NOT NULL default '0',
`zoloto_l` int(11) NOT NULL default '0',
`r_l` int(11) NOT NULL default '0',
`voin` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("CREATE TABLE IF NOT EXISTS `empire_stroi` (
`id` int(11) NOT NULL auto_increment,
`id_u` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`narod` int(11) NOT NULL,
`eda` int(11) NOT NULL,
`derevo` int(11) NOT NULL,
`gelezo` int(11) NOT NULL,
`zoloto` int(11) NOT NULL,
`voin` int(11) NOT NULL,
`push` int(11) NOT NULL,
`vek` int(11) NOT NULL,
`time_h` int(11) NOT NULL,
`time_r` int(11) NOT NULL,
`cena` int(11) NOT NULL,
PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
mysql_query("
CREATE TABLE IF NOT EXISTS `empire_zdan` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`eda` int(11) NOT NULL,
`derevo` int(11) NOT NULL,
`gelezo` int(11) NOT NULL,
`zoloto` int(11) NOT NULL,
`vek` int(11) NOT NULL,
`eda_abs` int(11) NOT NULL,
`derevo_abs` int(11) NOT NULL,
`gelezo_abs` int(11) NOT NULL,
`zoloto_abs` int(11) NOT NULL,
`time_h` int(11) NOT NULL,
`voin` int(11) NOT NULL,
`push` int(11) NOT NULL,
PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; ");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`) VALUES('Мельница', '2', '0', '0', '0', '1', '7', '3', '0', '1', '3600')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`) VALUES('Шахта(золото)', '0', '0', '0', '2', '1', '4', '3', '1', '1', '3600')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`) VALUES('Шахта(железо)', '0', '0', '2', '0', '1', '4', '3', '1', '1', '3600')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`) VALUES('Лесоповал', '0', '2', '0', '0', '1', '4', '3', '1', '1', '3600')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`) VALUES('Склад', '7', '7', '7', '9', '2', '15', '14', '3', '9', '7200')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`, `voin`) VALUES('Казарма', '0', '0', '0', '0', '2', '600', '600', '650', '700', '8000', '10')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`, `push`) VALUES('Артиллерийское депо', '0', '0', '0', '0', '2', '600', '600', '650', '700', '12000', '3')");
mysql_query("INSERT INTO `empire_zdan`(`name`, `eda`, `derevo`, `gelezo`, `zoloto`, `vek`, `eda_abs`, `derevo_abs`, `gelezo_abs`, `zoloto_abs`, `time_h`, `voin`, `push`) VALUES('Казарма III века', '0', '0', '0', '0', '3', '1200', '1500', '1850', '1000', '10000', '10', '10')");
}
mysql_query("
DROP TABLE IF NOT EXISTS `empire_obmen` (
`id` int(11) NOT NULL default'1',
`eda` int(11) NOT NULL,
`derevo` int(11) NOT NULL,
`gelezo` int(11) NOT NULL,
`zoloto` int(11) NOT NULL,
PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; ");
mysql_query("ALTER TABLE `empire` ADD `win`INT(11) NOT NULL");
mysql_query("ALTER TABLE `empire` ADD `lose`INT(11) NOT NULL");
header("Location:index.php");
include_once '../sys/inc/tfoot.php';
?>