if isset _GET gos if isset mc if mysql_result mysql_query SELECT COUNT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?
if(isset($_GET['gos']))
{
if(isset($mc))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant` WHERE `id` = '$gos[id_plant]' AND (`level` = '$ku[level]' OR `level` < '$ku[level]')"),0)!=0)
mysql_query("UPDATE `kolhoz_user` SET `last_plant` = '$gos[id_plant]' WHERE `id` = '$ku[id]'");
header("Location:?myfarm");
exit;
}
else err_game("Для начала вступите в компанию.");
}
include_once 'inc/change_plant.php';
include_once 'inc/change_soil.php';
include_once 'inc/cultivator_all.php';
include_once 'inc/cultivator.php';
include_once 'inc/harvest_all.php';
include_once 'inc/harvest.php';
include_once 'inc/seat_all.php';
include_once 'inc/seat.php';
include_once 'inc/soil_all.php';
include_once 'inc/soil.php';
include_once 'inc/water_all.php';
include_once 'inc/water.php';
include_once 'inc/clean_grounds.php';
include_once 'inc/new_ground.php';
echo '<div class="con_artist">';
echo "<div class='event'><h1>Туры</h1></div>";
if(isset($_SESSION['cp']))
{
echo "<div class='feedback'><ul class='feedbackPanel'><li class='feedbackPanelINFO'><span class='feedbackPanelINFO'>Бесплатная отмена туров будет доступна через ".time_left($ku['time_cp']-$time)."</span></li></ul></div>";
unset($_SESSION['cp']);
}
echo "<div class='content'>";
echo "<div class='block'>";
//echo "<div><img width='16' height='16' src='images/icons/refresh.png' alt='o'> <a href='?myfarm&reflesh=".rand(99999,99999999)."'>Обновить</a></div>";
echo "<table style='width:100%'><tr><td style='text-align:left;padding:3px;'><a href='?gos'><img src='style/new_contract.png' alt='' class='img_obj evt' style='margin:1px'/></a></div></td></div></td><td style='text-align:right;padding:3px'><a href='?myfarm&reflesh=".rand(99999,99999999)."'><img src='style/update.png' alt='' class='img_obj upd' style='margin:3px'/></a></td></tr></table>";
if(isset($_GET['svert']))
{
mysql_query("UPDATE `kolhoz_user` SET `svert` = '".($ku['svert']==1?"0":"1")."' WHERE `id` = '$ku[id]'");
header("Location:?myfarm");
}
if($ku['hydropinics_time']>$time)echo "<li><img width='16' height='16' src='images/icons/hydropinics.png' alt='o'> <a class='epic' href='?shop=hydropinics'>GPS-навигатор</a><span class='minor'> $ku[hydropinics_type]% на <span>".time_left($ku['hydropinics_time']-$time)."</span></span></li>";
if($ku['scarecrow_time']>$time)echo "<li><img width='16' height='16' src='http://agenstvo-game.ru/images/star%20(1).png' alt='o'> <a class='epic' href='?shop=scarecrow'>Двойной опыт</a><span class='minor'> на <span>".time_left($ku['scarecrow_time']-$time)."</span></span></li>";
if($ku['time_shmel']>$time)echo "<li><img width='16' height='16' alt='o' src='images/alina.png'> <a class='epic' href='?shop=helicopter&1'>Алина</a><span class='minor'> на <span>".time_left($ku['time_shmel']-$time)."</span></span></li>";
if($ku['time_yastreb']>$time)echo "<li><img width='16' height='16' alt='o' src='images/andrew1.png'> <a class='epic' href='?shop=helicopter&2'>Андрей</a><span class='minor'> на <span>".time_left($ku['time_yastreb']-$time)."</span></span></li>";
if($ku['time_drakon']>$time)echo "<li><img width='16' height='16' alt='o' src='images/artem1.png'> <a class='epic' href='?shop=helicopter&3'>Артем</a><span class='minor'> на <span>".time_left($ku['time_drakon']-$time)."</span></span></li>";
if($ku['garden_time']>$time)echo "<li><img width='16' height='16' alt='' src='images/icons/gardener/gardener".$ku[gardener].".png'> <a class='epic' href='?shop=gardener&id=".$ku[gardener]."'> ".$name."</a><span class='minor'> на <span>".time_left($ku['garden_time']-$time)."</span></span></li>";
if($ku['vetriak_time']>$time)echo "<li><img width='16' height='16' src='images/trening.png' alt='o'> <a class='epic' href='?shop=vetriak'>Тренинг</a><span class='minor'> на <span>".time_left($ku['vetriak_time']-$time)."</span></span></li>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`time` < '$time' OR `time` = '$time') AND `id_plant` != '0'"),0)!=0 && $ku['harvester']>0)echo "<div><td style='text-align:right;padding:2px'><alt='Посадка' class='img_obj evic' style='width:24px;height:25px;padding:1px;'/> <a href='?myfarm&harvest_all'>Забрать</a></div><br>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `soil` = '0' AND (`time_soil` = '$time' OR `time_soil` < '$time') AND `id_plant` != '0' AND `time` > '$time'"),0)!=0 && $ku['soiler']>0)echo "<div><td style='text-align:right;padding:2px'><alt='Посадка' class='img_obj evic' style='width:24px;height:25px;padding:1px;'/> <a href='?myfarm&soil_all'>Отправить</a></div><br>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `id_plant` != '0' AND (`time_water` = '$time' OR `time_water` < '$time') AND `time` > '$time' AND (`soil` = '0' AND `time_soil` > '$time' OR `soil` = '1')"),0)!=0 && $ku['irregate']>0)echo "<div><td style='text-align:right;padding:2px'><alt='Посадка' class='img_obj evic' style='width:24px;height:25px;padding:1px;'/> <a href='?myfarm&water_all'>Покормить</a></div><br>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND `cultivator` = '1'"),0)!=0 && $ku['seeder']>0)echo "<div><td style='text-align:right;padding:2px'><alt='Посадка' class='img_obj evic' style='width:24px;height:25px;padding:1px;'/> <a href='?myfarm&seat_all'>Отправить</a></div><br>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0)!=0 && $ku['cultivator']>0)echo "<div><td style='text-align:right;padding:2px'><alt='Посадка' class='img_obj evic' style='width:24px;height:25px;padding:1px;'/> <a href='?myfarm&cultivator_all'>Подготовить</a></div><br>";
echo "<ul>";
///ГРЯДКИ
///echo "".($ku['svert']==0?"<img width='16' height='16' src='images/icons/up.png' alt='o'> <a href='?myfarm&svert'><font color='violet'>Свернуть</font></a>":"<img width='16' height='16' src='images/icons/down.png' alt='o'> <a href='?myfarm&svert'><font color='violet'>Развернуть</font>")."</a></br>";
if($ku['svert']==0){
$q=mysql_query("SELECT * FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'");
while($post=mysql_fetch_array($q))
{
echo "<li>";
if($post['id_plant']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant` WHERE `id` = '$post[id_plant]'"),0)!=0)$plant=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '$post[id_plant]'"));
echo "<img width='48' height='48' src='".(!isset($plant)?"".($post['cultivator']==1?"images/dirt_new.jpg":"images/dirt2_new.jpg")."":"images/plants/$plant[id].png")."'class='portrait' alt='o'> ";
echo "".(!isset($plant)?"".($post['cultivator']==1?"<img width='16' height='16' src='/images/icons/document_mark_as_final.png' alt='o'> Тур подготовлен":"<img width='16' height='16' src='/images/icons/user_maid1.png' alt='o'> Тур не подготовлен")."":"<span class='title'>".hsc($plant['name'])."</span>".($post['time']>$time?" <td style='text-align:right;padding:2px'><alt='Время' class='cout' style='width:65px;padding:1px;'/>".time_left($post['time']-$time)."</a>":null)."")."</div>";
if(isset($plant))
{
if($post['time']<=$time)
{
echo "<img width='16' height='16' src='images/icons/harvest.png' alt='o'> <a href='?myfarm&harvest=$post[id]'>Забрать отчет</a>";
}
else
{
if($ku['last_soil']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_soil` WHERE `id` = '$ku[last_soil]'"),0)!=0)$ls=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_soil` WHERE `id` = '$ku[last_soil]'"));
echo "<div class='small minor'>".($post['time_soil']<=$time && $post['soil']==0 && $post['time']>$time?"<img width='16' height='16' src='images/icons/soil.png' alt='o'> ".(isset($ls)?"<a href='?myfarm&soil=$post[id]&select=$ls[id]'>
".hsc($ls['name'])."</a>, <a href='?myfarm&soil=$post[id]'>Выбрать
транспорт</a>":"<a href='?myfarm&soil=$post[id]'>Отправить</a>")."":"".($post['soil']==0 && $post['time']>$time?"Отправить через ".time_left($post['time_soil']-$time)."":null)."")."</div>";
echo "<div class='small minor'>".($post['time_water']>$time && $post['time']>$time?"Накормить через ".time_left($post['time_water']-$time)."":"".($post['time']>$time?"".($post['soil']==0 && $post['time_soil']>$time || $post['soil']==1?"<img alt='' width='16' height='16' src='images/icons/water.png'> <a href='?myfarm&water=$post[id]'>Покормить туристов</a>":null)."":null)."")."</div>";
}
}
else
{
echo "<span>";
if($ku['last_plant']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant` WHERE `id` = '$ku[last_plant]'"),0)!=0)$lp=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '$ku[last_plant]'"));
echo "".($post['cultivator']==1?"<img width='16' height='16' src='images/icons/seat.png' alt='o'> ".(isset($lp)?"<a href='?myfarm&seat=$post[id]&select=$lp[id]'><span>".hsc($lp['name'])."</span></a>, <a href='?myfarm&seat=$post[id]'><span>Выбрать тур</span></a>":"<a href='?myfarm&seat=$post[id]'>Выбрать тур</a>")."":"<img width='16' height='16' src='images/icons/dig.png' alt='o'> <a href='?myfarm&cultivator=$post[id]'><span style='title'>Подготовить тур</span></a>")."";
echo "</span>";
}
if(isset($plant))unset($plant);
echo "<div style='clear:both'></div></li>";
}
echo "</div></div></div></div></div></div></div></div>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0)<20)echo '<div class="div_hr3"></div><div class="div_hr4"></div><a href="?myfarm&new_ground" class="new_build"><table style="width:100%"><tr><td style="width:34px;"><img src="style/zoom_extend.png" alt="" style="margin-top:3px"/></td><td style="vertical-align:middle">Увеличить тур</td><td style="width:26px;padding-top:7px;"><img src="style/red_arrow.png" alt="" style="vertical-align:middle"/></td></tr></table></a>
</tr></table></a><div class="div_hr"></div><div class="div_hr2"></div>';
echo '<div class="content"><div class="block">';
}
else
{
include_once 'inc/odnagr.php';
}
//echo "</ul>";
if($ku['last_plant']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant` WHERE `id` = '$ku[last_plant]'"),0)!=0)$lp=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '$ku[last_plant]'"));
if($ku['last_soil']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_soil` WHERE `id` = '$ku[last_soil]'"),0)!=0)$ls=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_soil` WHERE `id` = '$ku[last_soil]'"));
echo "<ul class='ptm'><li><img width='16' height='16' src='images/icons/seat.png' alt='o'> <a href='?myfarm&change_plant'>Сменить тур</a>: <span>".(isset($lp)?"".hsc($lp['name'])."":"-")."</span></li>";
echo "<li><img width='16' height='16' src='images/icons/soil.png' alt='o'> <a href='?myfarm&change_soil'>Сменить транспорт</a>: <span>".(isset($ls)?"".hsc($ls['name'])."":"-")."</span></li>";
echo "".($ku['time_cp']>$time?"<li><img width='16' height='16' src='images/icons/cross.png' alt='o'> До бесплатной отмены: <span>".time_left($ku['time_cp']-$time)."</span></li><li><span><img width='16' height='16' src='images/icons/tick.png' alt='o'> <a href='?myfarm&clean_grounds'><span>Очистить тура</span></a>(<span>Стоимость</span>: <span><img width='16' height='16' src='images/icons/ruby.png' alt='o'> <span
class='title'>".($ku['count_cp']*10)."</span></span>)</span></li>":"<li><img width='16' height='16' src='images/icons/cross.png' alt='o'> <a href='?myfarm&clean_grounds'>Отменить туры</a></li>")."</ul>";
if(isset($mc))echo "<li class='pt'><img width='16' height='16' src='images/icons/heli4n.png' alt='o'> <a href='?collective=$mc[id]&hangar'>Вызвать помощника</a></li>";
echo '</ul></div></div></div></div>';
include_once 'inc/foot.php';
?>