本文整理汇总了PHP中get_row函数的典型用法代码示例。如果您正苦于以下问题:PHP get_row函数的具体用法?PHP get_row怎么用?PHP get_row使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_row函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit_action
function edit_action($id)
{
$row = get_row($id);
$rows = get_all_rows();
$html = render_template("view/edit.php", array('row' => $row, 'rows' => $rows));
return $html;
}
开发者ID:deniya,项目名称:mysite,代码行数:7,代码来源:controller.php
示例2: read_wiki
function read_wiki() {
global $wiki_stylesheet;
global $columns;
$data=array();
$f=fopen($wiki_stylesheet, "r");
unset($this_part);
while($r=fgets($f)) {
$r=chop($r);
if(ereg("==([^=]+)==", $r, $m)) {
$mode=0;
$part=trim($m[1]);
}
if(substr($r, 0, 1)=="|") {
$this_row=get_row($r, $f);
if($this_row&&($columns[$part])) {
$src=array();
foreach($this_row as $i=>$r2) {
$src[$columns[$part][$i]]=trim($r2);
}
$data[$part][]=$src;
}
}
}
fclose($f);
return $data;
}
开发者ID:plepe,项目名称:OpenStreetBrowser,代码行数:33,代码来源:wiki_stuff.php
示例3: index
public function index()
{
$testimonials = get_row('testimonials');
echo view('head', array('css' => 'testimonials', 'class' => 'testimonials content', 'title' => $testimonials->seo_title ? $testimonials->seo_title : 'Getuigenissen', 'description' => $testimonials->seo_content ? $testimonials->seo_content : ''));
echo view('testimonials', array('testimonials' => $testimonials));
echo view('foot', array());
}
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:testimonials.php
示例4: index
public function index()
{
$services = get_row('services');
echo view('head', array('title' => $services && $services->seo_title ? $services->seo_title : 'Diensten', 'description' => $services && $services->seo_content ? $services->seo_content : ''));
echo view('services', array('services' => $services));
echo view('foot', array());
}
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:services.php
示例5: quest_end
public function quest_end($config, $player)
{
$quest = (int) $quest;
if ($player->in_quest != 0) {
$quest = get_row("select * , unix_timestamp() as tnow from quests where q_id = " . $player->in_quest);
if ($quest->tnow >= $player->in_quest_time) {
$text = '';
if ($quest->q_exp > 0) {
$exp = floor($quest->q_exp * ($player->lvl + 1) * 1.77);
call("update users set in_quest = 0,in_quest_time = 0, exp = exp + " . $exp . " where usr_id = " . $player->usr_id);
call("update users set skills = skills + 1, exp = exp - exp_lvl, exp_lvl = exp_lvl * 1.45, lvl = lvl + 1 where exp >= exp_lvl and usr_id = " . $player->usr_id);
$text .= 'Twój heros zdobył ' . $exp . ' doświadczenia<br/>';
}
if ($quest->q_res > 0) {
$res = floor($quest->q_res * ($player->lvl + 1) * 1.77);
call("update users set in_quest = 0,in_quest_time = 0 where usr_id = " . $player->usr_id);
require_once 'functions/TownMgr.php';
$TownMgr = new TownMgr();
$TownMgr->change_resources($config, $player->actual_town, $res, $res, $res, 0);
$text .= 'Twój heros zdobył ' . $res . ' każdego z surowców<br/>';
}
require_once 'functions/MsgMgr.php';
$MsgMgr = new MsgMgr();
$MsgMgr->raport($config, $player->usr_id, $text);
}
}
}
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:27,代码来源:HeroMgr.php
示例6: show_action
function show_action($id)
{
//$id=$_REQUEST['id'];
//$sql="SELECT * FROM `pages` WHERE `id`=$id";
//$row=get_all_rows($sql);
$rows = get_row($id);
$html = render_template("View/show.php", array('rows' => $rows));
return $html;
}
开发者ID:Olikainen,项目名称:mysite,代码行数:9,代码来源:controller.php
示例7: event_stop
public function event_stop($config, $event, $town)
{
$town = (int) $town;
$event = (int) $event;
$event_data = get_row("select e_type, e_end - unix_timestamp() as etime from events where e_done = 0 and e_id = {$event} and e_t_id = {$town}");
call("\n\t\tupdate events set e_done = 1 \n\t\twhere e_done = 0 and e_id = {$event} and e_t_id = {$town}\n\t\t");
if (!empty($event_data)) {
call("\n\t\t\tupdate events set e_start = e_start - {$event_data->etime},\n\t\t\te_end = e_end - {$event_data->etime}\n\t\t\twhere e_done = 0 and e_t_id = {$town} and e_type = {$event_data->e_type}\n\t\t\tand e_id > {$event}\n\t\t\t");
}
}
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:10,代码来源:EventsMgr.php
示例8: index
public function index()
{
$home = get_row('home');
$sale = where('sold = 0 && purpose = 1')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
$rent = where('sold = 0 && purpose = 2')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
$projects = where('sold = 0 && type = 3')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
echo view('head', array('class' => 'home', 'css' => 'home', 'title' => $home->seo_title ? $home->seo_title : $home->title, 'description' => $home->seo_content ? $home->seo_content : $home->content));
echo view('home', array('home' => $home, 'sale' => $sale, 'rent' => $rent, 'projects' => $projects));
echo view('foot', array('js' => 'home'));
}
开发者ID:kidaa30,项目名称:Swevers,代码行数:10,代码来源:home.php
示例9: caravan_send
public function caravan_send($config, $player, $town, $wood, $stone, $iron)
{
$town = textV($town);
$wood = (int) $wood;
$stone = (int) $stone;
$iron = (int) $iron;
if ($wood + $stone + $iron < 1) {
$msg = 'wyślij minimum 1 sztukę jakiegoś surowca';
} elseif ($player->clan_id == 0) {
$msg = 'nie jesteś w klanie, karawany można wysyłać tylko do sojuszników w swoim klanie';
} elseif ($player->town->t_wood < $wood || $player->town->t_stone < $stone || $player->town->t_iron < $iron) {
$msg = 'nie posiadasz tyle surowców';
} else {
$can = get_row($q = "select clan_id, t_id from users inner join towns on t_usr_id = usr_id where t_name = '" . $town . "' limit 1");
if (empty($can)) {
$msg = 'takie miasto nie istnieje';
} elseif ($can->clan_id != $player->clan_id) {
$msg = 'te miasto nie jest w tym samym klanie co ty';
} else {
$event_check = get_one("select count(*) from events where (e_type = 20 or e_type = 21) and e_done = 0 and e_t_id = " . $player->actual_town);
if ($event_check > 9) {
$msg = 'masz już maksymalną ilość karawan w podróży';
} else {
$market_lvl = get_one("select go_lvl from game_objects where go_type = 1 and go_subtype = 6 and go_t_id = " . $player->actual_town);
if (empty($market_lvl)) {
$msg = 'nie posiadasz rynku, jak chcesz wysłać karawanę??';
} elseif ($market_lvl <= $event_check) {
$msg = 'masz już maksymalną ilość karawan w podróży';
} else {
$y = get_row("select * from map where m_t_id =" . $can->t_id);
$x = get_row("select * from map where m_t_id =" . $player->actual_town);
if ($x->m_x != $y->m_x && $x->m_y == $y->m_y) {
$range = abs($y->m_x - $x->m_x) * 300;
} elseif ($x->m_x == $y->m_x && $x->m_y != $y->m_y) {
$range = abs($y->m_y - $x->m_y) * 300;
} else {
$range = floor(sqrt(pow(abs($y->m_x - $x->m_x), 2) + pow(abs($y->m_y - $x->m_y), 2))) * 300;
}
call("insert into caravan(ca_from, ca_to, ca_wood, ca_stone, ca_iron)\n\t\t\t\t\t\t\tvalue(" . $player->actual_town . "," . $can->t_id . "," . $wood . "," . $stone . "," . $iron . ")");
$ca = get_row("select last_insert_id() as ca, unix_timestamp() as estart");
require_once 'functions/TownMgr.php';
$TownMgr = new TownMgr();
$TownMgr->change_resources($config, $player->actual_town, -$wood, -$stone, -$iron, 0);
require_once 'functions/EventsMgr.php';
$EventMgr = new EventsMgr();
$EventMgr->event_add($config, $player->actual_town, 20, $can->t_id, $ca->ca, 0, $ca->estart, $ca->estart + $range, 0);
$msg = 'wysłano karawanę do miasta ' . $town;
}
}
}
}
return $msg;
}
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:53,代码来源:MarketMgr.php
示例10: summa
function summa($type)
{
$total_in = gmp_init('0');
$query = "\n SELECT SUM(amount) AS sum\n FROM purses\n WHERE type='{$type}'\n ";
$result = do_query($query);
$row = get_row($result);
$v = gmp_init($row['sum']);
$total_in = gmp_add($total_in, $v);
$query = "\n SELECT SUM(amount) AS sum\n FROM orderbook\n WHERE type='{$type}' AND status='OPEN'\n ";
$result = do_query($query);
$row = get_row($result);
if (isset($row['sum'])) {
$v = gmp_init($row['sum']);
$total_in = gmp_add($total_in, $v);
}
$query = "\n SELECT SUM(amount) AS sum\n FROM requests\n WHERE curr_type='{$type}' AND req_type='WITHDR' AND status='VERIFY'\n ";
$result = do_query($query);
$row = get_row($result);
if (isset($row['sum'])) {
$v = gmp_init($row['sum']);
$total_in = gmp_add($total_in, $v);
}
$total_in = gmp_strval($total_in);
$total_out = gmp_init('0');
$query = "\n SELECT SUM(amount) AS sum\n FROM requests\n WHERE curr_type='{$type}' AND req_type='DEPOS' AND status='FINAL'\n ";
$result = do_query($query);
$row = get_row($result);
if (isset($row['sum'])) {
$v = gmp_init($row['sum']);
$total_out = gmp_add($total_out, $v);
}
$query = "\n SELECT SUM(amount) AS sum\n FROM requests\n WHERE curr_type='{$type}' AND req_type='WITHDR' AND status='FINAL'\n ";
$result = do_query($query);
$row = get_row($result);
if (isset($row['sum'])) {
$v = gmp_init($row['sum']);
$total_out = gmp_sub($total_out, $v);
}
$total_out = gmp_strval($total_out);
echo "{$type} = {$total_in}\t {$total_out}\n";
if (gmp_cmp($total_in, $total_out) != 0) {
echo "*********** MISMATCH ****************\n";
}
}
开发者ID:martinkirov,项目名称:intersango,代码行数:44,代码来源:summa.php
示例11: login
public function login($config, $login, $pass)
{
$msg = '';
$login = textV($login);
$pass = sha1(md5(textV($pass)));
$user = get_row("select * from users where login = '" . $login . "' and pass = '" . $pass . "' limit 1");
if (!empty($user)) {
if ($user->banned == 1) {
$msg = 'gracz zbanowany';
} elseif (is_numeric($user->usr_id) && $user->usr_id > 0) {
$_SESSION = array();
$_SESSION['user'] = $user->usr_id;
reload($config, 'town', '');
} else {
$msg = 'nieoczekiwany błąd';
}
} else {
$msg = 'Wprowadzono błędne dane ';
}
return $msg;
}
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:21,代码来源:RegisterMgr.php
示例12: register
public function register($config, $login, $pass, $mail)
{
$login = textV($login);
$pass = textV($pass);
$mail = textV($mail);
if (strlen($login) < 5) {
$msg .= ' login za krótki [5-15 znaków] <br/>';
} elseif (strlen($login) > 15) {
$msg .= ' login za długi [5-15 znaków] <br/>';
}
if (strlen($pass) < 5) {
$msg .= ' hasło za krótkie [5-15 znaków] <br/>';
} elseif (strlen($pass) > 15) {
$msg .= ' hasło za długie [5-15 znaków] <br/>';
}
if (empty($msg)) {
$msg = "Błąd <br/>";
$query = "\n\t\t\t\tselect login as e_login, email as e_email\n\t\t\t\tfrom arena_users where email='" . $mail . "' or login = '" . $login . "'\n\t\t\t";
$info = get_row($query);
$users_count = get_one("select count(*) from arena_users");
if ($users_count < 500) {
if (empty($info->e_login) && empty($info->e_email)) {
call("\n\t\t\t\t\tinsert into arena_users (login, pass, email, last_inc)\n\t\t\t\t\tvalue ('" . $login . "','" . md5($pass) . "','" . $mail . "', unix_timestamp())\n\t\t\t\t\t");
$msg = "Poprawnie zarejestowano użytkownika " . $login;
} else {
if (!empty($info->e_login)) {
$msg .= " login zajęty <br/>";
}
if (!empty($info->e_email)) {
$msg .= " email zajęty <br/>";
}
}
} else {
$msg = 'limit graczy';
}
} else {
$msg = "Błąd <br/>" . $msg;
}
return $msg;
}
开发者ID:WlasnaGra,项目名称:Arena,代码行数:40,代码来源:RegisterMgr.php
示例13: Get_table_view
function Get_table_view($table, $extra = null, $extraLink = null, $notIMPCol = null, $DefaultOpotion_LINK_display = null, $topLink = null)
{
global $db;
if ($DefaultOpotion_LINK_display == null) {
$DefaultOpotion_LINK_display = null;
}
if ($notIMPCol == null) {
$notIMPCol = array();
}
$columns = $db->get_results("SHOW FULL COLUMNS FROM {$table}");
$ColCount = count($columns);
if (isset($_GET['Col'])) {
$connectQuery = "WHERE " . $_GET['Col'] . "=" . $_GET['Colid'];
} else {
$connectQuery = '';
}
$tags = $db->get_results("SELECT * FROM {$table} {$connectQuery}");
$tableCol = $db->get_row("SHOW FULL COLUMNS FROM {$table}");
$tableColumn = $tableCol->Field;
//echo GetCount('Tag','WebsiteID');
if ($tags) {
?>
<div class="box-header">
<?php
if ($DefaultOpotion_LINK_display == null && $topLink == null) {
?>
<?php
echo LoadTOPMenuLink();
} elseif ($table == 'Website') {
echo LoadTOPMenuLink();
} elseif ($table == 'Tag') {
echo LoadTOPMenuLink();
}
?>
<h3 class="box-title"><?php
echo $table;
?>
</h3>
</div><!-- /.box-header -->
<div class="box-body table-responsive">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<?php
$dir = $_SERVER['DOCUMENT_ROOT'] . '/admin/seo_images/' . $table . '/';
$no = '';
foreach ($columns as $col) {
$no += 1;
if (in_array($col->Field, $notIMPCol)) {
} else {
$pos = strpos($col->Field, "_t");
//$id = strpos($col->Field, "_id");
//$count= GetCount('Tag',$col->Field);
if ($tableColumn == $col->Field) {
$colName = $col->Comment;
$colName = explode('|', $colName);
$colName = $colName[0];
echo '<th>' . $colName . '</th>';
}
if ($pos) {
$colName = $col->Comment;
$colName = explode('|', $colName);
$colName = $colName[0];
echo '<th>' . $colName . '</th>';
}
if ($no == 3) {
if (is_dir($dir)) {
echo '<th> Image</th>';
} else {
// echo'<th>Not True</th>';
}
}
if ($extra != null && in_array($col->Field, $extra)) {
if ($col->Comment == '') {
$colName = $col->Field;
} else {
$colName = $col->Comment;
$colName = explode('|', $colName);
$colName = $colName[0];
}
echo '<th>' . $colName . '</th>';
}
// trace square for ggetting other tabel data.
if ($extra != null) {
foreach ($extra as $ext) {
$square = explode('[', $ext);
$realColname = $square[0];
$colEnd = end($square);
$square1 = explode(']', $colEnd);
//.........这里部分代码省略.........
开发者ID:Namrata27,项目名称:appoint_mgt,代码行数:101,代码来源:Get_table_view.php
示例14: get_random_row
<?php
if ((segment(2) == 'te-koop' || segment(2) == 'te-huur') && segment(1) == 'index') {
$background = true;
$background_image = get_random_row('home/images');
} else {
$background = false;
}
?>
<?php
$contact = get_row('contact');
define('EMAIL', $contact->email);
define('PHONE', $contact->phone);
define('STREET', $contact->address_address);
define('POSTAL', $contact->address_postal_code);
define('CITY', $contact->address_city);
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php
echo isset($title) && $title != '' ? $title . ' — ' : '';
?>
Swevers Vastgoed</title>
开发者ID:kidaa30,项目名称:Swevers,代码行数:31,代码来源:head.php
示例15: build_end
public function build_end($town, $type, $subtype, $count, $start, $end)
{
//pobierz dane obiektu
$object = get_row("\n\t\t\tselect * from game_objects_param \n\t\t\tleft join game_objects \n\t\t\ton go_t_id = " . $town . "\n\t\t\tand go_gop_id = gop_id\n\t\t\twhere gop_type = " . $type . " and gop_subtype = " . $subtype . "\n\t\t\tlimit 1\n\t\t");
//jeżeli obiektu nie ma na liście obiektów wybudowanych, to bierz pod uwagę parametry startowe
if (empty($object->go_id)) {
$object->go_lvl = 0;
}
switch ($type) {
case 1:
switch ($subtype) {
case 1:
//tartak
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update towns set t_wood_inc = t_wood_inc + 50 where t_id = {$town}");
} else {
call("update towns set t_wood_inc = t_wood_inc * 1.2 where t_id = {$town}");
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
}
break;
case 2:
//cegielnia
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update towns set t_stone_inc = t_stone_inc + 50 where t_id = {$town}");
} else {
call("update towns set t_stone_inc = t_stone_inc * 1.2 where t_id = {$town}");
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
}
break;
case 3:
//Kopalnia złota
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update towns set t_iron_inc = t_iron_inc + 50 where t_id = {$town}");
} else {
call("update towns set t_iron_inc = t_iron_inc * 1.2 where t_id = {$town}");
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
}
break;
case 4:
//młyn
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update towns set t_pop_max = t_pop_max * 1.3 where t_id = {$town}");
} else {
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
call("update towns set t_pop_max = t_pop_max * 1.3 where t_id = {$town}");
if ($object->go_lvl == 2) {
call("update town_objects set to_can = 1 where to_gop_id = 7 and to_t_id = {$town}");
}
}
break;
case 5:
//koszary
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 9 or to_gop_id = 21");
} else {
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
switch ($object->go_lvl) {
case 2:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 10");
break;
case 4:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 11 or to_gop_id = 22");
break;
case 5:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 15");
break;
case 6:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 12");
break;
case 9:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 13 or to_gop_id = 23");
break;
case 14:
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id = 14");
break;
default:
break;
}
}
break;
case 7:
//ratusz
if ($object->go_lvl == 0) {
call("\n\t\t\t\t\t\t\tinsert into game_objects (go_t_id, go_type, go_subtype, go_gop_id, go_wood, go_stone, go_iron, go_pop, go_time)\n\t\t\t\t\t\t\tvalue( {$town}, {$type}, {$subtype}, {$object->gop_id}, {$object->gop_wood} * ((100 + {$object->gop_res_inc})/100), {$object->gop_stone} * ((100 + {$object->gop_res_inc})/100), {$object->gop_iron} * ((100 + {$object->gop_res_inc})/100), {$object->gop_pop} * ((100 + {$object->gop_res_inc})/100), {$object->gop_time} * ((100 + {$object->gop_time_inc})/100))");
call("update town_objects set to_can = 1 where to_t_id = {$town} and to_gop_id >= 16 and to_gop_id <= 20");
} else {
call("\n\t\t\t\t\t\t\tupdate game_objects \n\t\t\t\t\t\t\tset go_lvl = go_lvl + 1, go_wood = go_wood * ((100 + {$object->gop_res_inc})/100), go_stone = go_stone * ((100 + {$object->gop_res_inc})/100), go_iron = go_iron * ((100 + {$object->gop_res_inc})/100), go_pop= go_pop * ((100 + {$object->gop_res_inc})/100), go_time = go_time * ((100 + {$object->gop_time_inc})/100)\n\t\t\t\t\t\t\twhere go_t_id = {$town} and go_type = {$type} and go_subtype = {$subtype}");
if ($object->go_lvl == 2) {
call("update town_objects set to_can = 1 where to_gop_id = 6 and to_t_id = {$town}");
} elseif ($object->go_lvl == 1) {
call("update town_objects set to_can = 1 where to_gop_id = 5 and to_t_id = {$town}");
}
}
break;
case 8:
//.........这里部分代码省略.........
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:101,代码来源:MainMgr.php
示例16: colectors_send
public function colectors_send($config, $player, $town, $count)
{
$town = textV($town);
$count = (int) $count;
if ($count < 1) {
$msg = 'wyślij minimum 1 zwiadowcę';
} else {
$can = get_row($q = "select go_lvl from game_objects where go_type = 3 and go_subtype = 8 and go_t_id =" . $player->actual_town);
if (empty($can)) {
$msg = 'nie posiadasz zbieraczy';
} elseif ($can->go_lvl < $count) {
$msg = 'nie posiadasz zbieraczy';
} else {
$event_check = get_one("select count(*) from events where (e_type = 70 or e_type = 71) and e_done = 0 and e_t_id = " . $player->actual_town);
if ($event_check > 9) {
$msg = 'masz już maksymalną ilość wysłanych grup zbieraczy';
} else {
$can = get_row("select t_id, t_usr_id from towns where t_name ='" . $town . "' limit 1");
if (empty($can)) {
$msg = 'nie ma takiego miasta';
} else {
$y = get_row("select * from map where m_t_id =" . $can->t_id);
$x = get_row("select * from map where m_t_id =" . $player->actual_town);
if ($x->m_x != $y->m_x && $x->m_y == $y->m_y) {
$range = abs($y->m_x - $x->m_x) * 300;
} elseif ($x->m_x == $y->m_x && $x->m_y != $y->m_y) {
$range = abs($y->m_y - $x->m_y) * 300;
} else {
$range = floor(sqrt(pow(abs($y->m_x - $x->m_x), 2) + pow(abs($y->m_y - $x->m_y), 2))) * 300;
}
$tnow = get_one("select unix_timestamp()");
call("update game_objects set go_lvl = go_lvl - {$count} where go_type = 3 and go_subtype = 8 and go_t_id =" . $player->actual_town);
call("insert into colectors (co_counts) value (" . $count . ")");
$id = get_one("select last_insert_id()");
require_once 'functions/EventsMgr.php';
$EventMgr = new EventsMgr();
$EventMgr->event_add($config, $player->actual_town, 70, $can->t_id, $id, 0, $tnow, $tnow + $range, 0);
$msg = 'wysłano wyprawę do miasta ' . $town;
}
}
}
}
return $msg;
}
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:44,代码来源:ColectorsMgr.php
示例17: get_guest
function get_guest($myid)
{
$myinfo = get_row('gid', 'zx_guest', 'wgid=' . $myid);
$ip = GetIP();
$browser = get_userAgent($_SERVER['HTTP_USER_AGENT']);
$time = time();
if (empty($myinfo)) {
$result = get_insert('zx_guest', 'wgid,logins,last,lastip,browser', "'{$myid}',1,{$time},'{$ip}','{$browser}'");
} else {
$result = get_update('zx_guest', "last={$time},lastip='{$ip}',browser='{$browser}',logins=logins+1", 'wgid=' . $myid);
}
$myinfo = get_row('*', 'zx_guest', 'wgid=' . $myid);
return $myinfo;
}
开发者ID:noikiy,项目名称:meilala,代码行数:14,代码来源:get_53kf.php
示例18: require_once
<?
require_once("../_shared/config.inc.php");
include_once("../_shared/func.inc.php");
open_db($db_host,$db_user,$db_passw,$datbase);
$data = get_row("referenz","name,pos,imgs","id='".$id."'");
if ($f_cancel) {
echo "<script language=\"javascript\">window.close(this)</script>";
exit;
}
if ($f_rem) {
if ($data['imgs']) {
$pics = explode("#",$data['imgs']);
for ($x = 0; $x < 6; $x++) {
if ($pics[$x] != "---") {
unlink($img_ref.$id."_".$x."_sm.jpg");
unlink($img_ref.$id."_".$x."_lg.jpg");
}
}
}
remove_data("referenz","id=".$id);
update_data("referenz","pos=pos-1","pos>".$data['pos']);
mysql_close;
echo "<script language=\"javascript\">window.opener.location.href='list.php'</script>";
echo "<script language=\"javascript\">window.close(this)</script>";
}
echo "<html>\n";
echo "<head>\n";
开发者ID:bernhardkircher,项目名称:installation-kircher-old,代码行数:31,代码来源:rem.php
示例19: reload
$echo .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><a href='?action=clan&act=forum&thread=" . $thread->thread . "'>" . $thread->title . "</a></td>\n\t\t\t\t\t\t<td>" . $thread->posts . "</td>\n\t\t\t\t\t\t<td>" . $thread->date . " | {$op}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t";
}
$echo .= "</table><hr/>";
}
$echo .= "\n\t\t\t<form action='?action=clan&act=forum' method='post'>\n\t\t\t\t<div class='box'>\n\t\t\t\t\t<div class='formbox'>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\tdodan nowy temat\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\ttytuł:\n\n\t\t\t\t\t\t\t<div class='right' style='margin:0px'>\n\t\t\t\t\t\t\t\t<input type='text' name='title' style='width:250px'/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\ttreść:\n\t\t\t\n\t\t\t\t\t\t\t<div class='right' style='margin:0px'>\n\t\t\t\t\t\t\t<textarea class='form' id='msg' rows='8' cols='106' name='textf'></textarea>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t \n\n\t\t\t\t\t\t<div class='buttonrow'>\n\t\t\t\t\t\t\t<input type='submit' value='dodaj' name='submit'>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t</form>\n\t\t\t";
echo $echo;
}
break;
case 'options':
if ($player->clan_id == 0) {
reload($config, 'clan');
}
if ($status != 2) {
reload($config, 'clan');
}
$clan = get_row("select * from clans where c_id = " . $player->clan_id);
if ($clan->herb > 0) {
$av = "<img src='herb/" . $player->clan_id . ".jpg' alt='' style='max-width:150px; max-height:150px'/>";
}
echo "\n\t\t<form action='?action=clan&act=options' method='post' enctype='multipart/form-data'>\n\t\t<input type='hidden' name='MAX_FILE_SIZE' value='100000' />\t\t\t\t\n\t\t\t<div class='box'>\n\t\t\t\t<div class='formbox'>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\tZmień herb klanu\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t<div class='left'>\n\t\t\t\t\t\t\t" . $av . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='right'>\n\t\t\t\t\t\t<input name='avatar' type='file' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t \n\n\t\t\t\t\t<div class='buttonrow'>\n\t\t\t\t\t\t<input type='submit' value='zmień' name='submit'>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\t\t<form action='?action=clan&act=options' method='post'>\n\t\t\t<div class='box'>\n\t\t\t\t<div class='formbox'>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\tZmień opis klanu\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t<div class='right' style='margin:0px'>\n\t\t\t\t\t\t<textarea class='form' id='msg' rows='8' cols='106' name='opis'>" . st($clan->opis) . "</textarea>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t \n\n\t\t\t\t\t<div class='buttonrow'>\n\t\t\t\t\t\t<input type='submit' value='zapisz' name='submit'>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t</form>\n\t\t";
break;
case 'list':
$clans = get_all("select *, (select count(*) from clans_users where cu_c_id = c_id and cu_status > 0) as players, (select count(*) from towns inner join users on t_usr_id = usr_id inner join clans_users on cu_usr_id =
|
请发表评论