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

Размер файла: 5.7Kb
  1. <?php
  2.  
  3. include "./../ini3.php";
  4. include "./../includes/header2.php";
  5. include "./../includes/inc_online.php";
  6.  
  7.  
  8. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  9. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  10.  
  11. if(!empty($id))
  12. {
  13. $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."';");
  14. }
  15. else
  16. {
  17. die ($lang['empty_login']."</body>
  18. </html>");
  19. }
  20.  
  21. $data = mysql_fetch_array($q);
  22.  
  23. $id=$data['id'];
  24. $login=$data['login'];
  25. $money=$data['money'];
  26. $level=$data['level'];
  27. $police=$data['police'];
  28. $stage=$data['stage'];
  29. $health=$data['health'];
  30. $cars=$data['cars'];
  31. $guns=$data['guns'];
  32. $nums=$data['nums'];
  33. $voo_por=$data['voodoo'];
  34. $golod=$data['golod'];
  35. $secur=$data['secur'];
  36. $zav=$data['zav'];
  37. $lsd=$data['lsd'];
  38. $ban=$data['ban'];
  39.  
  40. if($pass!=$data['pass'])
  41. {
  42. die ($lang['empty_login']."</body>
  43. </html>");
  44. }
  45.  
  46. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  47. if($ban==0)
  48. {
  49.  
  50.  
  51. include "./../includes/inc_secur.php";
  52. include "./../includes/inc_golod.php";
  53. include "./../includes/inc_hospital.php";
  54. include "./../includes/inc_police.php";
  55. include "./../includes/inc_die.php";
  56. include "./../includes/inc_voodoo.php";
  57. include "./../includes/inc_attack.php";
  58. include "./../includes/inc_mes.php";
  59. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  60. print "<b>".$lang['game_city1']."</b><br/>";
  61. print "<u>[".$lang['area_kasino']."]</u><br/>";
  62.  
  63. switch ($mode)
  64. {
  65. case "k0":
  66.  
  67.  
  68. global $b;
  69. global $gwin;
  70. global $gover;
  71. $cdiff = 'Normal';
  72.  
  73. if (isset($new))
  74. {
  75. unset($b);
  76. unset($turn);
  77. mysql_query("delete from kasino where userid='".$id."';");
  78. }
  79.  
  80. if (!isset($turn)) $turn=1;
  81.  
  82. if(!empty($h))
  83. {
  84. $h=base64_decode($h);
  85. $b=explode(".",$h);
  86. }
  87.  
  88. include "./../functions/func_casino.php";
  89.  
  90. print "</small><table columns=\"3\" align=\"LL\">";
  91.  
  92. if (isset($mv))
  93. $b[$mv]='x';
  94.  
  95. checkwin();
  96. checkfull();
  97.  
  98.  
  99.  
  100. if ($gover <> 1 && $gwin == '' && $mv <> '')
  101. {
  102. $what=rand(1,2);
  103. if($what==1)
  104. {
  105. compmove();
  106.  
  107. if ($cmv == '')
  108. {
  109. comprand();
  110. }
  111. }
  112. else
  113. {
  114. compmove();
  115. if ($cmv == '')
  116. {
  117. if ($b[4] == '')
  118. $cmv=4;
  119. elseif ($b[0] == '')
  120. $cmv=0;
  121. elseif ($b[2] == '')
  122. $cmv=2;
  123. elseif ($b[6] == '')
  124. $cmv=6;
  125. elseif ($b[8] == '')
  126. $cmv=8;
  127. if ($cmv == '')
  128. comprand();
  129. }
  130. }
  131.  
  132. $b[$cmv] = 'o';
  133. }
  134.  
  135. checkwin();
  136. checkfull();
  137.  
  138.  
  139.  
  140. for ($i = 0; $i <= 8; $i++)
  141. {
  142. if ($i == 0 || $i == 3 || $i == 6)
  143. print '<tr>';
  144. print '<td>';
  145.  
  146. if ($b[$i] == 'x')
  147. print 'X';
  148. elseif ($b[$i] == 'o')
  149. print '0';
  150. elseif ($gwin == '')
  151. {
  152.  
  153. print "<anchor>".$i."
  154. <go href=\"kasino.php?mv=$i&amp;id=$id&amp;pass=$pass&amp;mode=k0\" method=\"post\">
  155. <postfield name=\"h\" value=\"".base64_encode("$b[0].$b[1].$b[2].$b[3].$b[4].$b[5].$b[6].$b[7].$b[8]")."\"/></go></anchor>";
  156. }
  157.  
  158. print '</td>';
  159. if ($i == 2 || $i == 5 || $i == 8)
  160. print '</tr>';
  161. }
  162.  
  163.  
  164. print "</table><small>";
  165.  
  166.  
  167. if ($gwin == 'X')
  168. {
  169. $k_db=mysql_fetch_array(mysql_query("select combo from kasino where userid='".$id."' and combo='".$h."';"));
  170.  
  171. if($k_db['combo']!=$h)
  172. {
  173. mysql_query("insert into kasino values(0,'".$id."','".$h."');");
  174. $val=rand(1,100);
  175. $money=$money+$val;
  176. mysql_query("update users set money='".$money."' where id='".$id."'");
  177. print "<b>".$lang['kasino_you_win']." ".$val."$$</b><br/>";
  178. }
  179. else
  180. {
  181. mysql_query("delete from kasino where userid='".$id."';");
  182. $new=$lang['kasino_new_game'];
  183. $money=$money-300;
  184. if($money<=0) $money=0;
  185. mysql_query("update users set money='".$money."' where id='".$id."'");
  186. print "<b>".$lang['kasino_you_lose']." 300$$</b><br/>";
  187. }
  188.  
  189. }
  190. elseif ($gwin == 'O')
  191. {
  192. $h='';
  193. $val=rand(1,100);
  194. $money=$money-$val;
  195. if($money<=0) $money=0;
  196. mysql_query("update users set money='".$money."' where id='".$id."'");
  197. print "<b>".$lang['kasino_you_lose']." ".$val."$$</b><br/>";
  198. }
  199. elseif ($gover == 1)
  200. {
  201. print "<b>".$lang['kasino_nichya']."</b><br/>";
  202. }
  203.  
  204. print "<anchor>".$lang['kasino_new_game']."<go href=\"".$PHP_SELF."?id=$id&amp;pass=$pass&amp;mode=k0\" method=\"post\">
  205. <postfield name=\"new\" value=\"".$lang['kasino_new_game']."\"/>
  206. </go></anchor><br/>";
  207. print "&gt;<a href=\"kasino.php?id=$id&amp;pass=$pass\">".$lang['area_kasino']."</a><br/>";
  208. break;
  209. default:
  210.  
  211.  
  212. print '<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  213.  
  214. break;
  215. }
  216.  
  217. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  218. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  219. print "<br/>---";
  220.  
  221. mysql_close();
  222. include "./../includes/footer2.php";
  223. }
  224.  
  225. elseif($ban==1)
  226. {
  227. die ($lang['empty_login']."</body>
  228. </html>");
  229.  
  230. }
  231. ?>