Advertisement
Guest User

shopguild

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