Вход Регистрация
Файл: pages/minigames/job.php
Строк: 272
<?php
// Physical module map v50.6: public URL stays clean while code lives in /pages.
if (!defined('GAME_ROOT')) define('GAME_ROOT'dirname(__DIR__2));
chdir(GAME_ROOT);
if (
PHP_SAPI !== 'cli') { $_SERVER['PHP_SELF']='/job.php'$_SERVER['SCRIPT_NAME']='/job.php'; }

/* Обновление игры под PHP 8.4 / PDO и усиление безопасности: by Метриум (Стэлп) */
    
    
include './system/common.php';
    
 include 
'./system/functions.php';
        
      include 
'./system/user.php';
     include 
'./system/menu.php';
if(!
$user) {

  
header('location: /');
    
exit;

}


    
$title 'Работы';    

include 
'./system/h.php';

$farm db_query('SELECT * FROM `farm` WHERE `user` = "'.$user['id'].'"');  
  
$farm db_fetch_array($farm);

  

  
$farmy db_query('SELECT * FROM `farm_logs` WHERE `user` = "'.$user['id'].'"');  
  
$farmy db_fetch_array($farmy);

 if(!
$farmy) {
  
    
db_query('INSERT INTO `farm_logs` (`user`) VALUES ("'.$user['id'].'")');
  
  }

  if(!
$farm) {
    
db_query('INSERT INTO `farm` (`user`) VALUES ("'.$user['id'].'")');
    
$farm db_fetch_array(db_query('SELECT * FROM `farm` WHERE `user` = "'.$user['id'].'"'));
  }
  
$farm array_merge(['h'=>0,'time'=>0,'lvl'=>0,'h2'=>0,'time2'=>0,'lvl2'=>0,'h3'=>0,'time3'=>0,'lvl3'=>0], is_array($farm)?$farm:[]);
  
$farmy array_merge(['h'=>0,'h2'=>0,'h3'=>0], is_array($farmy)?$farmy:[]);
?><?=str_repeat("<div class=/'main/'",10)?>
                            
    <div class="content"><div class="block center color3 s125"><img src="/images/icon/level.png" alt=""> <a href="/job?">Работа</a></div>
            <div class="line"></div>    

        <div class="block">
        <div class="left mr8">
            <img src="/images/job/1.jpg" width="150" height="75" alt="">        </div>
        <div class="blue bold">Канализация</div>
<?php
if($farm['h'] <= 0) {
if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farm['lvl'] * 140);
}else{
$guy=($farm['lvl'] * 140)*2;}
?>
  <img src="/images/icon/arrow.png" width="16" height="16" alt=""> Доход/час:     <img src="/images/icon/exp.png" width="16" height="16" alt="">  <?=$guy?>                  



<?php

}
  if(
$farm['h'] == && $farm['time'] == 0) {
  
  
$h _string(_num($_POST['h'] ?? 0));
  
    if(
$h && $user['level'] >= $h 1) {
    
      
$hs = ($h * (60 60));

  if(
$h) {
     
db_query('UPDATE `farm_logs` SET `h` = "'.$h.'" WHERE `user` = "'.$user['id'].'"');
  }
            
      
db_query('UPDATE `farm` SET `h` = "'.$h.'", `time` = "'.(time() + $hs).'" WHERE `user` = "'.$user['id'].'"');
    
    
header('location: /job');
    
    }

?>


<div class="form-group field-jobworkform-hour_id required">

<form action='/job' method='post'>
  <select name='h'>

<?php

   
for($h 1$h 9$h++) {

if(
$user['level'] >= $h 1) {

?>

<option value='<?=$h?>'><?=$h?> час(ов)<?=($h == '':($h == '':''))?></option>

<?php

    
}

  }

?>

  </select>
<div class="help-block"></div>
</div>            <span class="m3 btn_start middle"><span class="btn_end">
                    <button type="submit" class="button">Работать</button></span>
            </span>
</form>
</div>
<?php

  
}
  else
  {


if(
$farm['time'] > time()) {

  if(isset(
$_GET['end'])) {
    
db_query('UPDATE `farm` SET `h` = "0", 
                                `time` = "0" WHERE `user` = "'
.$user['id'].'"');
    
header('location: /job');
  }
  

if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farmy['h'] * $farm['lvl'] * 140);
}else{
$guy=($farmy['h'] * $farm['lvl'] * 140)*2;}
?>
 </div>

       <img src="/images/icon/arrow.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/exp.png" width="16" height="16" alt="">   <?=$guy?>          <div>
    <img src="/images/icon/arrow.png" width="16" height="16" alt=""> <?=_time($farm['time'] - time())?><br/>

  <span class="m3 btn_start middle">
<span class="btn_end"><a href='/job/?end=true' class='button'>Отменить</a>
</span>
</span>
</br>


<?php

  
}
  else
  {

if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farmy['h'] * $farm['lvl'] * 140);
}else{
$guy=($farmy['h'] * $farm['lvl'] * 140)*2;}

  if(isset(
$_GET['zavr'])) {
     
db_query('UPDATE `users` SET `exp` = `exp` + '.$guy.', `exepy` = `exepy` + '.$guy.' WHERE `id` = "'.$user['id'].'"');  
      
db_query('UPDATE `farm` SET `h` = "0",
                                  `time` = "0" WHERE `user` = "'
.$user['id'].'"');
    
$_SESSION['not']='<div class="alert"><div>                                     <div class="blue"><img src="/images/icon/arrow.png" width="16" height="16" alt=""> Прибыль:</div>
    <img src="/images/icon/exp.png" width="16" height="16" alt=""> Авторитет:+ '
.$guy.'</div></div><div class="alert_bottom"></div>';
   
header('location: /job/?'.$udet.'');
}
?>

        <div>
        <img src="/images/icon/arrow.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/exp.png" width="16" height="16" alt="">     <?=$guy?>                </div>


</div>
                        <div class="clear"></div>
                <div class="dotted"></div>
        <div class="block center">
  <span class="m3 btn_start middle"><span class="btn_end"><a class="btn" href="/job/?zavr=<?=$randp rand(222,999)?>">Завершить работу</a></span> </span> </div>
      
<?php

  
}

  }

?>
<?php
if($farm['h'] <= 0) {
?>
<?php
     $lvl 
10 + ($farm['lvl'] * 180);

    
$lvl1 + ($farm['lvl'] * 13);
  if(
$farm['lvl'] < 14) {

  if(isset(
$_GET['pro'])) {
  
    if(
$farm['lvl'] >= 14) {
  
}else{
if(
$user['s']>=$lvl && $user['g']>=$lvl1)
{
      
db_query('UPDATE `farm` SET `lvl` = `lvl` + 1 WHERE `user` = "'.$user['id'].'"');
    
db_query('UPDATE `users` SET `s` = "'.($user['s']-$lvl).'", `g` = "'.($user['g']-$lvl1).'" WHERE `id` = "'.$user['id'].'"');
    
    
header('location: /job/');
    
    }
  
}
  }

  
?>
      <div class="dotted"></div>
      <div class="block center">
                        <span class="btn_start"><span class="btn_end"><a class="button" href="/job/?pro=<?=$randp rand(222,999)?>">Прокачать за     <img src="/images/icon/silver.png" width="16" height="16" alt="">  <?=$lvl?>    <img src="/images/icon/gold.png" width="16" height="16" alt="">  <?=$lvl1?></a></span> </span>  </div>


<?php

  
}

}
?>

 

         <div class="line"></div>
        <div class="block">
        <div class="left mr8">
            <img src="/images/job/2.jpg" width="150" height="75" alt="">        </div>
        <div class="blue bold">Шахта</div>

<?php
if($farm['h2'] <= 0) {
if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farm['lvl2'] * 50);
}else{
$guy=($farm['lvl2'] * 50)*2;}
?>
 <img src="/images/icon/arrow.png" width="16" height="16" alt=""> Доход/час:     <img src="/images/icon/silver.png" width="16" height="16" alt="">  <?=$guy?>                  


<?php

}
  if(
$farm['h2'] == && $farm['time2'] == 0) {
  
  
$h2 _string(_num($_POST['h2'] ?? 0));
  

    if(
$h2 && $user['level'] >= $h2 1) {
    
      
$hsi = ($h2 * (60 60));

  if(
$h2) {
     
db_query('UPDATE `farm_logs` SET `h2` = "'.$h2.'" WHERE `user` = "'.$user['id'].'"');
  }
            
      
db_query('UPDATE `farm` SET `h2` = "'.$h2.'", `time2` = "'.(time() + $hsi).'" WHERE `user` = "'.$user['id'].'"');
    
    
header('location: /job');
    
    }

?>


<div class="form-group field-jobworkform-hour_id required">

<form action='/job' method='post'>
  <select name='h2'>

<?php

   
for($h2 1$h2 9$h2++) {

if(
$user['level'] >= $h2 1) {

?>

<option value='<?=$h2?>'><?=$h2?> час(ов)<?=($h2 == '':($h2 == '':''))?></option>

<?php

    
}

  }

?>

  </select>
<div class="help-block"></div>
</div>            <span class="m3 btn_start middle"><span class="btn_end">
                    <button type="submit" class="button">Работать</button></span>
            </span>
</form>
</div>
<?php

  
}
  else
  {


if(
$farm['time2'] > time()) {

  if(isset(
$_GET['endy'])) {
    
db_query('UPDATE `farm` SET `h2` = "0", 
                                `time2` = "0" WHERE `user` = "'
.$user['id'].'"');
    
header('location: /job');
  }
  


if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farmy['h2'] * $farm['lvl2'] * 50);
}else{
$guy=($farmy['h2'] * $farm['lvl2'] * 50)*2;}

?>
 </div>

       <img src="/images/icon/arrow.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/silver.png" width="16" height="16" alt=""> <?=$guy?>            <div>
    <img src="/images/icon/arrow.png" width="16" height="16" alt=""> <?=_time($farm['time2'] - time())?><br/>

  <span class="m3 btn_start middle">
<span class="btn_end"><a href='/job?endy=true' class='button'>Отменить</a>
</span>
</span>
</br>


<?php

  
}
  else
  {

if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=($farmy['h2'] * $farm['lvl2'] * 50);
}else{
$guy=($farmy['h2'] * $farm['lvl2'] * 50)*2;}
  if(isset(
$_GET['zavr2'])) {
     
db_query('UPDATE `users` SET `s` = `s` + '.$guy.' WHERE `id` = "'.$user['id'].'"');  
      
db_query('UPDATE `farm` SET `h2` = " 0",
                                  `time2` = "0" WHERE `user` = "'
.$user['id'].'"');
    
$_SESSION['not']='<div class="alert"><div>                                     <div class="blue"><img src="/images/icon/arrow.png" width="16" height="16" alt=""> Прибыль:</div>
    <img src="/images/icon/silver.png" width="16" height="16" alt=""> Рубли:+ '
.$guy.'</div></div><div class="alert_bottom"></div>';
   
header('location: /job/?'.$udet.'');
}
    
?>

        <div>
        <img src="/images/icon/arrow.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/silver.png" width="16" height="16" alt=""> <?=$guy?>      
 </div>


</div>
                        <div class="clear"></div>
                <div class="dotted"></div>
        <div class="block center">
  <span class="m3 btn_start middle"><span class="btn_end"><a class="btn" href="/job/?zavr2=<?=$randp rand(222,999)?>">Завершить работу</a></span> </span> </div>
      
<?php

  
}

  }

?>
 
<?php
if($farm['h2'] <= 0) {
?>
<?php
     $lvl2 
10 + ($farm['lvl2'] * 180);

    
$lvl_2 + ($farm['lvl2'] * 13);
  if(
$farm['lvl2'] < 14) {

  if(isset(
$_GET['pro2'])) {
  
    if(
$farm['lvl2'] >= 14) {
  
}else{
if(
$user['s']>=$lvl2&&$user['g']>=$lvl_2)
{
      
db_query('UPDATE `farm` SET `lvl2` = `lvl2` + 1 WHERE `user` = "'.$user['id'].'"');
    
db_query('UPDATE `users` SET `s` = "'.($user['s']-$lvl2).'", `g` = "'.($user['g']-$lvl_2).'" WHERE `id` = "'.$user['id'].'"');
    
    
header('location: /job');
    
    }
  
}
  }

  
?>
      <div class="dotted"></div>
      <div class="block center">
               <a class="button" href="/job/?pro2=<?=$randp rand(222,999)?>">Прокачать за     <img src="/images/icon/silver.png" width="16" height="16" alt="">  <?=$lvl2?>    <img src="/images/icon/gold.png" width="16" height="16" alt="">  <?=$lvl_2?></a> </div>


<?php

  
}
}

?>



         <div class="line"></div>
        <div class="block">
        <div class="left mr8">
            <img src="/images/job/3.jpg" width="150" height="75" alt="">        </div>
        <div class="blue bold">Лесоповал</div>  
<?php
if($farm['h3'] <= 0) {
if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=max(1,(int)$farm['lvl3']);
}else{
$guy=max(1,(int)ceil((int)$farm['lvl3']*1.5));}
?>
<img src="/images/icon/arrow.png" width="16" height="16" alt=""> Доход/час:     <img src="/images/icon/gold.png" width="16" height="16" alt="">  <?=$guy?>                  



<?php
}

  if(
$farm['h3'] == && $farm['time3'] == 0) {
  
  
$h3 _string(_num($_POST['h3'] ?? 0));
  
    if(
$h3 && $user['level'] >= $h3 1) {
    
      
$hsid = ($h3 * (60 60));
            
  if(
$h3) {
     
db_query('UPDATE `farm_logs` SET `h3` = "'.$h3.'" WHERE `user` = "'.$user['id'].'"');
  }

      
db_query('UPDATE `farm` SET `h3` = "'.$h3.'", `time3` = "'.(time() + $hsid).'" WHERE `user` = "'.$user['id'].'"');
    
    
header('location: /job');
    
    }

?>


<div class="form-group field-jobworkform-hour_id required">

<form action='/job' method='post'>
  <select name='h3'>

<?php

   
for($h3 1$h3 9$h3++) {

if(
$user['level'] >= $h3 1) {

?>

<option value='<?=$h3?>'><?=$h3?> час(ов)<?=($h3 == '':($h3 == '':''))?></option>

<?php

    
}

  }

?>

  </select>
<div class="help-block"></div>
</div>            <span class="m3 btn_start middle"><span class="btn_end">
                    <button type="submit" class="button">Работать</button></span>
            </span>
</form>
</div>
<?php

  
}
  else
  {


if(
$farm['time3'] > time()) {

  if(isset(
$_GET['endi'])) {
    
db_query('UPDATE `farm` SET `h3` = "0", 
                                `time3` = "0" WHERE `user` = "'
.$user['id'].'"');
    
header('location: /job');
  }
  

if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=max(1,(int)$farmy['h3']*(int)$farm['lvl3']);
}else{
$guy=max(1,(int)ceil((int)$farmy['h3']*(int)$farm['lvl3']*1.5));}
?>
 </div>

       <img src="/images/icon/gold.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/gold.png" width="16" height="16" alt="">    <?=$guy?>            <div>
    <img src="/images/icon/arrow.png" width="16" height="16" alt=""> <?=_time($farm['time3'] - time())?><br/>

  <span class="m3 btn_start middle">
<span class="btn_end"><a href='/job/?endi=<?=$randp rand(222,999)?>' class='button'>Отменить</a>
</span>
</span>
</br>


<?php

  
}
  else
  {

if((int)(
$user['vip'] ?? 0) === 0){ 
$guy=max(1,(int)$farmy['h3']*(int)$farm['lvl3']);
}else{
$guy=max(1,(int)ceil((int)$farmy['h3']*(int)$farm['lvl3']*1.5));}
  if(isset(
$_GET['zavr3'])) {
     
$guy=game_economy_award_gold((int)$user['id'],(int)$guy,'job',150);
      
db_query('UPDATE `farm` SET `h3` = "0",
                                  `time3` = "0" WHERE `user` = "'
.$user['id'].'"');

$_SESSION['not']='<div class="alert"><div>                                     <div class="blue"><img src="/images/icon/arrow.png" width="16" height="16" alt=""> Прибыль:</div>
    <img src="/images/icon/gold.png" width="16" height="16" alt=""> Сахар:+ '
.$guy.'</div></div><div class="alert_bottom"></div>';
   
header('location: /job/?'.$udet.'');
}
    
?>


        <div>

        <img src="/images/icon/arrow.png" width="16" height="16" alt="">                    Доход:     <img src="/images/icon/gold.png" width="16" height="16" alt="">    <?=$guy?>              </div>


</div>
                        <div class="clear"></div>
                <div class="dotted"></div>
        <div class="block center">
  <span class="m3 btn_start middle"><span class="btn_end"><a class="btn" href="/job/?zavr3=<?=$randp rand(222,999)?>">Завершить работу</a></span> </span> </div>

      
<?php

  
}

  }

?>
<?php
if($farm['h3'] <= 0) {
?>
<?php
     $lvl3 
10 + ($farm['lvl3'] * 180);

    
$lvl_3 + ($farm['lvl3'] * 13)*2;
  if(
$farm['lvl3'] < 14) {

  if(isset(
$_GET['pro3'])) {
  
    if(
$farm['lvl3'] >= 14) {


  
}else{
if(
$user['s']>=$lvl3&&$user['g']>=$lvl_3)
{
      
db_query('UPDATE `farm` SET `lvl3` = `lvl3` + 1 WHERE `user` = "'.$user['id'].'"');
    
db_query('UPDATE `users` SET `s` = "'.($user['s']-$lvl3).'", `g` = "'.($user['g']-$lvl_3).'" WHERE `id` = "'.$user['id'].'"');
    
    
header('location: /job/');
    
    }
  
}
  }

  
?>
      <div class="dotted"></div>
      <div class="block center">
                        <span class="btn_start"><span class="btn_end"><a class="button" href="/job/?pro3=<?=$randp rand(222,999)?>">Прокачать за     <img src="/images/icon/silver.png" width="16" height="16" alt="">  <?=$lvl3?>    <img src="/images/icon/gold.png" width="16" height="16" alt="">  <?=$lvl_3?></a></span> </span>  </div>


<?php

  
}

}
?>


         <div class="line"></div>
<ul class="block small">
   <li class="color2">Чем выше ваш уровень, тем выше время работы </li>
    <li class="color2">Повышение мастерства позволит вам получать больше дохода</li>
</ul></div>
<?php

  
include './system/f.php';

?>
Онлайн: 2
Реклама