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

Размер файла: 10.02Kb
  1. <?php
  2. include "./../ini.php";
  3. include "./../includes/header.php";
  4. include "./../includes/inc_online.php";
  5. print "<p><small>";
  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 login,band,level,cars,id,pass,money from users where id='".$id."';");
  13. }
  14. else
  15. {
  16. die ($lang['empty_login']."</small></p></card></wml>");
  17. }
  18.  
  19. $data = mysql_fetch_array($q);
  20.  
  21. $id=$data['id'];
  22. $login=$data['login'];
  23. $money=$data['money'];
  24. $cars=$data['cars'];
  25. $level=$data['level'];
  26. $band=$data['band'];
  27.  
  28. if($pass!=$data['pass'])
  29. {
  30. die ($lang['empty_login']."</small></p></card></wml>");
  31. }
  32.  
  33. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  34.  
  35.  
  36. print "<b>".$lang['game_city1']."</b><br/>";
  37.  
  38. switch ($mode)
  39. {
  40. case "kup":
  41. if(mysql_num_rows(mysql_query("select id from osobnyaki where bandname='".$band."';"))>=1) die ($lang['os_uje']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  42. list($members,$bname,$bmoney)=mysql_fetch_array(mysql_query("select members,name,money from bands where name='".$band."';"));
  43. if(empty($type))
  44. {
  45. print '[<u>'.$lang['area_ag'].'</u>]<br/>';
  46. if(empty($band)) print $lang['os_neuch'];
  47. else
  48. {
  49. if(mysql_num_rows(mysql_query("select id from osobnyaki where bandname='".$band."';"))>=1) die ($lang['os_uje']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  50. if ($bmoney<=50000) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  51. print $lang['os_from_you_band'].' '.$bname.' '.$bmoney.'$$<br/>';
  52. print $lang['os_predl'];
  53. if($bmoney>50000 && $bmoney<=250000)
  54. {
  55. print $lang['os_1'];
  56. print "[<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=kup&amp;type=1\">".$lang['ph_kup']."</a>] (50.000 $$)<br/>";
  57. }
  58. if($bmoney>250000 && $bmoney<=750000)
  59. {
  60. print $lang['os_2'];
  61. print "[<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=kup&amp;type=2\">".$lang['ph_kup']."</a>] (250.000 $$)<br/>";
  62. }
  63. if($bmoney>750000)
  64. {
  65. print $lang['os_3'];
  66. print "[<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=kup&amp;type=3\">".$lang['ph_kup']."</a>] (750.000 $$)<br/>";
  67. }
  68. }
  69. }
  70. else
  71. {
  72. if(!intval($type)) die ($lang['error']."</small></p></card></wml>");
  73. if($type==1)
  74. {
  75. if(($bmoney-50000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  76. mysql_query("update bands set money='".$bmoney."'-'50000' where name='".$bname."';");
  77. mysql_query("insert into osobnyaki values('','".$bname."','1');");
  78. print $lang['os_yeah'].' 50.000$$!<br/>';
  79.  
  80. $band_members = explode(".", $members);
  81. $count_members=count($band_members);
  82. for($i=0;$i<$count_members;$i++)
  83. {
  84. $level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
  85. mysql_query("update users set level='".$level_ar['level']."'+'2' where login='".$band_members[$i]."';");
  86. }
  87.  
  88. }
  89. elseif($type==2)
  90. {
  91. if(($bmoney-250000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  92. mysql_query("update bands set money='".$bmoney."'-'250000' where name='".$bname."';");
  93. mysql_query("insert into osobnyaki values('','".$bname."','2');");
  94. print $lang['os_yeah'].' 250.000$$!<br/>';
  95.  
  96. $band_members = explode(".", $members);
  97. $count_members=count($band_members);
  98. for($i=0;$i<$count_members;$i++)
  99. {
  100. $level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
  101. mysql_query("update users set level='".$level_ar['level']."'+'5' where login='".$band_members[$i]."';");
  102. }
  103.  
  104. }
  105. elseif($type==3)
  106. {
  107. if(($bmoney-750000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  108. mysql_query("update bands set money='".$bmoney."'-'750000' where name='".$bname."';");
  109. mysql_query("insert into osobnyaki values('','".$bname."','3');");
  110. print $lang['os_yeah'].' 750.000$$!<br/>';
  111.  
  112. $band_members = explode(".", $members);
  113. $count_members=count($band_members);
  114. for($i=0;$i<$count_members;$i++)
  115. {
  116. $level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
  117. mysql_query("update users set level='".$level_ar['level']."'+'10' where login='".$band_members[$i]."';");
  118. }
  119.  
  120. }
  121. else die ($lang['error']."</small></p></card></wml>");
  122. }
  123.  
  124. print "&gt;<a href=\"osobnyaki.php?id=$id&amp;pass=$pass\">".$lang['el_2avenu']."</a><br/>";
  125. break;
  126.  
  127.  
  128. case "see":
  129.  
  130. include './../functions/func_pagination.php';
  131.  
  132. $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
  133. $base_url="osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=see&amp;start=";
  134. $num_items=mysql_num_rows(mysql_query("select id from osobnyaki;"));
  135.  
  136. print '<u>['.$lang['os_obnyaki'].']</u><br/>';
  137.  
  138. if(mysql_num_rows(mysql_query("select id from osobnyaki where bandname='".$band."';"))>=1)
  139. print str_replace('$','$$','<a href="osobnyaki.php?id='.$id.'&amp;pass='.$pass.'&amp;mode=my">'.$lang['os_obnyak'].' '.$band.'</a><br/>');
  140.  
  141.  
  142. $i=0;
  143. $now_q = mysql_query("select bandname,type from osobnyaki order by id desc limit $start,$per_page_o;");
  144. if(mysql_num_rows($now_q)<1) print $lang['os_no_os'];
  145. while($now_arr=mysql_fetch_array($now_q))
  146. {
  147. ++$i;
  148. $nom=$i+$start;
  149. if($now_arr['type']==1) $znak='<b>+</b>';
  150. elseif($now_arr['type']==2) $znak='<b>*</b>';
  151. elseif($now_arr['type']==3) $znak='<b>!</b>';
  152. print str_replace('$','$$','<u>'.$nom.'</u>.<a href="../bands/viewband.php?id='.$id.'&amp;pass='.$pass.'&amp;band='.urlencode($now_arr['bandname']).'">'.$now_arr['bandname'].'</a> '.$znak.'<br/>');
  153.  
  154. }
  155.  
  156. $pagination = generate_pagination($base_url, $num_items, $per_page_o, $start);
  157.  
  158. if(!empty($pagination))print '---<br/>'.$pagination;
  159. print "<br/>&gt;<a href=\"osobnyaki.php?id=$id&amp;pass=$pass\">".$lang['el_2avenu']."</a><br/>";
  160. break;
  161.  
  162. case "my":
  163.  
  164. list($bname,$type)=mysql_fetch_array(mysql_query("select bandname,type from osobnyaki where bandname='".$band."';"));
  165. list($members,$bname,$boss,$bmoney)=mysql_fetch_array(mysql_query("select members,name,boss,money from bands where name='".$band."';"));
  166.  
  167. if(empty($type))die ($lang['error']."</small></p></card></wml>");
  168.  
  169. if($type==1) $znak='<b>+</b>';
  170. elseif($type==2) $znak='<b>*</b>';
  171. elseif($type==3) $znak='<b>!</b>';
  172.  
  173. print '[<u>'.$bname.'</u> '.$znak.']<br/>';
  174.  
  175. print $lang['os_mes'];
  176.  
  177. if(!empty($obed))
  178. {
  179. $band_members = explode(".", $members);
  180. $count_members=count($band_members);
  181. for($i=0;$i<$count_members;$i++)
  182. {
  183. mysql_query("update users set golod='150' where login='".$band_members[$i]."';");
  184. }
  185. print $lang['os_golod'];
  186.  
  187. $rand=rand(1,500);
  188. if(($bmoney-$rand)<=0) $rand=$bmoney;
  189. mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
  190. print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
  191. }
  192. if(!empty($vrach))
  193. {
  194. if($type!=2 && $type!=3)die ($lang['error']."</small></p></card></wml>");
  195. $band_members = explode(".", $members);
  196. $count_members=count($band_members);
  197. for($i=0;$i<$count_members;$i++)
  198. {
  199. mysql_query("update users set health='150' where login='".$band_members[$i]."';");
  200. }
  201. print $lang['os_health'];
  202.  
  203. $rand=rand(1,500);
  204. if(($bmoney-$rand)<=0) $rand=$bmoney;
  205. mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
  206. print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
  207.  
  208. }
  209. if(!empty($grim))
  210. {
  211. if($type!=3)die ($lang['error']."</small></p></card></wml>");
  212. $band_members = explode(".", $members);
  213. $count_members=count($band_members);
  214. for($i=0;$i<$count_members;$i++)
  215. {
  216. mysql_query("update users set police='0' where login='".$band_members[$i]."';");
  217. }
  218. print $lang['os_police'];
  219.  
  220. $rand=rand(1,500);
  221. if(($bmoney-$rand)<=0) $rand=$bmoney;
  222. mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
  223. print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
  224.  
  225. }
  226. if(!empty($voodoo))
  227. {
  228. if($type!=3)die ($lang['error']."</small></p></card></wml>");
  229. $band_members = explode(".", $members);
  230. $count_members=count($band_members);
  231. for($i=0;$i<$count_members;$i++)
  232. {
  233. mysql_query("update users set voodoo='' where login='".$band_members[$i]."';");
  234. }
  235. print $lang['os_voodoo'];
  236.  
  237. $rand=rand(1,500);
  238. if(($bmoney-$rand)<=0) $rand=$bmoney;
  239. mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
  240. print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
  241.  
  242. }
  243. if(!empty($sale))
  244. {
  245. if($boss!=$login) die ($lang['error']."</small></p></card></wml>");
  246.  
  247. $rand=rand(1000,50000);
  248. mysql_query("update bands set money='".$bmoney."'+'".$rand."' where name='".$band."';");
  249.  
  250. mysql_query("delete from osobnyaki where bandname='".$band."';");
  251. print $lang['os_saled'].' '.$rand.'$$!<br/>';
  252. }
  253.  
  254. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=my&amp;obed=1\">".$lang['os_obed']."</a><br/>";
  255. if($type==2 || $type==3)
  256. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=my&amp;vrach=1\">".$lang['os_vrach']."</a><br/>";
  257. if($type==3)
  258. {
  259. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=my&amp;grim=1\">".$lang['os_grim']."</a><br/>";
  260. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=my&amp;voodoo=1\">".$lang['os_prokl']."</a><br/>";
  261. }
  262. if($boss==$login)
  263. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=my&amp;sale=1\">".$lang['os_sale_boss']."</a><br/>";
  264. print "&gt;<a href=\"osobnyaki.php?id=$id&amp;pass=$pass\">".$lang['el_2avenu']."</a><br/>";
  265. break;
  266.  
  267.  
  268.  
  269. default:
  270. print "<u>[".$lang['el_2avenu']."]</u><br/>";
  271. print $lang['os_enter'];
  272. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=kup\">".$lang['os_nedvij']."</a><br/>";
  273. print "-<a href=\"osobnyaki.php?id=$id&amp;pass=$pass&amp;mode=see\">".$lang['os_obnyaki']."</a><br/>";
  274.  
  275. break;
  276. }
  277.  
  278. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  279. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  280. print "<br/>---";
  281.  
  282. mysql_close();
  283. include "./../includes/footer.php";
  284. ?>