Ahojte, to som zase ja. Prerábam hru, ktorú vyvíjam (v mysql fungovala) do mysqli a sú s tým samé problémy. Stále mi skáče undefined index na batériu, no využívam totožné scripty ako vtedy. Vedel by mi niekto poradiť? Žiadne iné súbory nepoužívam iba tie, ohľadom ktorých dám sem kód.
update_stats.php
<?php
if($user['fraction'] == 0){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['springfield'],$unit['rifleman']);
if($num1 == $weapon['springfield']){
$attack1 = (50 * $weapon['springfield']) + (10 * $unit['rifleman'] );
}else{
$attack1 = (10 * $unit['rifleman']);
}
$num2 = min($weapon['thompson'],$unit['soldier']);
if($num2 == $weapon['thompson']){
$attack2 = (200 * $weapon['thompson']) + (14 * $unit['soldier']);
}else{
$attack2 = (14 * $unit['soldier']);
}
$num3 = ($weapon['sherman']);
if($num3 == $weapon['sherman']){
$attack3 = (1000 * $weapon['sherman']);
}
$num4 = ($weapon['hellcat']);
if($num4 == $weapon['hellcat']){
$attack5 = (2000 * $weapon['hellcat']);
}
$num5 = ($weapon['pershing']);
if($num5 == $weapon['pershing']){
$attack6 = (3000 * $weapon['pershing']);
}
$num6 = min($weapon['browning'],$unit['machinegunner']);
if($num6 == $weapon['browning']){
$defense1 = (650 * $weapon['browning']) + (12 * $unit['machinegunner']);
}else{
$defense1 = (12 * $unit['machinegunner']);
}
$num7 = min($weapon['m1garand'],$unit['rifleman']);
if($num7 == $weapon['m1garand']){
$attack7 = (75 * $weapon['m1garand']) + (10 * $unit['rifleman'] );
}else{
$attack7 = (10 * $unit['rifleman']);
}
$num8 = min($weapon['m1a1'],$unit['rifleman']);
if($num8 == $weapon['m1a1']){
$attack8 = (100 * $weapon['m1a1']) + (10 * $unit['rifleman'] );
}else{
$attack8 = (10 * $unit['rifleman']);
}
$num9 = ($weapon['howitzer']);
if($num9 == $weapon['howitzer']){
$defense2 = (800 * $weapon['howitzer']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack5 + $attack6 + $attack7 + $attack8 + $stats['cattack'];
$defense = $defense1 + $defense2 +$stats['wdefense'];
if($unit['sergeant'] == 1) {
$attack = (2 * $attack );
}
if($unit['gendef'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,"UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
if($user['fraction'] == 1){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['kar98'],$unit['schutze']);
if($num1 == $weapon['kar98']){
$attack1 = (50 * $weapon['kar98']) + (10 * $unit['schutze'] );
}else{
$attack1 = (10 * $unit['schutze']);
}
$num2 = min($weapon['gw43'],$unit['schutze']);
if($num2 == $weapon['gw43']){
$attack2 = (75 * $weapon['gw43']) + (10 * $unit['schutze']);
}else{
$attack2 = (10 * $unit['schutze']);
}
$num3 = ($weapon['tiger']);
if($num3 == $weapon['tiger']){
$attack3 = (1000 * $weapon['tiger']);
}
$num4 = ($weapon['stugv']);
if($num4 == $weapon['stugv']){
$attack5 = (2000 * $weapon['stugv']);
}
$num5 = ($weapon['tiger2']);
if($num5 == $weapon['tiger2']){
$attack6 = (3000 * $weapon['tiger2']);
}
$num6 = min($weapon['mp40'],$unit['soldad']);
if($num6 == $weapon['mp40']){
$attack7 = (100 * $weapon['mp40']) + (14 * $unit['soldad']);
}else{
$attack7 = (14 * $unit['soldad']);
}
$num7 = min($weapon['mp44'],$unit['soldad']);
if($num7 == $weapon['mp44']){
$attack8 = (150 * $weapon['mp44']) + (14 * $unit['soldad'] );
}else{
$attack8 = (14 * $unit['soldad']);
}
$num8 = min($weapon['mg42'],$unit['maschinengewehr']);
if($num8 == $weapon['mg42']){
$defense1 = (650 * $weapon['mg42']) + (12 * $unit['maschinengewehr'] );
}else{
$defense1 = (12 * $unit['maschinengewehr']);
}
$num9 = ($weapon['panzerstellung']);
if($num9 == $weapon['panzerstellung']){
$defense2 = (800 * $weapon['panzerstellung']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack5 + $attack6 + $attack7 + $attack8 + $stats['cattack'];
$defense = $defense1 + $defense2 + $stats['wdefense'];
if($unit['leutant'] == 1) {
$attack = (2 * $attack );
}
if($unit['hauptmann'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,("UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
if($user['fraction'] == 2){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['kar98'],$unit['strelec']);
if($num1 == $weapon['kar98']){
$attack1 = (50 * $weapon['kar98']) + (10 * $unit['strelec'] );
}else{
$attack1 = (10 * $unit['strelec']);
}
$num2 = min($weapon['puskavz24'],$unit['strelec']);
if($num2 == $weapon['puskavz24']){
$attack2 = (75 * $weapon['puskavz24']) + (10 * $unit['strelec']);
}else{
$attack2 = (10 * $unit['strelec']);
}
$num3 = ($weapon['lt38']);
if($num3 == $weapon['lt38']){
$attack3 = (1500 * $weapon['lt38']);
}
$num4 = ($weapon['pak38']);
if($num4 == $weapon['pak38']){
$defense1 = (300 * $weapon['pak38']);
}
$num5 = ($weapon['flak37']);
if($num5 == $weapon['flak37']){
$defense2 = (500 * $weapon['flak37']);
}
$num6 = min($weapon['gulometvz24'],$unit['gulometcik']);
if($num6 == $weapon['gulometvz24']){
$defense3 = (650 * $weapon['gulometvz24']) + (12 * $unit['gulometcik']);
}else{
$defense3 = (12 * $unit['gulometcik']);
}
$num7 = min($weapon['pps43'],$unit['vojak']);
if($num7 == $weapon['pps43']){
$attack4 = (100 * $weapon['pps43']) + (14 * $unit['vojak'] );
}else{
$attack4 = (14 * $unit['vojak']);
}
$num8 = min($weapon['mp38'],$unit['vojak']);
if($num8 == $weapon['mp38']){
$attack5 = (125 * $weapon['mp38']) + (14 * $unit['vojak'] );
}else{
$attack5 = (15 * $unit['vojak']);
}
$num9 = ($weapon['grw']);
if($num9 == $weapon['grw']){
$defense4 = (800 * $weapon['grw']);
}
$num10 = min($weapon['zk383'],$unit['vojak']);
if($num10 == $weapon['zk383']){
$attack6 = (150 * $weapon['zk383']) + (14 * $unit['vojak'] );
} else{
$attack6 = (15 * $unit['vojak']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack4 + $attack5 + $attack6 + $stats['cattack'];
$defense = $defense1 + $defense2 + $defense3 + $defense4 +$stats['wdefense'];
if($unit['serzant'] == 1) {
$attack = (2 * $attack );
}
if($unit['generalobrany'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,("UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
if($user['fraction'] == 3){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['mosinnagant'],$unit['strelets']);
if($num1 == $weapon['mosinnagant']){
$attack1 = (50 * $weapon['mosinnagant']) + (10 * $unit['strelets'] );
}else{
$attack1 = (10 * $unit['strelets']);
}
$num2 = min($weapon['svt40'],$unit['strelets']);
if($num2 == $weapon['svt40']){
$attack2 = (75 * $weapon['svt40']) + (10 * $unit['strelets']);
}else{
$attack2 = (10 * $unit['strelets']);
}
$num3 = ($weapon['t34']);
if($num3 == $weapon['t34']){
$attack3 = (1000 * $weapon['t34']);
}
$num4 = ($weapon['is2']);
if($num4 == $weapon['is2']){
$attack4 = (2000 * $weapon['is2']);
}
$num5 = ($weapon['kv2']);
if($num5 == $weapon['kv2']){
$attack5 = (3000 * $weapon['kv2']);
}
$num6 = min($weapon['pps41'],$unit['vojnik']);
if($num6 == $weapon['pps41']){
$attack6 = (200 * $weapon['pps41']) + (14 * $unit['vojnik']);
}else{
$attack6 = (14 * $unit['vojnik']);
}
$num7 = min($weapon['dp27'],$unit['pistoleti']);
if($num7 == $weapon['dp27']){
$defense1 = (450 * $weapon['dp27']) + (12 * $unit['pistoleti'] );
}else{
$defense1 = (12 * $unit['pistoleti']);
}
$num8 = min($weapon['maxim'],$unit['pistoleti']);
if($num8 == $weapon['maxim']){
$defense2 = (650 * $weapon['maxim']) + (12 * $unit['pistoleti'] );
}else{
$defense2 = (12 * $unit['pistoleti']);
}
$num9 = ($weapon['zis3']);
if($num9 == $weapon['zis3']){
$defense3 = (500 * $weapon['zis3']);
}
$num10 = $weapon['$minometvz40'];
if($num10 == $weapon['$minometvz40']){
$defense4 = (800 * $weapon['$minometvz40']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack4 + $attack5 + $attack6 + $stats['cattack'];
$defense = $defense1 + $defense2 + $defense3 + $defense4 + $stats['wdefense'];
if($unit['sershant'] == 1) {
$attack = (2 * $attack );
}
if($unit['obscht'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,("UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
if($user['fraction'] == 4){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['kar98'],$unit['tiratore']);
if($num1 == $weapon['kar98']){
$attack1 = (50 * $weapon['kar98']) + (10 * $unit['tiratore'] );
}else{
$attack1 = (10 * $unit['tiratore']);
}
$num2 = min($weapon['carcano'],$unit['tiratore']);
if($num2 == $weapon['carcano']){
$attack2 = (75 * $weapon['carcano']) + (10 * $unit['tiratore']);
}else{
$attack2 = (10 * $unit['tiratore']);
}
$num3 = ($weapon['p43']);
if($num3 == $weapon['p43']){
$attack3 = (1500 * $weapon['p43']);
}
$num4 = ($weapon['carro']);
if($num4 == $weapon['carro']){
$attack4 = (3000 * $weapon['carro']);
}
$num5 = ($weapon['skoda']);
if($num5 == $weapon['skoda']){
$defense1 = (500 * $weapon['skoda']);
}
$num6 = min($weapon['breda'],$unit['artigliere']);
if($num6 == $weapon['breda']){
$defense2 = (650 * $weapon['breda']) + (12 * $unit['artigliere']);
}else{
$defense2 = (12 * $unit['artigliere']);
}
$num7 = min($weapon['fucile'],$unit['tiratore']);
if($num7 == $weapon['fucile']){
$attack5 = (100 * $weapon['fucile']) + (10 * $unit['tiratore'] );
}else{
$attack5 = (10 * $unit['tiratore']);
}
$num8 = min($weapon['ovp'],$unit['soldato']);
if($num8 == $weapon['ovp']){
$attack6 = (150 * $weapon['ovp']) + (14 * $unit['soldato'] );
}else{
$attack6 = (14 * $unit['soldato']);
}
$num9 = ($weapon['brixia']);
if($num9 == $weapon['brixia']){
$defense3 = (800 * $weapon['brixia']);
}
$num10 = min($weapon['baretta'],$unit['soldato']);
if($num10 == $weapon['baretta']){
$attack7 = (200 * $weapon['baretta']) + (14 * $unit['soldato'] );
}else{
$attack7 = (14 * $unit['soldato']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack4 + $attack5 + $attack6 + $attack7+ $stats['cattack'];
$defense = $defense1 + $defense2 + $defense3 + $stats['wdefense'];
if($unit['sergente'] == 1) {
$attack = (2 * $attack );
}
if($unit['generale'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,("UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
if($user['fraction'] == 5){
$income = 2 * $unit['worker'];
$farming = 5 * pow($unit['farmer'],0.5);
$num1 = min($weapon['$enfield'],$unit['enfieldman']);
if($num1 == $weapon['$enfield']){
$attack1 = (50 * $weapon['$enfield']) + (10 * $unit['enfieldman'] );
}else{
$attack1 = (10 * $unit['enfieldman']);
}
$num2 = min($weapon['delisle'],$unit['enfieldman']);
if($num2 == $weapon['delisle']){
$attack2 = (75 * $weapon['delisle']) + (10 * $unit['enfieldman']);
}else{
$attack2 = (10 * $unit['enfieldman']);
}
$num3 = ($weapon['cromwell']);
if($num3 == $weapon['cromwell']){
$attack3 = (1500 * $weapon['cromwell']);
}
$num4 = ($weapon['comet']);
if($num4 == $weapon['comet']){
$attack4 = (3000 * $weapon['comet']);
}
$num5 = min($weapon['bar'],$unit['soldier']);
if($num5 == $weapon['bar']){
$attack5 = (150 * $weapon['bar']) + (14 * $unit['soldier']);
} else{
$attack5 = (14 * $unit['soldier']);
}
$num6 = min($weapon['sten'],$unit['soldier']);
if($num6 == $weapon['sten']){
$attack6 = (200 * $weapon['sten']) + (14 * $unit['soldier']);
}else{
$attack6 = (14 * $unit['soldier']);
}
$num7 = min($weapon['$bren'],$unit['gunner']);
if($num7 == $weapon['$bren']){
$defense1 = (300 * $weapon['$bren']) + (12 * $unit['gunner'] );
}else{
$defense1 = (12 * $unit['gunner']);
}
$num8 = min($weapon['vickers'],$unit['gunner']);
if($num8 == $weapon['vickers']){
$defense2 = (450 * $weapon['vickers']) + (12 * $unit['gunner'] );
}else{
$defense2 = (12 * $unit['gunner']);
}
$num9 = min($weapon['lewis'],$unit['gunner']);
if($num9 == $weapon['lewis']){
$defense3 = (600 * $weapon['lewis']) + (12 * $unit['gunner'] );
}else{
$defense3 = (12 * $unit['gunner']);
}
$attack = $attack1 + $attack2 + $attack3 + $attack4 + $attack5 + $attack6 + $stats['cattack'];
$defense = $defense1 + $defense2 + $defense3 + $stats['wdefense'];
if($unit['sergeant'] == 1) {
$attack = (2 * $attack );
}
if($unit['gendef'] == 1) {
$defense = (2 * $defense );
}
$update_stats = mysqli_query($con,("UPDATE `stats` SET
`income`='".$income."',`farming`='".$farming."',
`attack`='".$attack."',`defense`='".$defense."'
WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
}
?>
main.php (hlavné herné okno po prihlásení) a v samotnom main.php mám problém s quest, ktorý je tiež undefined... už si neviem pomôcť a som zúfalý! :(
<?php
include ('game_header.php');
include ('functions.php');
session_start();
include ('safe.php');
?>
<style>.art-content .art-postcontent-0 .layout-item-0{border-top-width:1px;border-top-style:dotted;border-top-color:#707070;margin-top:10px;margin-bottom:10px}.art-content .art-postcontent-0 .layout-item-1{padding-right:10px;padding-left:10px}.ie7 .art-post .art-layout-cell{border:none!important;padding:0!important}.ie6 .art-post .art-layout-cell{border:none!important;padding:0!important}</style></head>
<body onload="startTime()">
<div id="art-main">
<header class="art-header">
<div class="art-shapes">
</div>
<h1 class="art-headline" data-left="66.04%">
<a href="#">Nation Wars</a>
</h1>
<h2 class="art-slogan" data-left="39.8%">Dobi svet a užívaj si slávu</h2>
</header>
<div class="art-sheet clearfix">
<div class="art-layout-wrapper">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-sidebar1"><div class="art-vmenublock clearfix">
<div class="art-vmenublockcontent">
<ul class="art-vmenu"><li><a href="main.php" class="active">Prehľad</a></li><li><a href="raid.php" class="">Operácie</a></li><li><a href="rankings.php" class="">Majori</a></li><li><a href="guilds.php" class="">Odboje</a></li><li><a href="map.php" class="">Mapa</a></li><li><a href="minigame.php" class="">Minihra</a></li><li><a href="guild.php" class="">Môj odboj</a></li><li><a href="room.php" class="">Chat</a></li><li><a href="mailbox.php" class="">Pošta<?php if($stats['new'] == 1){ ?><font color="#FF0000"> Nová!</font><?php } ?></a></li></ul>
</div>
</div></div>
<div class="art-layout-cell art-content"><article class="art-post art-article">
<div class="art-postmetadataheader">
<h2 class="art-postheader"><span class="art-postheadericon">Prehľad</span></h2>
</div>
<div class="art-postcontent art-postcontent-0 clearfix">
<?php
if(isset($_SESSION['uid'])){
if($user['fraction'] == 0){ // USA
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['rifleman'] >= 5 && $weapon['springfield'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['machinegunner'] >= 5 && $weapon['browning'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['rifleman'] >= 10 && $weapon['springfield'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['machinegunner'] >= 10 && $weapon['browning'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['rifleman'] >= 20 && $weapon['springfield'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['machinegunner'] >= 20 && $weapon['browning'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['rifleman'] >= 40 && $weapon['springfield'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['machinegunner'] >= 40 && $weapon['browning'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['rifleman'] >= 80 && $weapon['springfield'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['machinegunner'] >= 80 && $weapon['browning'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['rifleman'] >= 160 && $weapon['springfield'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['machinegunner'] >= 160 && $weapon['browning'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}?>
<?php
if($user['fraction'] == 1){ // NEMECKO
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['schutze'] >= 5 && $weapon['kar98'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 5 && $weapon['mg42'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['schutze'] >= 10 && $weapon['kar98'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 10 && $weapon['mg42'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['schutze'] >= 20 && $weapon['kar98'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 20 && $weapon['mg42'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['schutze'] >= 40 && $weapon['kar98'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 40 && $weapon['mg42'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['schutze'] >= 80 && $weapon['kar98'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 80 && $weapon['mg42'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['schutze'] >= 160 && $weapon['kar98'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['maschinengewehr'] >= 160 && $weapon['mg42'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}?>
<?php
if($user['fraction'] == 2){ // SLOVENSKO
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['strelec'] >= 5 && $weapon['kar98'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['gulometcik'] >= 5 && $weapon['mg42'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['strelec'] >= 10 && $weapon['kar98'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['gulometcik'] >= 10 && $weapon['mg42'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['strelec'] >= 20 && $weapon['kar98'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['gulometcik'] >= 20 && $weapon['mg42'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['strelec'] >= 40 && $weapon['kar98'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['gulometcik'] >= 40 && $weapon['mg42'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['strelec'] >= 80 && $weapon['kar98'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['gulometcik'] >= 80 && $weapon['mg42'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['strelec'] >= 160 && $weapon['kar98'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['gulometcik'] >= 160 && $weapon['mg42'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}?>
<?php
if($user['fraction'] == 3){ // ZSSR
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['strelets'] >= 5 && $weapon['mosinnagant'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['pistoleti'] >= 5 && $weapon['dp27'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['strelets'] >= 10 && $weapon['mosinnagant'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['pistoleti'] >= 10 && $weapon['dp27'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['strelets'] >= 20 && $weapon['mosinnagant'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['pistoleti'] >= 20 && $weapon['dp27'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['strelets'] >= 40 && $weapon['mosinnagant'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['pistoleti'] >= 40 && $weapon['dp27'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['strelets'] >= 80 && $weapon['mosinnagant'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['pistoleti'] >= 80 && $weapon['dp27'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['strelets'] >= 160 && $weapon['mosinnagant'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['pistoleti'] >= 160 && $weapon['dp27'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}?>
<?php
if($user['fraction'] == 4){ // TALIANSKO
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['tiratore'] >= 5 && $weapon['carcano'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['artigliere'] >= 5 && $weapon['breda'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['tiratore'] >= 10 && $weapon['carcano'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['artigliere'] >= 10 && $weapon['breda'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['tiratore'] >= 20 && $weapon['carcano'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['artigliere'] >= 20 && $weapon['breda'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['tiratore'] >= 40 && $weapon['carcano'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['artigliere'] >= 40 && $weapon['breda'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['tiratore'] >= 80 && $weapon['carcano'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['artigliere'] >= 80 && $weapon['breda'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['tiratore'] >= 160 && $weapon['carcano'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['artigliere'] >= 160 && $weapon['breda'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}?>
<?php
if($user['fraction'] == 5){ // BRITI
if ($stats['quest'] == 1 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 4 && $stats['qok'] == 0 && $unit['worker'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 7 && $stats['qok'] == 0 && $unit['enfieldman'] >= 5 && $weapon['enfield'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 8 && $stats['qok'] == 0 && $unit['gunner'] >= 5 && $weapon['bren'] >= 5){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 10 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 11 && $stats['qok'] == 0 && $unit['worker'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 12 && $stats['qok'] == 0 && $unit['enfieldman'] >= 10 && $weapon['enfield'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 13 && $stats['qok'] == 0 && $unit['gunner'] >= 10 && $weapon['bren'] >= 10){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 14 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 15 && $stats['qok'] == 0 && $unit['worker'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 16 && $stats['qok'] == 0 && $unit['enfieldman'] >= 20 && $weapon['enfield'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 17 && $stats['qok'] == 0 && $unit['gunner'] >= 20 && $weapon['bren'] >= 20){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 19 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 20 && $stats['qok'] == 0 && $unit['worker'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 21 && $stats['qok'] == 0 && $unit['enfieldman'] >= 40 && $weapon['enfield'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 22 && $stats['qok'] == 0 && $unit['gunner'] >= 40 && $weapon['bren'] >= 40){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 23 && $stats['qok'] == 0 && $stats['cannon'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 24 && $stats['qok'] == 0 && $stats['wall'] >= 1){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 25 && $stats['qok'] == 0 && ($unit['farmer'] + $unit['tfarmer']) >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 26 && $stats['qok'] == 0 && $unit['worker'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 27 && $stats['qok'] == 0 && $unit['enfieldman'] >= 80 && $weapon['enfield'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 28 && $stats['qok'] == 0 && $unit['gunner'] >= 80 && $weapon['bren'] >= 80){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 30 && $stats['qok'] == 0 && $unit['enfieldman'] >= 160 && $weapon['enfield'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 31 && $stats['qok'] == 0 && $unit['gunner'] >= 160 && $weapon['bren'] >= 160){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
if ($stats['quest'] == 32 && $stats['qok'] == 0 && $stats['floor'] >= 2){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}
if(!isset($_SESSION['uid'])){
if($_SERVER['QUERY_STRING'] != ""){
$id_get = mysqli_query($con,"SELECT `id` FROM `user` WHERE `code`='".$_SERVER['QUERY_STRING']."'") or die(mysqli_error($con));
$id = mysqli_fetch_assoc($id_get);
if(mysqli_num_rows($id_get) == 0){
echo "Nesprávny kód!";
}else{
$activated = mysqli_query($con,"UPDATE `user` SET `activated`='1' WHERE `id`='".$id['id']."'") or die(mysqli_error($con));
echo "Účet bol aktivovaný!";
}
}else{
echo "Musíš byť prihlásený!";
}
}else{
$rp = 1;
if(isset($_POST['farmer'])){
if($stats['battery'] >= 5 && $timer['ftime'] == 0 && $unit['farmer'] > 0 | $unit['tfarmer'] > 0 | $unit['fisherman'] > 0){
output("Farmári sa pustili do práce!");
$rp = 0;
$fzarobok = 0;
$ftime = time();
$working['fyes'] = $ftime;
$working['fwork'] = $unit['farmer'];
$working['tfwork'] = $unit['tfarmer'];
$working['fishermanwork'] = $unit['fisherman'];
$stats['battery'] -= 5;
$stats['rank'] += 2;
$timer['ftime'] = 1;
$update_working = mysqli_query($con,"UPDATE `working` SET `fyes`='".$working['fyes']."',`fwork`='".$working['fwork']."',`tfwork`='".$working['tfwork']."',`fishermanwork`='".$working['fishermanwork']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_stats = mysqli_query($con,"UPDATE `stats` SET `battery`='".$stats['battery']."',`rank`='".$stats['rank']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_timer = mysqli_query($con,"UPDATE `timer` SET `ftime`='".$timer['ftime']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
if ($stats['quest'] == 2 && $stats['qok'] == 0){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}elseif((time() - $working['fyes']) >= 300 && $timer['ftime'] == 1){
$fzarobok = round(((10 * pow($working['fwork'],0.5)) + round(100 * pow($working['tfwork'],0.5)) + round(30 * pow($working['fishermanwork'],0.5))) / 100 * (100 + $guild['level']));
output("Získal si ".$fzarobok." jedla!");
$rp = 0;
$ftime = 0;
$working['fyes'] = $ftime;
$working['fwork'] = 0;
$working['tfwork'] = 0;
$working['fishermanwork'] = 0;
$stats['food'] += $fzarobok;
$stats['rank'] += 1;
$fzarobok = 0;
$timer['ftime'] = 0;
$update_working = mysqli_query($con,"UPDATE `working` SET `fyes`='".$working['fyes']."',`fwork`='".$working['fwork']."',`tfwork`='".$working['tfwork']."',`fishermanwork`='".$working['fishermanwork']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_stats = mysqli_query($con,"UPDATE `stats` SET `food`='".$stats['food']."',`rank`='".$stats['rank']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_timer = mysqli_query($con,"UPDATE `timer` SET `ftime`='".$timer['ftime']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
if ($stats['quest'] == 3 && $stats['qok'] == 0){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}elseif($unit['farmer'] == 0 && $unit['tfarmer'] == 0 && $timer['ftime'] == 0){
output("Nemáš žiadneho farmára!");
$rp = 0;
}elseif($stats['battery'] < 5 && $timer['ftime'] == 0){
output("Nemáš dostatok baterky!");
$rp = 0;
}else{
$zostava = (300 - (time() - $working['fyes']));
output("Musíš počkať ".$zostava." sekúnd.");
$rp = 0;
}
}
if(isset($_POST['miner'])){
if($stats['battery'] >= 5 && $timer['mtime'] == 0 && $unit['worker'] > 0){
output("Baníci sa pustili do práce!");
$rp = 0;
$mzarobok = 0;
$mtime = time();
$working['myes'] = $mtime;
$working['mwork'] = $unit['worker'];
$stats['battery'] -= 5;
$stats['rank'] += 2;
$timer['mtime'] = 1;
$update_working = mysqli_query($con,"UPDATE `working` SET `myes`='".$working['myes']."',`mwork`='".$working['mwork']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_stats = mysqli_query($con,"UPDATE `stats` SET `battery`='".$stats['battery']."',`rank`='".$stats['rank']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_timer = mysqli_query($con,"UPDATE `timer` SET `mtime`='".$timer['mtime']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
if ($stats['quest'] == 5 && $stats['qok'] == 0){ $stats['qok'] = 1; $update_stats = mysqli_query($con,"UPDATE `stats` SET `qok`='".$stats['qok']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con)); }
}elseif((time() - $working['myes']) >= 300 && $timer['mtime'] == 1){
$mzarobok = round((100 * pow($working['mwork'],0.5)) / 100 * (100 + $guild['level']));
output("Získal si".$mzarobok." zlata!");
$rp = 0;
$mtime = 0;
$working['myes'] = $mtime;
$working['mwork'] = 0;
$stats['gold'] += $mzarobok;
$stats['rank'] += 1;
$mzarobok = 0;
$timer['mtime'] = 0;
$update_working = mysqli_query($con,"UPDATE `working` SET `myes`='".$working['myes']."',`mwork`='".$working['mwork']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_stats = mysqli_query($con,"UPDATE `stats` SET `gold`='".$stats['gold']."',`rank`='".$stats['rank']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
$update_timer = mysqli_query($con,"UPDATE `timer` SET `mtime`='".$timer['mtime']."' WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($con));
if ($stats['quest'