Advertisement
Guest User

shopsystem.php

a guest
Jun 7th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 71.80 KB | None | 0 0
  1. <?php
  2. if(!defined('INITIALIZED'))
  3.     exit;
  4.    
  5. if($config['site']['shop_system'] == 1) {
  6. if($logged)
  7. $user_premium_points = $account_logged->getCustomField('premium_points');
  8. else
  9. $user_premium_points = 'Login first';
  10.  
  11. function getItemByID($id)
  12. {
  13. $id = (int) $id;
  14. $SQL = $GLOBALS['SQL'];
  15. $data = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' WHERE '.$SQL->fieldName('id').' = '.$SQL->quote($id).';')->fetch();
  16. if ($data['offer_type'] == 'pacc')
  17. {
  18. $offer['id'] = $data['id'];
  19. $offer['type'] = $data['offer_type'];
  20. $offer['days'] = $data['count1'];
  21. $offer['points'] = $data['points'];
  22. $offer['description'] = $data['offer_description'];
  23. $offer['name'] = $data['offer_name'];
  24. }
  25. elseif ($data['offer_type'] == 'item')
  26. {
  27. $offer['id'] = $data['id'];
  28. $offer['type'] = $data['offer_type'];
  29. $offer['item_id'] = $data['itemid1'];
  30. $offer['item_count'] = $data['count1'];
  31. $offer['points'] = $data['points'];
  32. $offer['description'] = $data['offer_description'];
  33. $offer['name'] = $data['offer_name'];
  34. }
  35. elseif ($data['offer_type'] == 'vipdays')
  36. {
  37. $offer['id'] = $data['id'];
  38. $offer['type'] = $data['offer_type'];
  39. $offer['days'] = $data['count1'];
  40. $offer['points'] = $data['points'];
  41. $offer['description'] = $data['offer_description'];
  42. $offer['name'] = $data['offer_name'];
  43. }
  44. elseif ($data['offer_type'] == 'itemvip')
  45. {
  46. $offer['id'] = $data['id'];
  47. $offer['type'] = $data['offer_type'];
  48. $offer['item_id'] = $data['itemid1'];
  49. $offer['item_count'] = $data['count1'];
  50. $offer['points'] = $data['points'];
  51. $offer['description'] = $data['offer_description'];
  52. $offer['name'] = $data['offer_name'];
  53. }
  54. elseif ($data['offer_type'] == 'container')
  55. {
  56. $offer['id'] = $data['id'];
  57. $offer['type'] = $data['offer_type'];
  58. $offer['container_id'] = $data['itemid2'];
  59. $offer['container_count'] = $data['count2'];
  60. $offer['item_id'] = $data['itemid1'];
  61. $offer['item_count'] = $data['count1'];
  62. $offer['points'] = $data['points'];
  63. $offer['description'] = $data['offer_description'];
  64. $offer['name'] = $data['offer_name'];
  65. }
  66. elseif ($data['offer_type'] == 'unban')
  67. {
  68. $offer['id'] = $data['id'];
  69. $offer['type'] = $data['offer_type'];
  70. $offer['points'] = $data['points'];
  71. $offer['description'] = $data['offer_description'];
  72. $offer['name'] = $data['offer_name'];
  73. }
  74.  
  75. elseif ($data['offer_type'] == 'redskull')
  76. {
  77. $offer['id'] = $data['id'];
  78. $offer['type'] = $data['offer_type'];
  79. $offer['points'] = $data['points'];
  80. $offer['description'] = $data['offer_description'];
  81. $offer['name'] = $data['offer_name'];
  82. }
  83. elseif ($data['offer_type'] == 'itemlogout')
  84. {
  85. $offer['id'] = $data['id'];
  86. $offer['type'] = $data['offer_type'];
  87. $offer['points'] = $data['points'];
  88. $offer['description'] = $data['offer_description'];
  89. $offer['pid'] = $data['pid'];
  90. $offer['count1'] = $data['count1'];
  91. $offer['item_id'] = $data['itemid1'];
  92. $offer['free_cap'] = $data['free_cap'];
  93. }
  94. elseif ($data['offer_type'] == 'changename')
  95. {
  96. $offer['id'] = $data['id'];
  97. $offer['type'] = $data['offer_type'];
  98. $offer['points'] = $data['points'];
  99. $offer['description'] = $data['offer_description'];
  100. $offer['name'] = $data['offer_name'];
  101. }
  102. return $offer;
  103. }
  104.  
  105. function getOfferArray()
  106. {
  107. $offer_list = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_shop_offer').';');
  108. $i_pacc = 0;
  109. $i_item = 0;
  110. $i_vipdays = 0;
  111. $i_itemvip = 0;
  112. $i_container = 0;
  113. $i_unban = 0;
  114. $i_redskull = 0;
  115. $i_itemlogout = 0;
  116. $i_changename = 0;
  117. while($data = $offer_list->fetch()) {
  118. if ($data['offer_type'] == 'pacc')
  119. {
  120. $offer_array['pacc'][$i_pacc]['id'] = $data['id'];
  121. $offer_array['pacc'][$i_pacc]['days'] = $data['count1'];
  122. $offer_array['pacc'][$i_pacc]['points'] = $data['points'];
  123. $offer_array['pacc'][$i_pacc]['description'] = $data['offer_description'];
  124. $offer_array['pacc'][$i_pacc]['name'] = $data['offer_name'];
  125. $i_pacc++;
  126. }
  127. elseif ($data['offer_type'] == 'item')
  128. {
  129. $offer_array['item'][$i_item]['id'] = $data['id'];
  130. $offer_array['item'][$i_item]['item_id'] = $data['itemid1'];
  131. $offer_array['item'][$i_item]['item_count'] = $data['count1'];
  132. $offer_array['item'][$i_item]['points'] = $data['points'];
  133. $offer_array['item'][$i_item]['description'] = $data['offer_description'];
  134. $offer_array['item'][$i_item]['name'] = $data['offer_name'];
  135. $i_item++;
  136. }
  137. elseif ($data['offer_type'] == 'vipdays')
  138. {
  139. $offer_array['vipdays'][$i_vipdays]['id'] = $data['id'];
  140. $offer_array['vipdays'][$i_vipdays]['days'] = $data['count1'];
  141. $offer_array['vipdays'][$i_vipdays]['points'] = $data['points'];
  142. $offer_array['vipdays'][$i_vipdays]['description'] = $data['offer_description'];
  143. $offer_array['vipdays'][$i_vipdays]['name'] = $data['offer_name'];
  144. $i_vipdays++;
  145. }
  146. elseif ($data['offer_type'] == 'itemvip')
  147. {
  148. $offer_array['itemvip'][$i_itemvip]['id'] = $data['id'];
  149. $offer_array['itemvip'][$i_itemvip]['item_id'] = $data['itemid1'];
  150. $offer_array['itemvip'][$i_itemvip]['item_count'] = $data['count1'];
  151. $offer_array['itemvip'][$i_itemvip]['points'] = $data['points'];
  152. $offer_array['itemvip'][$i_itemvip]['description'] = $data['offer_description'];
  153. $offer_array['itemvip'][$i_itemvip]['name'] = $data['offer_name'];
  154. $i_itemvip++;
  155. }
  156. elseif ($data['offer_type'] == 'container')
  157. {
  158. $offer_array['container'][$i_container]['id'] = $data['id'];
  159. $offer_array['container'][$i_container]['container_id'] = $data['itemid2'];
  160. $offer_array['container'][$i_container]['container_count'] = $data['count2'];
  161. $offer_array['container'][$i_container]['item_id'] = $data['itemid1'];
  162. $offer_array['container'][$i_container]['item_count'] = $data['count1'];
  163. $offer_array['container'][$i_container]['points'] = $data['points'];
  164. $offer_array['container'][$i_container]['description'] = $data['offer_description'];
  165. $offer_array['container'][$i_container]['name'] = $data['offer_name'];
  166. $i_container++;
  167. }
  168. elseif ($data['offer_type'] == 'unban')
  169. {
  170. $offer_array['unban'][$i_unban]['id'] = $data['id'];
  171. $offer_array['unban'][$i_unban]['points'] = $data['points'];
  172. $offer_array['unban'][$i_unban]['description'] = $data['offer_description'];
  173. $offer_array['unban'][$i_unban]['name'] = $data['offer_name'];
  174. $i_unban++;
  175. }
  176. elseif ($data['offer_type'] == 'redskull')
  177. {
  178. $offer_array['redskull'][$i_redskull]['id'] = $data['id'];
  179. $offer_array['redskull'][$i_redskull]['points'] = $data['points'];
  180. $offer_array['redskull'][$i_redskull]['description'] = $data['offer_description'];
  181. $offer_array['redskull'][$i_redskull]['name'] = $data['offer_name'];
  182. $i_redskull++;
  183. }
  184. elseif ($data['offer_type'] == 'itemlogout')
  185. {
  186. $offer_array['itemlogout'][$i_itemlogout]['id'] = $data['id'];
  187. $offer_array['itemlogout'][$i_itemlogout]['points'] = $data['points'];
  188. $offer_array['itemlogout'][$i_itemlogout]['description'] = $data['offer_description'];
  189. $offer_array['itemlogout'][$i_itemlogout]['name'] = $data['offer_name'];
  190. $offer_array['itemlogout'][$i_itemlogout]['count1'] = $data['count1'];
  191. $offer_array['itemlogout'][$i_itemlogout]['pid'] = $data['pid'];
  192. $offer_array['itemlogout'][$i_itemlogout]['item_id'] = $data['itemid1'];
  193. $offer_array['itemlogout'][$i_itemlogout]['free_cap'] = $data['free_cap'];
  194. $i_itemlogout++;
  195. }
  196. elseif ($data['offer_type'] == 'changename')
  197. {
  198. $offer_array['changename'][$i_changename]['id'] = $data['id'];
  199. $offer_array['changename'][$i_changename]['points'] = $data['points'];
  200. $offer_array['changename'][$i_changename]['description'] = $data['offer_description'];
  201. $offer_array['changename'][$i_changename]['name'] = $data['offer_name'];
  202. $i_changename++;
  203. }
  204. }
  205. return $offer_array;
  206. }
  207.  
  208. if($action == '') {
  209. unset($_SESSION['viewed_confirmation_page']);
  210. $main_content .= '<h2><center>Welcome to '.$config['server']['serverName'].' Shop</center></h2>';
  211. $offer_list = getOfferArray();
  212. //show list of vipdays offers
  213. if(count($offer_list['vipdays']) > 0) {
  214. $main_content .= '
  215. <div class="TableContainer">
  216. <div class="CaptionContainer">
  217. <div class="CaptionInnerContainer">
  218. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  219. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  220. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  221. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  222. <div class="Text">Upgrade Account</div>
  223. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  224. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  225. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  226. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  227. </div>
  228. </div>
  229. <table class="Table5" cellpadding="0" cellspacing="0">
  230. <tbody>
  231. <tr>
  232. <td>
  233. <div class="InnerTableContainer">
  234. <table style="width:100%;">
  235. <tbody>
  236. <tr>
  237. <td>
  238. <div class="TableShadowContainerRightTop">
  239. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  240. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  241. <div class="TableContentContainer">
  242. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  243. <tbody>
  244. <tr bgcolor="#D4C0A1">
  245. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  246. <td valign="middle" width="60%"><b>Description</b></td>
  247. <td valign="middle">&nbsp;</td>
  248. </tr>';
  249. foreach($offer_list['vipdays'] as $vipdays) {
  250. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  251. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/shop/vip.gif" /></td>
  252. <td><font style="font-size:16px; font-weight:bold;">'.$vipdays['name'].'</font>&nbsp;<small>('.$vipdays['points'].' points)</small><br />'.$vipdays['description'].'</td>
  253. <td align="center">';
  254. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  255. $main_content .= '
  256. <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
  257. <input type="hidden" name="buy_id" value="'.$vipdays['id'].'">
  258. <table border="0" cellpadding="0" cellspacing="0">
  259. <tbody>
  260. <tr>
  261. <td style="border: 0px none;">
  262. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  263. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  264. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  265. </div>
  266. </div>
  267. </td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. </form>';
  272. $main_content .= '</td></tr>';
  273. }
  274. $main_content .= '</tbody>
  275. </table>
  276. </div>
  277. </div>
  278. <div class="TableShadowContainer">
  279. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  280. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  281. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  282. </div>
  283. </div>
  284. </td>
  285. </tr>
  286. </tbody>
  287. </table>
  288. </div>
  289. </td>
  290. </tr>
  291. </tbody>
  292. </table>
  293. </div><br />';}
  294. //show list of itemsvip offers
  295. if(count($offer_list['itemvip']) > 0) {
  296. $main_content .= '
  297. <div class="TableContainer">
  298. <div class="CaptionContainer">
  299. <div class="CaptionInnerContainer">
  300. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  301. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  302. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  303. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  304. <div class="Text">Items VIP</div>
  305. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  306. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  307. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  308. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  309. </div>
  310. </div>
  311. <table class="Table5" cellpadding="0" cellspacing="0">
  312. <tbody>
  313. <tr>
  314. <td>
  315. <div class="InnerTableContainer">
  316. <table style="width:100%;">
  317. <tbody>
  318. <tr>
  319. <td>
  320. <div class="TableShadowContainerRightTop">
  321. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  322. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  323. <div class="TableContentContainer">
  324. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  325. <tbody>
  326. <tr bgcolor="#D4C0A1">
  327. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  328. <td valign="middle" width="60%"><b>Description</b></td>
  329. <td valign="middle">&nbsp;</td>
  330. </tr>';
  331. foreach($offer_list['itemvip'] as $itemvip) {
  332. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  333. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center">'; if(file_exists('images/items/'.$itemvip['item_id'].'.gif')) { $main_content .= '<br /><img src="images/items/'.$itemvip['item_id'].'.gif" height="32" width="32"><br /><small><b>'.$itemvip['name'].'</b></small><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32"><br /><small><b>'.$itemvip['name'].'</b></small>'; }
  334. $main_content .='</td><td><b>'.$itemvip['name'].'</b> ('.$itemvip['points'].' points)<br />'.$itemvip['description'].'</td><td align="center">';
  335. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  336. $main_content .= '
  337. <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
  338. <input type="hidden" name="buy_id" value="'.$itemvip['id'].'">
  339. <table border="0" cellpadding="0" cellspacing="0">
  340. <tbody>
  341. <tr>
  342. <td style="border: 0px none;">
  343. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  344. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  345. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  346. </div>
  347. </div>
  348. </td>
  349. </tr>
  350. </tbody>
  351. </table>
  352. </form>';
  353. $main_content .= '</td></tr>';
  354. }
  355. $main_content .= '</tbody>
  356. </table>
  357. </div>
  358. </div>
  359. <div class="TableShadowContainer">
  360. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  361. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  362. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  363. </div>
  364. </div>
  365. </td>
  366. </tr>
  367. </tbody>
  368. </table>
  369. </div>
  370. </td>
  371. </tr>
  372. </tbody>
  373. </table>
  374. </div><br />';}
  375. //show list of items offers
  376. if(count($offer_list['item']) > 0 or count($offer_list['itemlogout']) > 0)
  377. $main_content .= '
  378. <div class="TableContainer">
  379. <div class="CaptionContainer">
  380. <div class="CaptionInnerContainer">
  381. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  382. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  383. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  384. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  385. <div class="Text">Items</div>
  386. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  387. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  388. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  389. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  390. </div>
  391. </div>
  392. <table class="Table5" cellpadding="0" cellspacing="0">
  393. <tbody>
  394. <tr>
  395. <td>
  396. <div class="InnerTableContainer">
  397. <table style="width:100%;">
  398. <tbody>
  399. <tr>
  400. <td>
  401. <div class="TableShadowContainerRightTop">
  402. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  403. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  404. <div class="TableContentContainer">
  405. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  406. <tbody>
  407. <tr bgcolor="#D4C0A1">
  408. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  409. <td valign="middle" width="60%"><b>Description</b></td>
  410. <td valign="middle">&nbsp;</td>
  411.  
  412. </tr>';
  413. if(count($offer_list['item']) > 0) {
  414. foreach($offer_list['item'] as $item) {
  415. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  416. $main_content .= '
  417. <tr bgcolor="'.$config['site']['lightborder'].'">
  418. <td valign="middle" align="center">'; if(file_exists('images/items/'.$item['item_id'].'.gif')) { $main_content .= '<br /><img src="images/items/'.$item['item_id'].'.gif" height="32" width="32"><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32">'; }
  419. $main_content .='
  420. </td>
  421. <td><font style="font-size:16px; font-weight:bold;">'.$item['name'].'</font>&nbsp;';
  422. $main_content .='<small>('.$item['points'].' points)</small>';
  423. $main_content .='<br />
  424. '.$item['description'].'
  425. </td>
  426. <td valign="middle" align="center">';
  427. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  428. $main_content .= '
  429. <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
  430. <input type="hidden" name="buy_id" value="'.$item['id'].'">
  431. <table border="0" cellpadding="0" cellspacing="0">
  432. <tbody>
  433. <tr>
  434. <td style="border: 0px none;">
  435. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  436. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  437. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  438. </div>
  439. </div>
  440. </td>
  441. </tr>
  442. </tbody>
  443. </table>
  444. </form>';
  445. $main_content .= '</td></tr>';
  446. }
  447. $main_content .= '</tbody>
  448. </table>
  449. </div>
  450. </div>
  451. <div class="TableShadowContainer">
  452. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  453. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  454. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  455. </div>
  456. </div>
  457. </td>
  458. </tr>
  459. </tbody>
  460. </table>
  461. </div>
  462. </td>
  463. </tr>
  464. </tbody>
  465. </table>
  466. </div><br />';
  467. }
  468. //show list of containers offers
  469.  
  470. if(count($offer_list['itemlogout']) > 0) {
  471. $main_content .= '
  472. <div class="TableContainer">
  473. <div class="CaptionContainer">
  474. <div class="CaptionInnerContainer">
  475. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  476. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  477. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  478. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  479. <div class="Text">Items Logout</div>
  480. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  481. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  482. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  483. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  484. </div>
  485. </div>
  486. <table class="Table5" cellpadding="0" cellspacing="0">
  487. <tbody>
  488. <tr>
  489. <td>
  490. <div class="InnerTableContainer">
  491. <table style="width:100%;">
  492. <tbody>
  493. <tr>
  494. <td>
  495. <div class="TableShadowContainerRightTop">
  496. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  497. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  498. <div class="TableContentContainer">
  499. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  500. <tbody>
  501. <tr bgcolor="#D4C0A1">
  502. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  503. <td valign="middle" width="60%"><b>Description</b></td>
  504. <td valign="middle">&nbsp;</td>
  505. </tr>';
  506. foreach($offer_list['itemlogout'] as $itemlogout) {
  507. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  508. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/items/'.$itemlogout['id'].'.gif"></td><td><b>'.$itemlogout['name'].'</b> ('.$itemlogout['points'].' points)<br />'.$itemlogout['description'].'</td><td align="center">';
  509. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  510. $main_content .= '
  511. <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
  512. <input type="hidden" name="buy_id" value="'.$itemlogout['id'].'">
  513. <table border="0" cellpadding="0" cellspacing="0">
  514. <tbody>
  515. <tr>
  516. <td style="border: 0px none;">
  517. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  518. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  519. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  520. </div>
  521. </div>
  522. </td>
  523. </tr>
  524. </tbody>
  525. </table>
  526. </form>';
  527. $main_content .= '</td></tr>';
  528. }
  529. $main_content .= '</tbody>
  530. </table>
  531. </div>
  532. </div>
  533. <div class="TableShadowContainer">
  534. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  535. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  536. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  537. </div>
  538. </div>
  539. </td>
  540. </tr>
  541. </tbody>
  542. </table>
  543. </div>
  544. </td>
  545. </tr>
  546. </tbody>
  547. </table>
  548. </div><br />';}
  549. if(count($offer_list['container']) > 0) {
  550. $main_content .= '
  551. <div class="TableContainer">
  552. <div class="CaptionContainer">
  553. <div class="CaptionInnerContainer">
  554. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  555. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  556. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  557. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  558. <div class="Text">Containers Of Items</div>
  559. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  560. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  561. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  562. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  563. </div>
  564. </div>
  565. <table class="Table5" cellpadding="0" cellspacing="0">
  566. <tbody>
  567. <tr>
  568. <td>
  569. <div class="InnerTableContainer">
  570. <table style="width:100%;">
  571. <tbody>
  572. <tr>
  573. <td>
  574. <div class="TableShadowContainerRightTop">
  575. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  576. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  577. <div class="TableContentContainer">
  578. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  579. <tbody>
  580. <tr bgcolor="#D4C0A1">
  581. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  582. <td valign="middle" width="60%"><b>Description</b></td>
  583. <td valign="middle">&nbsp;</td>
  584.  
  585. </tr>';
  586. foreach($offer_list['container'] as $container) {
  587. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  588. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center">'; if(file_exists('images/items/'.$container['item_id'].'.gif')) { $main_content .= '<img src="images/items/'.$container['item_id'].'.gif" height="32" width="32">'; } else { $main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">'; } $main_content .='</td>
  589. <td><b>'.$container['name'].'</b> ('.$container['points'].' points)<br />'.$container['description'].'</td><td align="center">';
  590. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  591. $main_content .= '
  592. <form action="?subtopic=shopsystem&action=select_player" method="POST">
  593. <input type="hidden" name="buy_id" value="'.$container['id'].'">
  594. <table border="0" cellpadding="0" cellspacing="0">
  595. <tbody>
  596. <tr>
  597. <td style="border: 0px none;">
  598. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  599. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  600. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  601. </div>
  602. </div>
  603. </td>
  604. </tr>
  605. </tbody>
  606. </table>
  607. </form>';
  608. $main_content .= '</td></tr>';
  609. }
  610. $main_content .= '</tbody>
  611. </table>
  612. </div>
  613. </div>
  614. <div class="TableShadowContainer">
  615. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  616. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  617. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  618. </div>
  619. </div>
  620. </td>
  621. </tr>
  622. </tbody>
  623. </table>
  624. </div>
  625. </td>
  626. </tr>
  627. </tbody>
  628. </table>
  629. </div><br />';}
  630. if(count($offer_list['changename']) > 0 or count($offer_list['pacc']) > 0 or count($offer_list['redskull']) > 0 or count($offer_list['unban']) > 0){
  631. $main_content .= '
  632. <div class="TableContainer">
  633. <div class="CaptionContainer">
  634. <div class="CaptionInnerContainer">
  635. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  636. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  637. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  638. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  639. <div class="Text">Items &amp; Additional</div>
  640. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  641. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  642. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  643. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  644. </div>
  645. </div>
  646. <table class="Table5" cellpadding="0" cellspacing="0">
  647. <tbody>
  648. <tr>
  649. <td>
  650. <div class="InnerTableContainer">
  651. <table style="width:100%;">
  652. <tbody>
  653. <tr>
  654. <td>
  655. <div class="TableShadowContainerRightTop">
  656. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  657. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  658. <div class="TableContentContainer">
  659. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  660. <tbody>
  661. <tr bgcolor="#D4C0A1">
  662. <td valign="middle" width="10%" align="center"><b>Product</b></td>
  663. <td valign="middle" width="60%"><b>Description</b></td>
  664. <td valign="middle">&nbsp;</td>
  665. </tr>';
  666. if(count($offer_list['pacc']) > 0)
  667. foreach($offer_list['pacc'] as $pacc) {
  668. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  669. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
  670. <td valign="middle" align="center"><img src="images/shop/premium.gif" /><br /><font style="font-weight:bold;">'.$pacc['days'].' Days</font></td>
  671. <td><b>'.$pacc['name'].'</b> <small>('.$pacc['points'].' points)</small><br />'.$pacc['description'].'</td>
  672. <td align="center">';
  673. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  674. $main_content .= '
  675. <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
  676. <input type="hidden" name="buy_id" value="'.$pacc['id'].'">
  677. <table border="0" cellpadding="0" cellspacing="0">
  678. <tbody>
  679. <tr>
  680. <td style="border: 0px none;">
  681. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  682. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  683. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image" />
  684. </div>
  685. </div>
  686. </td>
  687. </tr>
  688. </tbody>
  689. </table>
  690. </form>';}
  691. //Change Name
  692. if(count($offer_list['changename']) > 0)
  693. foreach($offer_list['changename'] as $changename) {
  694. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  695. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
  696. <td valign="middle" align="center"><img src="images/shop/name.gif" /></td>
  697. <td><font style="font-size:16px; font-weight:bold;">'.$changename['name'].'</font>&nbsp;';
  698. $main_content .='<small>('.$changename['points'].' points)</small>';
  699. $main_content .='<br />
  700. '.$changename['description'].'</td>
  701. <td align="center">';
  702. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  703. $main_content .= '
  704. <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
  705. <input type="hidden" name="buy_id" value="'.$changename['id'].'">
  706. <table border="0" cellpadding="0" cellspacing="0">
  707. <tbody>
  708. <tr>
  709. <td style="border: 0px none;">
  710. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  711. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  712. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  713. </div>
  714. </div>
  715. </td>
  716. </tr>
  717. </tbody>
  718. </table>
  719. </form>';}
  720. //Remove Red Skull
  721. if(count($offer_list['redskull']) > 0)
  722. foreach($offer_list['redskull'] as $redskull) {
  723. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  724. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
  725. <td valign="middle" align="center"><img src="images/shop/skull.gif" /></td>
  726. <td><font style="font-size:16px; font-weight:bold;">'.$redskull['name'].'</font>&nbsp;';
  727. $main_content .='<small>('.$redskull['points'].' points)</small>';
  728. $main_content .='<br />'.$redskull['description'].'</td>
  729. <td align="center">';
  730. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  731. $main_content .= '
  732. <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
  733. <input type="hidden" name="buy_id" value="'.$redskull['id'].'">
  734. <table border="0" cellpadding="0" cellspacing="0">
  735. <tbody>
  736. <tr>
  737. <td style="border: 0px none;">
  738. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  739. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  740. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  741. </div>
  742. </div>
  743. </td>
  744. </tr>
  745. </tbody>
  746. </table>
  747. </form>';
  748. $main_content .= '</td></tr>';}
  749. //Unban
  750. if(count($offer_list['unban']) > 0)
  751. foreach($offer_list['unban'] as $unban){
  752. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
  753. $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
  754. <td valign="middle" align="center"><br /><img src="images/shop/ban.gif" /></td>
  755. <td><font style="font-size:16px; font-weight:bold;">'.$unban['name'].'</font>&nbsp;';
  756. $main_content .='<small>('.$unban['points'].' points)</small>';
  757. $main_content .='<br />'.$unban['description'].'</td>
  758. <td align="center">';
  759. if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else
  760. $main_content .= '
  761. <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
  762. <input type="hidden" name="buy_id" value="'.$unban['id'].'">
  763. <table border="0" cellpadding="0" cellspacing="0">
  764. <tbody>
  765. <tr>
  766. <td style="border: 0px none;">
  767. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  768. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  769. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
  770. </div>
  771. </div>
  772. </td>
  773. </tr>
  774. </tbody>
  775. </table>
  776. </form>';
  777. $main_content .= '</td></tr>';}
  778. $main_content .= '
  779. </tbody>
  780. </table>
  781. </div>
  782. </div>
  783. <div class="TableShadowContainer">
  784. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  785. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  786. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  787. </div>
  788. </div>
  789. </td>
  790. </tr>
  791. </tbody>
  792. </table>
  793. </div>
  794. </td>
  795. </tr>
  796. </tbody>
  797. </table>
  798. </div>';}}
  799. elseif($action == 'select_player') {
  800. unset($_SESSION['viewed_confirmation_page']);
  801. if(!$logged) {
  802. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  803. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  804. <TD CLASS=white><B>Shoping Error</B></TD>
  805. </TR>
  806. <TR BGCOLOR='.$config['site']['darkborder'].'>
  807. <td>
  808. <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
  809. <TR>
  810. <TD>Please login first.</TD>
  811. </TR>
  812. </TABLE>
  813. </td>
  814. </tr>
  815. </TABLE>';}
  816. else {
  817. $buy_id = (int) $_REQUEST['buy_id'];
  818. if(empty($buy_id)) {
  819. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  820. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  821. <TD CLASS=white><B>Shoping Error</B></TD>
  822. </TR>
  823. <TR BGCOLOR='.$config['site']['darkborder'].'>
  824. <td>
  825. <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
  826. <TR>
  827. <TD>Please <a href="index.php?subtopic=shopsystem">select item</a> first.</TD>
  828. </TR>
  829. </TABLE>
  830. </td>
  831. </tr>
  832. </TABLE>';}
  833. else {
  834. $buy_offer = getItemByID($buy_id);
  835. if(isset($buy_offer['id'])) { //item exist in database
  836. if($buy_offer['type'] != 'changename') {
  837. if($user_premium_points >= $buy_offer['points']) {
  838.  
  839. $main_content .= '
  840. <div class="TableContainer">
  841. <div class="CaptionContainer">
  842. <div class="CaptionInnerContainer">
  843. <span class="CaptionEdgeLeftTop" style="background-image: url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  844. <span class="CaptionEdgeRightTop" style="background-image: url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  845. <span class="CaptionBorderTop" style="background-image: url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  846. <span class="CaptionVerticalLeft" style="background-image: url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  847. <div class="Text">Delivery Informations</div>
  848. <span class="CaptionVerticalRight" style="background-image: url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  849. <span class="CaptionBorderBottom" style="background-image: url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  850. <span class="CaptionEdgeLeftBottom" style="background-image: url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  851. <span class="CaptionEdgeRightBottom" style="background-image: url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  852. </div>
  853. </div>
  854. <table class="Table5" cellpadding="0" cellspacing="0">
  855. <tbody><tr>
  856. <td>
  857. <div class="InnerTableContainer">
  858. <table style="width: 100%;"><tbody><tr><td>
  859. <div class="InnerTableContainer">
  860. <table>
  861. <tbody>
  862. <tr>
  863. <td>
  864. <div class="TableShadowContainerRightTop">
  865. <div class="TableShadowRightTop" style="background-image: url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  866. </div>
  867. <div class="TableContentAndRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  868. <div class="TableContentContainer">
  869. <table class="TableContent" style="border: 1px solid #faf0d7;">
  870. <tbody>
  871. <tr style="background-color: #505050;">
  872. </tr>
  873. <tr class="Table" style="background-color: #d4c0a1;">
  874. <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
  875. <table border="0" cellpadding="4" cellspacing="1" width="100%">
  876. <tr bgcolor="'.$config['site']['vdarkborder'].'">
  877. <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Item Informations</b></font></td>
  878. </tr>
  879. <tr bgcolor="#D4C0A1">
  880. <td width="100"><b>Image:</b></td>
  881. <td width="550">';
  882. if(file_exists('images/items/'.$buy_offer['item_id'].'.gif')) {
  883. $main_content .= '<img src="images/items/'.$buy_offer['item_id'].'.gif" height="32" width="32">';
  884. } else {
  885. $main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">';
  886. }
  887. $main_content .='</td>
  888. </tr>
  889. <tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
  890. <tr bgcolor="#D4C0A1"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>';
  891. $main_content .='<tr bgcolor="#F1E0C6"><td width="100"><b>Cost:</b></td><td width="550"><small><b>'.$buy_offer['points'].'</b> premium points</small></td></tr>';
  892. $main_content .='
  893. </table>
  894. </td>
  895. </tr>
  896. </tbody>
  897. </table>
  898. </div>
  899. </div>
  900. <div class="TableShadowContainer">
  901. <div class="TableBottomShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  902. <div class="TableBottomLeftShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  903. <div class="TableBottomRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  904. </div>
  905. </div>
  906. </td>
  907. </tr>
  908. </tbody>
  909. </table>
  910. </div>
  911. <div class="InnerTableContainer">
  912. <table>
  913. <tbody>
  914. <tr>
  915. <td>
  916. <div class="TableShadowContainerRightTop">
  917. <div class="TableShadowRightTop" style="background-image: url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  918. </div>
  919. <div class="TableContentAndRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  920. <div class="TableContentContainer">
  921. <table class="TableContent" style="border: 1px solid #faf0d7;">
  922. <tbody>
  923. <tr style="background-color: #505050;">
  924. </tr>
  925. <tr class="Table" style="background-color: #d4c0a1;">
  926. <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
  927. <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST>
  928. <input type="hidden" name="buy_id" value="'.$buy_id.'">
  929. <table border="0" cellpadding="4" cellspacing="1" width="100%">
  930. <tr bgcolor="'.$config['site']['vdarkborder'].'">
  931. <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Select one Player</b></font></td>
  932. </tr>
  933. <tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b>&nbsp;&nbsp;<select name="buy_name" style="padding: 5px;">';
  934. $players_from_logged_acc = $account_logged->getPlayersList();
  935. if(count($players_from_logged_acc) > 0) {
  936. $players_from_logged_acc->orderBy('name');
  937. foreach($players_from_logged_acc as $player)
  938. $main_content .= '<option>'.$player->getName().'</option>';
  939. } else {
  940. $main_content .= 'You don\'t have any character on your account.';
  941. }
  942. $main_content .= '</select>&nbsp;<input type="submit" value="Purschase"><br /><small>Character <b> your account </b> you will receive.</small></td></tr></table>
  943. </form>
  944. </td>
  945. </tr>
  946. </tbody>
  947. </table>
  948. </div>
  949. </div>
  950. <div class="TableShadowContainer">
  951. <div class="TableBottomShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  952. <div class="TableBottomLeftShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  953. <div class="TableBottomRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  954. </div>
  955. </div>
  956. </td>
  957. </tr>
  958. </tbody>
  959. </table>
  960. </div>
  961. <div class="InnerTableContainer">
  962. <table>
  963. <tbody>
  964. <tr>
  965. <td>
  966. <div class="TableShadowContainerRightTop">
  967. <div class="TableShadowRightTop" style="background-image: url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  968. </div>
  969. <div class="TableContentAndRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  970. <div class="TableContentContainer">
  971. <table class="TableContent" style="border: 1px solid #faf0d7;">
  972. <tbody>
  973. <tr style="background-color: #505050;">
  974. </tr>
  975. <tr class="Table" style="background-color: #d4c0a1;">
  976. <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
  977. <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_id" value="'.$buy_id.'">
  978. <table border="0" cellpadding="4" cellspacing="1" width="100%">
  979. <tr bgcolor="'.$config['site']['vdarkborder'].'">
  980. <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Send Gift</b></font></td>
  981. </tr>
  982. <tr bgcolor="#D4C0A1"><td width="110"><b>To player:</b>&nbsp;&nbsp;<input type="text" name="buy_name" autocomplete="off" placeholder="Character&nbsp;to&nbsp;recive&nbsp;'.$buy_offer['name'].'" size="25">&nbsp;<input type="submit" value="Purschase to friend"><br /><small>Put in the field above the name of the character that will receive the item.</small></td></tr>
  983. </table>
  984. </form>
  985. </td>
  986. </tr>
  987. </tbody>
  988. </table>
  989. </div>
  990. </div>
  991. <div class="TableShadowContainer">
  992. <div class="TableBottomShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  993. <div class="TableBottomLeftShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  994. <div class="TableBottomRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  995. </div>
  996. </div>
  997. </td>
  998. </tr>
  999. </tbody>
  1000. </table>
  1001. </div>
  1002. </td>
  1003. </tr>
  1004. </tbody>
  1005. </table>
  1006. </div>
  1007. </td>
  1008. </tr>
  1009. </tbody>
  1010. </table>
  1011. </div>';
  1012. } else {
  1013. $main_content .= '
  1014. <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  1015. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  1016. <TD CLASS="white"><b>Erro</b></td>
  1017. </TR>
  1018. <TR BGCOLOR='.$config['site']['darkborder'].Para comprar '.$buy_offer['name'].'</b> voce precisa de <b>'.$buy_offer['points'].' premium points</b> disponíveis.<br />Atualmente você possui <b>'.$user_premium_points.'</b> premium points.</TD>
  1019. </TR>
  1020. </TABLE>
  1021. <br />
  1022. <table width="100%">
  1023. <tbody>
  1024. <tr align="center">
  1025. <td>
  1026. <table border="0" cellpadding="0" cellspacing="0">
  1027. <tbody><tr><td style="border: 0px none;">
  1028. <a href="javascript:void();" onclick=location.href="index.php?subtopic=donate">
  1029. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  1030. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  1031. <div class="ButtonText" style="background-image:url('.$layout_name.'/images/buttons/_sbutton_buypoints.png);"></div>
  1032. </div>
  1033. </div>
  1034. </a>
  1035. </td>
  1036. </tr>
  1037. <tr>
  1038. </tr>
  1039. </tbody>
  1040. </table>
  1041. </td>
  1042. <td>
  1043. <table border="0" cellpadding="0" cellspacing="0">
  1044. <tbody>
  1045. <tr>
  1046. <td style="border: 0px none;">
  1047. <a href="javascript:void();" onclick=location.href="index.php?subtopic=shopsystem"><div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  1048. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif); visibility: hidden;"></div>
  1049. <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
  1050. </table>
  1051. </td>
  1052. </tr>
  1053. </tbody>
  1054. </table>
  1055. <p>&nbsp;</p>';}
  1056. } else {
  1057. $main_content .= '<script type="text/javascript">
  1058.  
  1059. var accountHttp;
  1060.  
  1061. //sprawdza czy dane konto istnieje czy nie
  1062. function checkAccount()
  1063. {
  1064.     if(document.getElementById("account_name").value=="")
  1065.     {
  1066.         document.getElementById("acc_name_check").innerHTML = \'<img src="images/nok.gif" />\';
  1067.         return;
  1068.     }
  1069.     accountHttp=GetXmlHttpObject();
  1070.     if (accountHttp==null)
  1071.     {
  1072.         return;
  1073.     }
  1074.     var account = document.getElementById("account_name").value;
  1075.     var url="ajax/check_account.php?account=" + account + "&uid="+Math.random();
  1076.     accountHttp.onreadystatechange=AccountStateChanged;
  1077.     accountHttp.open("GET",url,true);
  1078.     accountHttp.send(null);
  1079. }
  1080.  
  1081. function AccountStateChanged()
  1082. {
  1083.     if (accountHttp.readyState==4)
  1084.     {
  1085.         document.getElementById("acc_name_check").innerHTML=accountHttp.responseText;
  1086.     }
  1087. }
  1088.  
  1089. var emailHttp;
  1090.  
  1091. //sprawdza czy dane konto istnieje czy nie
  1092. function checkEmail()
  1093. {
  1094.     if(document.getElementById("email").value=="")
  1095.     {
  1096.         document.getElementById("email_check").innerHTML = \'<img src="images/nok.gif" />\';
  1097.         return;
  1098.     }
  1099.     emailHttp=GetXmlHttpObject();
  1100.     if (emailHttp==null)
  1101.     {
  1102.         return;
  1103.     }
  1104.     var email = document.getElementById("email").value;
  1105.     var url="ajax/check_email.php?email=" + email + "&uid="+Math.random();
  1106.     emailHttp.onreadystatechange=EmailStateChanged;
  1107.     emailHttp.open("GET",url,true);
  1108.     emailHttp.send(null);
  1109. }
  1110.  
  1111. function EmailStateChanged()
  1112. {
  1113.     if (emailHttp.readyState==4)
  1114.     {
  1115.         document.getElementById("email_check").innerHTML=emailHttp.responseText;
  1116.     }
  1117. }
  1118.  
  1119.     function validate_required(field,alerttxt)
  1120.     {
  1121.     with (field)
  1122.     {
  1123.     if (value==null||value==""||value==" ")
  1124.       {alert(alerttxt);return false;}
  1125.     else {return true}
  1126.     }
  1127.     }
  1128.  
  1129.     function validate_email(field,alerttxt)
  1130.     {
  1131.     with (field)
  1132.     {
  1133.     apos=value.indexOf("@");
  1134.     dotpos=value.lastIndexOf(".");
  1135.     if (apos<1||dotpos-apos<2)
  1136.       {alert(alerttxt);return false;}
  1137.     else {return true;}
  1138.     }
  1139.     }
  1140.  
  1141.     function validate_form(thisform)
  1142.     {
  1143.     with (thisform)
  1144.     {
  1145.     if (validate_required(buy_from,"Please enter a new name of your character!")==false)
  1146.       {buy_from.focus();return false;}
  1147.     if (validate_required(email,"Please enter your e-mail!")==false)
  1148.       {email.focus();return false;}
  1149.     if (validate_email(email,"Invalid e-mail format!")==false)
  1150.       {email.focus();return false;}
  1151.     if (verifpass==1) {
  1152.     if (validate_required(passor,"Please enter password!")==false)
  1153.       {passor.focus();return false;}
  1154.     if (validate_required(passor2,"Please repeat password!")==false)
  1155.       {passor2.focus();return false;}
  1156.     if (passor2.value!=passor.value)
  1157.       {alert(\'Repeated password is not equal to password!\');return false;}
  1158.     }
  1159.     if(rules.checked==false)
  1160.       {alert(\'To create account you must accept server rules!\');return false;}
  1161.     }
  1162.     }
  1163.     </script>';
  1164. $main_content .= '
  1165. <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="post" onsubmit="return validate_form(this)"><input type="hidden" name="buy_id" value="'.$buy_id.'">
  1166. <table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="#505050"><td colspan="2"><b class="white">Change Name</b></td></tr>
  1167. <tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b></td><td width="550">
  1168. <select style="padding: 5px;" name="buy_name">';
  1169. $players_from_logged_acc = $account_logged->getPlayersList();
  1170. if(count($players_from_logged_acc) > 0) {
  1171. $players_from_logged_acc->orderBy('name');
  1172. foreach($players_from_logged_acc as $player) {
  1173. $main_content .= '<option>'.$player->getName().'</option>';}
  1174. } else {
  1175. $main_content .= 'You don\'t have any character on your account.';}
  1176. $main_content .= '</select>
  1177. </td>
  1178. </tr>
  1179. <tr bgcolor="#F1E0C6">
  1180. <td width="110"><b>New name:</b></td>
  1181. <td width="550"><input type="text" name="buy_from" id="buy_from" />&nbsp;';
  1182. if ($account_logged->getCustomField("premium_points") <= $buy_offer['points']){$main_content .='<input type="submit" value="Change Name" disabled />';} else {$main_content .='<input type="submit" value="Change Name" />';}
  1183. $main_content .='</td>
  1184. </tr>
  1185. </table>
  1186. <br />
  1187. </form>';}
  1188. } else {
  1189. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
  1190. <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
  1191. <td CLASS="white"><b>Error</b></td>
  1192. </tr>
  1193. <tr BGCOLOR='.$config['site']['darkborder'].'>
  1194. <td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>
  1195. </tr>
  1196. </TABLE>';}
  1197. }}}
  1198. elseif($action == 'confirm_transaction') {
  1199. if(!$logged) {
  1200. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  1201. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  1202. <TD CLASS=white><B>Shoping Error</B></TD>
  1203. </TR>
  1204. <TR BGCOLOR='.$config['site']['darkborder'].'>
  1205. <td>
  1206. <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
  1207. <TR>
  1208. <TD>Please login first.</TD>
  1209. </TR>
  1210. </TABLE>
  1211. </td>
  1212. </tr>
  1213. </TABLE>';}
  1214. else {
  1215. $buy_id = (int) $_POST['buy_id'];
  1216. $buy_name = stripslashes(urldecode($_POST['buy_name']));
  1217. $buy_from = stripslashes(urldecode($_POST['buy_from']));
  1218. if(empty($buy_id)) {
  1219. $main_content .= 'Please <a href="index.php?subtopic=shopsystem">select item</a> first.';
  1220. } else {
  1221. if($buy_offer['type'] == 'changename'){
  1222. if(!check_name_new_char($buy_from)) {
  1223. $main_content .= 'Invalid name format of new name.';
  1224. }}
  1225. else {
  1226. $buy_offer = getItemByID($buy_id);
  1227. $check_name_in_database = $ots->createObject('Player');
  1228. $check_name_in_database->find($buy_from);
  1229. if($buy_offer['type'] == 'changename'){
  1230. if(!$check_name_in_database->isLoaded()) {
  1231. }}
  1232. if(isset($buy_offer['id'])) { //item exist in database
  1233. if($user_premium_points >= $buy_offer['points']) {
  1234. if(check_name($buy_name)) {
  1235. $buy_player = new OTS_Player();
  1236. $buy_player->find($buy_name);
  1237. if($buy_player->isLoaded()) {
  1238. $buy_player_account = $buy_player->getAccount();
  1239. if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {
  1240. if($buy_offer['type'] == 'pacc')
  1241. {
  1242.     $player_viptime = $buy_player_account->getCustomField('viptime');
  1243.     $player_lastlogin = $buy_player_account->getCustomField('lastday');
  1244.     $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
  1245.     $SQL->query($save_transaction);
  1246.    
  1247.     if($player_viptime > 0)
  1248.         $buy_player_account->setCustomField('viptime', $player_viptime + ($buy_offer['days'] * 24 * 60 * 60));
  1249.     else
  1250.         $buy_player_account->setCustomField('viptime', time() + ($buy_offer['days'] * 24 * 60 * 60));
  1251.  
  1252.     $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1253.     $user_premium_points = $user_premium_points - $buy_offer['points'];
  1254.     if($player_viptime == 0)
  1255.     {
  1256.         $buy_player_account->setCustomField('lastday', time());
  1257.     }
  1258.     $main_content .= '<h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of Vip Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>';
  1259. }
  1260. elseif($buy_offer['type'] == 'unban'){
  1261. $my_acc_id = $account_logged->getCustomField('id');
  1262. $datadata = $SQL->query('SELECT * FROM '.$SQL->tableName('bans').' WHERE value = '.$my_acc_id.';')->fetch();
  1263. if($datadata['value'] == $my_acc_id) {
  1264. if($SQL->query('DELETE FROM bans WHERE value= '.$my_acc_id.' LIMIT 1;')) {
  1265. } else {
  1266. $SQL->query('DELETE FROM bans WHERE account= '.$my_acc_id.' LIMIT 1;');
  1267. }
  1268. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1269. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1270. $main_content .= '<center><h2>Ban Deleted!</h2><b>Your account has been unbanned for '.$buy_offer['points'].' premium points</b> from your account.
  1271. <br>Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br>';
  1272. } else {
  1273. $main_content .= '<center><b>You don\'t have any bans in your account!</b><br><br><a href="index.php?subtopic=shopsystem">Go back</a><br>';
  1274. }
  1275. }
  1276. ////////////////////////////////
  1277. elseif($buy_offer['type'] == 'itemlogout') {
  1278. $my_acc_id = $buy_player->getCustomField('id');
  1279. $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE id = '.$my_acc_id.';')->fetch();
  1280. $playerslot = $SQL->query('SELECT * FROM '.$SQL->tableName('player_items').' WHERE player_id = '.$my_acc_id.';')->fetch();
  1281. if ($playerinfo['online'] == '0') {
  1282. if ($playerslot['pid'] != '10') {
  1283. if ($datadata['cap'] >= $SQL->quote($buy_offer['free_cap'])) {
  1284. $SQL->query('INSERT INTO player_items (player_id, pid, itemtype, count) VALUES ('.$my_acc_id.', '.$SQL->quote($buy_offer['pid']).', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['count1']).');');
  1285. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1286. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1287. $main_content .= '<h2>Item received to player: '.$buy_player->getName().'!</h2><br />Now you have <b>'.$user_premium_points.' premium points</b>.
  1288. <br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a>';
  1289. } else {
  1290. $main_content .= '<b>You need '.$SQL->quote($buy_offer['free_cap']).' or more of cap!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
  1291. }} else {
  1292. $main_content .= '<b>Please leave the arrow slot in blank to receive item!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
  1293. }} else {
  1294. $main_content .= '<b>You need to be offline!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
  1295. }
  1296. }
  1297. ////////////////////////////////
  1298. elseif($buy_offer['type'] == 'changename') {
  1299. $my_acc_id = $buy_player->getCustomField('id');
  1300. $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
  1301. $checkname = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('name').' = '. $SQL->quote($buy_from) .';')->fetch();
  1302. if($playerinfo['online'] == '0') {
  1303. if($checkname == false) {
  1304. $SQL->query('UPDATE `players` SET `name` = '. $SQL->quote($buy_from) .' WHERE `id` = '. $my_acc_id.' ;');
  1305. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1306. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1307. $main_content .= '<center><h2>Your name has been changed to '.$buy_from.'.</h2><br /><b>You have '.$user_premium_points.' premium points left</b>.
  1308. <br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';
  1309. } else {
  1310. $main_content .= '<center><h2>Sorry, the name "<i>'.$buy_from.'</i>" does already exist.<br />Please select another name.</h2><br />';
  1311. }} else {
  1312. $main_content .= '<center><h2>'.$buy_name.' has to be offline to complete transaction.</h2><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';
  1313. }}
  1314. ////////////////////////////////
  1315. elseif($buy_offer['type'] == 'redskull') {
  1316. $my_acc_id = $buy_player->getCustomField('id');
  1317. $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
  1318. if($playerinfo['skull'] == '4' AND $playerinfo['online'] >= '0' AND $playerinfo['skulltime'] > '0') {
  1319. $SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
  1320. $SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
  1321. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1322. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1323. $main_content .= '<center><h2>RedSkull Removed!</h2><br /><b>Your redskull has been removed from the player '.$buy_player->getName().'.</b>
  1324. <br />Now you have<b> '.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';
  1325. } else {
  1326. $main_content .= '<center><b>'.$buy_player->getName().' has to be offline or have redskull to complete transaction!.</b><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';
  1327. }}
  1328. //////////////////////////
  1329. elseif($buy_offer['type'] == 'item') {
  1330. $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', \'\', \'\', \'item\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
  1331. $SQL->query($sql);
  1332. $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
  1333. $SQL->query($save_transaction);
  1334. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1335. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1336. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  1337. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  1338. <TD CLASS="white"><b>Item added successfully !</b></td>
  1339. </TR>
  1340. <TR BGCOLOR='.$config['site']['darkborder'].'>
  1341. <TD>
  1342. <b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />
  1343. Now you have <b>'.$user_premium_points.' premium points</b>.
  1344. </TD>
  1345. </TR>
  1346. </TABLE>
  1347. <br /><a href="index.php?subtopic=shopsystem">MAIN SHOP SITE</a><br /><br />';}
  1348. if($buy_offer['type'] == 'vipdays') {
  1349. $player_vip_time = $buy_player_account->getCustomField('vip_time');
  1350. $player_lastlogin = $buy_player_account->getCustomField('lastday');
  1351. $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
  1352. $SQL->query($save_transaction);
  1353. if($player_vip_time > 0)
  1354. $buy_player_account->setCustomField('vip_time', $player_vip_time + $buy_offer['days'] * 86400);
  1355. else
  1356. $buy_player_account->setCustomField('vip_time', time() + $buy_offer['days'] * 86400);
  1357. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1358. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1359. if ($player_vip_days >= 1) {
  1360. }
  1361. $main_content .= '<center><h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of VIP days added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';}
  1362. elseif($buy_offer['type'] == 'itemvip') {
  1363. $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['megaitems_count']).', \'\', \'\', \'megaitems\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
  1364. $SQL->query($sql);
  1365. $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
  1366. $SQL->query($save_transaction);
  1367. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1368. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1369. $main_content .= '<center><h2>Mega Item added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br>Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br>';
  1370. }
  1371. elseif($buy_offer['type'] == 'container') {
  1372. $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote($buy_offer['container_id']).', '.$SQL->quote($buy_offer['container_count']).', \'container\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
  1373. $SQL->query($sql);
  1374. $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
  1375. $SQL->query($save_transaction);
  1376. $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
  1377. $user_premium_points = $user_premium_points - $buy_offer['points'];
  1378. $main_content .= '<center><h2>Container of items added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br />';
  1379. }}
  1380. else {
  1381. if($buy_offer['type'] != 'changename') {
  1382. $set_session = TRUE;
  1383. $_SESSION['viewed_confirmation_page'] = 'yes';
  1384. $main_content .= '
  1385. <table border="0" cellpadding="4" cellspacing="1" width="100%">
  1386. <tr bgcolor="#505050"><td colspan="3"><font color="white"><b>Confirm transaction</b></font></td></tr>
  1387. <tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Image:</b></td><td width="550" colspan="2"><img src="images/items/'.$buy_offer['item_id'].'.gif" align="absmiddle"/><br /><small><b>'.$buy_offer['name'].'</b></small></td></tr>
  1388. <tr bgcolor="'.$config['site']['lightborder'].'"><td><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>';
  1389. $main_content .='
  1390. <tr bgcolor="'.$config['site']['darkborder'].'">
  1391. <td><b>Cost:</b></td>
  1392. <td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b> from your account</td>
  1393. </tr>';
  1394. $main_content .='
  1395. <tr bgcolor="'.$config['site']['lightborder'].'"><td><b>For Player:</b></td><td width="550" colspan="2">'.$buy_player->getName().' <small>[<a href="index.php?subtopic=characters&name='.$buy_player->getName().'" target="_blank">View Character</a>]</small></td></tr>
  1396. <tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Confirm Transaction ?</b></td>
  1397. <td><form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST">
  1398. <input type="hidden" name="buy_confirmed" value="yes">
  1399. <input type="hidden" name="buy_id" value="'.$buy_id.'">
  1400. <input type="hidden" name="buy_from" value="'.urlencode($new_name).'">
  1401. <input type="hidden" name="buy_name" value="'.urlencode($buy_name).'">
  1402. <input type="submit" value="Accept">
  1403. </form>
  1404. </td>
  1405. <td>
  1406. <form action="index.php?subtopic=shopsystem" method="POST">
  1407. <input type="submit" value="Cancel">
  1408. </form>
  1409. </td>
  1410. </tr>
  1411. </table><br />';
  1412. } else {
  1413. $set_session = TRUE;
  1414. $_SESSION['viewed_confirmation_page'] = 'yes';
  1415. $main_content .= '<center><h2>Confirm Name Changing</h2>
  1416. <table border="0" cellpadding="4" cellspacing="1" width="100%">
  1417. <tr bgcolor="#505050"><td colspan="3"><font color="white" size="4"><b>Confirm transaction</b></font></td></tr>
  1418. <tr bgcolor="#D4C0A1"><td width="130"><b>Name:</b></td><td width="550" colspan="2">'.$buy_offer['name'].'</td></tr>
  1419. <tr bgcolor="#F1E0C6"><td width="130"><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>
  1420. <tr bgcolor="#D4C0A1"><td width="130"><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b></td></tr>
  1421. <tr bgcolor="#F1E0C6"><td width="130"><b>Current Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_player->getName().'</font></td></tr>
  1422. <tr bgcolor="#D4C0A1"><td width="130"><b>New Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_from.'</font></td></tr>
  1423. <tr bgcolor="#F1E0C6"><td width="130"><b>Change Name?</b></td><td width="275" align="left">
  1424. <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST">
  1425. <input type="hidden" name="buy_confirmed" value="yes">
  1426. <input type="hidden" name="buy_id" value="'.$buy_id.'">
  1427. <input type="hidden" name="buy_from" value="'.urlencode($buy_from).'">
  1428. <input type="hidden" name="buy_name" value="'.urlencode($buy_name).'">
  1429. <input type="submit" value="Accept">
  1430. </form>
  1431. </td>
  1432. <td align="right"><form action="index.php?subtopic=shopsystem" method="POST">
  1433. <input type="submit" value="Cancel">
  1434. </form>
  1435. </td>
  1436. </tr>
  1437. </table>';}}}
  1438. else {
  1439. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
  1440. <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
  1441. <td CLASS="white"><b>Error</b></td>
  1442. </tr>
  1443. <tr BGCOLOR='.$config['site']['darkborder'].'>
  1444. <td>Player with name <b>'.$buy_name.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</td>
  1445. </tr>
  1446. </TABLE>';
  1447. }
  1448. } else {
  1449. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  1450. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  1451. <TD CLASS=white><B>Shoping Error</B></TD>
  1452. </TR>
  1453. <TR BGCOLOR='.$config['site']['darkborder'].'>
  1454. <td>
  1455. <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
  1456. <TR>
  1457. <TD>Invalid name format. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</TD>
  1458. </TR>
  1459. </TABLE>
  1460. </td>
  1461. </tr>
  1462. </TABLE><br />';}
  1463. } else {
  1464. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
  1465. <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
  1466. <td CLASS="white"><b>Error</b></td>
  1467. </tr>
  1468. <tr BGCOLOR='.$config['site']['darkborder'].'>
  1469. <td>For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_premium_points.'</b> premium points. Please <a href="index.php?subtopic=shopsystem">select other item</a> or buy premium points.</td>
  1470. </tr>
  1471. </TABLE>';
  1472. }}
  1473. else {
  1474. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
  1475. <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
  1476. <td CLASS="white"><b>Error</b></td>
  1477. </tr>
  1478. <tr BGCOLOR='.$config['site']['darkborder'].'>
  1479. <td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>
  1480. </tr>
  1481. </TABLE>';
  1482. }}}}
  1483. if(!$set_session) {
  1484. unset($_SESSION['viewed_confirmation_page']);
  1485. }}
  1486. if(!$logged)
  1487. $main_content .= '<br /><center><div class="notice"><b>Please login to see how much points you have</b></div></center>';
  1488. else
  1489. if($account_logged->getCustomField("premium_points") <= 0)
  1490. $main_content .='<br /><center><div class="error">You do not have premium points available.<br /><a href="index.php?subtopic=donate">Buy now Premium Points here!</a></div></center>';
  1491. else
  1492. if($account_logged->getCustomField("premium_points") >= 1)
  1493. $main_content .='<br /><center><div class="success" style="width: 300px;">You have&nbsp;<b>'.$account_logged->getCustomField("premium_points").'</b>&nbsp;premium points available</div></center>';
  1494. }
  1495. else
  1496. $main_content .= '
  1497. <div class="error_type">
  1498. Shop for disabled the internal maintenance, back in a moment with our standard systems.<br /><br /><b><small>Graciously, Staff</small></b>
  1499. </div>
  1500. ';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement