Просмотр файла city1/public_house.php

Размер файла: 3.26Kb
  1. <?php
  2. include "./../ini3.php";
  3. include "./../includes/header2.php";
  4. include "./../includes/inc_online.php";
  5.  
  6.  
  7. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  8. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  9.  
  10. if(!empty($id))
  11. {
  12. $q = mysql_query("select secur,golod,voodoo,nums,guns,cars,id,login,pass,money,level,police,health,zav,lsd,ban from users where id='".$id."';");
  13. }
  14. else
  15. {
  16. die ($lang['empty_login']."</body>
  17. </html>");
  18. }
  19.  
  20. $data = mysql_fetch_array($q);
  21.  
  22. $id=$data['id'];
  23. $login=$data['login'];
  24. $money=$data['money'];
  25. $level=$data['level'];
  26. $police=$data['police'];
  27. $stage=$data['stage'];
  28. $health=$data['health'];
  29. $cars=$data['cars'];
  30. $guns=$data['guns'];
  31. $nums=$data['nums'];
  32. $voo_por=$data['voodoo'];
  33. $golod=$data['golod'];
  34. $secur=$data['secur'];
  35. $zav=$data['zav'];
  36. $lsd=$data['lsd'];
  37. $ban=$data['ban'];
  38.  
  39. if($pass!=$data['pass'])
  40. {
  41. die ($lang['empty_login']."</body>
  42. </html>");
  43. }
  44.  
  45. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  46. if($ban==0)
  47. {
  48.  
  49. include "./../includes/inc_secur.php";
  50. include "./../includes/inc_golod.php";
  51. include "./../includes/inc_hospital.php";
  52. include "./../includes/inc_police.php";
  53. include "./../includes/inc_die.php";
  54. include "./../includes/inc_voodoo.php";
  55. include "./../includes/inc_attack.php";
  56. include "./../includes/inc_mes.php";
  57. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  58. print "<b>".$lang['game_city1']."</b><br/>";
  59. print "<u>[".$lang['ph_enter']."]</u><br/>";
  60.  
  61. switch ($mode)
  62. {
  63. case "sale":
  64.  
  65. if(!empty($p) && $money>=$p && ($health+$p)<=150 && ($p==50 || $p==70 || $p==100))
  66. {
  67. $p=cyr(htmlspecialchars(stripslashes(trim($p))));
  68. $money=$money-$p;
  69. $health=$health+($p-30);
  70. mysql_query("update users set health='$health',money='$money' where id='".$id."';");
  71. print $lang['city1_health_corrected']." <b>$p %</b>!<br/>";
  72. }
  73. elseif($money<=$p)
  74. {
  75. print $lang['city1_dont_have_money']."<br/>";
  76. }
  77. elseif(($health+$p)>=150)
  78. {
  79. print $lang['city1_health_cannot_be_more']." 150 %.<br/>";
  80. }
  81. elseif(empty($p))
  82. {
  83. print "<img src=\"./../pics/1.jpg\" alt=\"50 $$\"/><br/>";
  84. print "-<a href=\"public_house.php?id=$id&amp;pass=$pass&amp;mode=sale&amp;p=50\">".$lang['ph_kup']."</a><b>(50 $$)</b><br/>";
  85. print "<img src=\"./../pics/2.jpg\" alt=\"70 $$\"/><br/>";
  86. print "-<a href=\"public_house.php?id=$id&amp;pass=$pass&amp;mode=sale&amp;p=70\">".$lang['ph_kup']."</a><b>(70 $$)</b><br/>";
  87. print "<img src=\"./../pics/3.jpg\" alt=\"100 $$\"/><br/>";
  88. print "-<a href=\"public_house.php?id=$id&amp;pass=$pass&amp;mode=sale&amp;p=100\">".$lang['ph_kup']."</a><b>(100 $$)</b><br/>";
  89. }
  90. print "&gt;<a href=\"public_house.php?id=$id&amp;pass=$pass\">".$lang['ph_enter']."</a><br/>";
  91. break;
  92. default:
  93. print $lang['ph_mes']."<br/>";
  94. print "<a href=\"public_house.php?id=$id&amp;pass=$pass&amp;mode=sale\">".$lang['ph_kup_sh']."</a><br/>";
  95. break;
  96. }
  97.  
  98.  
  99.  
  100. print "---<br/>&gt;<a href=\"slum.php?id=$id&amp;pass=$pass\">".$lang['city1_slums']."</a>";
  101. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  102. print "<br/>---";
  103.  
  104. mysql_close();
  105. include "./../includes/footer2.php";
  106. }
  107.  
  108. elseif($ban==1)
  109. {
  110. die ($lang['empty_login']."</body>
  111. </html>");
  112.  
  113. }
  114. ?>