Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 69.88 KB | None | 0 0
  1. <link href="<?PHP echo $layout_name; ?>/shop.css" rel="stylesheet" type="text/css">
  2.  
  3. <?php
  4. if ($logged) {
  5.     $user_premium_points = $account_logged->getCustomField('premium_points');
  6.  
  7.     function isInteger($input) {
  8.         return(ctype_digit(strval($input)));
  9.     }
  10.  
  11.     function getItemByID($id) {
  12.         $id = (int) $id;
  13.         $SQL = $GLOBALS['SQL'];
  14.         $data = $SQL->query('SELECT * FROM ' . $SQL->tableName('z_shop_offer') . ' WHERE ' . $SQL->fieldName('id') . ' = ' . $SQL->quote($id) . ';')->fetch();
  15.  
  16.         $offer['id'] = $data['id'];
  17.         $offer['type'] = $data['offer_type'];
  18.         $offer['item_id'] = $data['itemid1'];
  19.         $offer['item_count'] = $data['count1'];
  20.         $offer['points'] = $data['points'];
  21.         $offer['description'] = $data['offer_description'];
  22.         $offer['name'] = $data['offer_name'];
  23.         $offer['category'] = $data['offer_category'];
  24.         $offer['new'] = $data['offer_new'];
  25.         $offer['type'] = $data['offer_type'];
  26.  
  27.         return $offer;
  28.     }
  29.  
  30.     function getOfferArray() {
  31.         $offer_list = $GLOBALS['SQL']->query('SELECT * FROM ' . $GLOBALS['SQL']->tableName('z_shop_offer') . ' WHERE ' . $GLOBALS['SQL']->fieldName('offer_category') . ' = ' . $_REQUEST['ServiceCategoryID'] . ';');
  32.  
  33.         $i_item = 0;
  34.  
  35.         while ($data = $offer_list->fetch()) {
  36.             $offer_array['item'][$i_item]['id'] = $data['id'];
  37.             $offer_array['item'][$i_item]['item_id'] = $data['itemid1'];
  38.             $offer_array['item'][$i_item]['item_count'] = $data['count1'];
  39.             $offer_array['item'][$i_item]['points'] = $data['points'];
  40.             $offer_array['item'][$i_item]['description'] = $data['offer_description'];
  41.             $offer_array['item'][$i_item]['name'] = $data['offer_name'];
  42.             $offer_array['item'][$i_item]['category'] = $data['offer_category'];
  43.             $offer_array['item'][$i_item]['new'] = $data['offer_new'];
  44.             $i_item++;
  45.         }
  46.         return $offer_array;
  47.     }
  48.  
  49.     if (isset($_REQUEST['ServiceCategoryID'])) {
  50.         $offer_list = getOfferArray();
  51.     } else {
  52.         $_REQUEST['ServiceCategoryID'] = 1;
  53.         $offer_list = getOfferArray();
  54.     }
  55.  
  56.     if (isset($_REQUEST['ServiceCategoryID']) and empty($_POST['page'])) {
  57.         $main_content .= '
  58.  
  59.  
  60. <script type="text/javascript">
  61.     var g_Services = [3,4,5,6,7,8];
  62.     var IMAGES = "./layouts/tibiacom/images/";
  63.     var g_PaymentMethodCategories = {"1":1};
  64.     var g_Prices = {"120":{"11":"30.00 BRL","21":"30.00 BRL","22":"30.00 BRL","31":"30.00 BRL","32":"30.00 BRL","33":"30.00 BRL","40":"30.00 BRL"},"121":{"11":"79.00 BRL","21":"79.00 BRL","22":"79.00 BRL","31":"79.00 BRL","32":"79.00 BRL","33":"79.00 BRL","40":"79.00 BRL"},"122":{"11":"141.00 BRL","21":"141.00 BRL","22":"141.00 BRL","31":"141.00 BRL","32":"141.00 BRL","33":"141.00 BRL","40":"141.00 BRL"},"123":{"11":"246.00 BRL","21":"246.00 BRL","22":"246.00 BRL","31":"246.00 BRL","32":"246.00 BRL","33":"246.00 BRL","40":"246.00 BRL"}};
  65.     var g_QF_Mounts_ServiceCategoryID = 15;
  66.     var g_QF_Outfits_ServiceCategoryID = 17;
  67.    
  68.     function ChangeService(a_ServiceID, a_ServiceCategoryID)
  69.     {
  70.         $(\'#CC_ServiceID\').val(a_ServiceID);
  71.         $(\'#CC_ServiceID\').attr(\'name\', \'InitialServiceID\');
  72.         $(\'#ServiceID_\' + a_ServiceID).attr(\'checked\', \'checked\');
  73.         $(\'.ServiceID_Icon_Container\').css(\'background-color\', \'\');
  74.         if (a_ServiceCategoryID == g_QF_Mounts_ServiceCategoryID || a_ServiceCategoryID == g_QF_Outfits_ServiceCategoryID) {
  75.             $(\'.ServiceID_Icon_Animation_1\').hide();
  76.             $(\'.ServiceID_Icon_New_Animation_1\').hide();
  77.             $(\'.ServiceID_Icon_New\').show();
  78.             $(\'#ServiceID_Icon_Animation_1_\' + a_ServiceID).show();
  79.             $(\'#ServiceID_Icon_New_\' + a_ServiceID).hide();
  80.         }
  81.         for (var i = 0; i < g_PaymentMethodCategories.length; i++) {
  82.             if (typeof g_Prices[a_ServiceID] !== \'undefined\') {
  83.                 if (typeof g_Prices[a_ServiceID][g_PaymentMethodCategories[i]] === \'undefined\') {
  84.                     // deactivate the payment method
  85.                     // note: the radio button can not be disabled or we will receive the wrong error message
  86.                     $(\'#PMCID_NotAllowed_\' + g_PaymentMethodCategories[i]).show();
  87.                     } else {
  88.                     // activate the payment method
  89.                     $(\'#PMCID_NotAllowed_\' + g_PaymentMethodCategories[i]).hide();
  90.                 }
  91.             }
  92.         }
  93.         $(\'.ServiceID_Icon_Selected\').css(\'background-image\', \'\');
  94.         $(\'#ServiceID_Icon_Selected_\' + a_ServiceID).css(\'background-image\', \'url(\' + IMAGES + \'payment/serviceid_icon_selected.png)\');
  95.         return;
  96.     }
  97.    
  98.     // change the selected payment method category
  99.     function ChangePMC(a_PaymentMethodID)
  100.     {
  101.         // set the PMCID for the change country form
  102.         $(\'#CC_PMCID\').val(a_PaymentMethodID);
  103.         $(\'#CC_PMCID\').attr(\'name\', \'InitialPMCID\');
  104.         // activate the radio button
  105.         $(\'#PMCID_\' + a_PaymentMethodID).attr(\'checked\', \'checked\');
  106.         $(\'.PMCID_Icon_Container\').css(\'background-color\', \'\');
  107.         // handle services
  108.         for (var i = 0; i < g_Services.length; i++) {
  109.             if (typeof g_Prices[g_Services[i]] !== \'undefined\') {
  110.                 if (typeof g_Prices[g_Services[i]][a_PaymentMethodID] === \'undefined\') {
  111.                     // deactivate the service
  112.                     // note: the radio button can not be disabled or we will receive the wrong error message
  113.                     $(\'#ServiceID_NotAllowed_\' + g_Services[i]).show();
  114.                     // set the price
  115.                     $(\'#PD_\' + g_Services[i]).html(\'---\');
  116.                     } else {
  117.                     // activate the service
  118.                     // set the price
  119.                     $(\'#PD_\' + g_Services[i]).html(g_Prices[g_Services[i]][a_PaymentMethodID]);
  120.                     $(\'#ServiceID_NotAllowed_\' + g_Services[i]).hide();
  121.                 }
  122.             }
  123.         }
  124.         // activate and mark the selected icon
  125.         $(\'.PMCID_Icon_Selected\').css(\'background-image\', \'\');
  126.         $(\'#PMCID_Icon_Selected_\' + a_PaymentMethodID).css(\'background-image\', url(\'https://cdn.awsli.com.br/307/307092/arquivos/serviceid_icon_selected.png\'));
  127.         return;
  128.     }
  129.    
  130.     // mouse over effect for payment methods
  131.     function MouseOverPMCID(a_PMCID)
  132.     {
  133.         $(\'#PMCID_Icon_Over_\' + a_PMCID).css(\'background-image\', \'url(\' + IMAGES + \'payment/pmcid_icon_over.png)\');
  134.     }
  135.    
  136.     // mouse out effect for payment methods
  137.     function MouseOutPMCID(a_PMCID)
  138.     {
  139.         $(\'#PMCID_Icon_Over_\' + a_PMCID).css(\'background-image\', \'\');
  140.     }
  141.    
  142.     // mouse over effect for products
  143.     function MouseOverServiceID(a_ServiceID, a_ServiceCategoryID)
  144.     {
  145.         $(\'#ServiceID_Icon_Over_\' + a_ServiceID).css(\'background-image\', \'url(\' + IMAGES + \'payment/serviceid_icon_over.png)\');
  146.         if (a_ServiceCategoryID == g_QF_Mounts_ServiceCategoryID || a_ServiceCategoryID == g_QF_Outfits_ServiceCategoryID) {
  147.             $(\'#ServiceID_Icon_Animation_1_\' + a_ServiceID).show();
  148.             $(\'#ServiceID_Icon_New_\' + a_ServiceID).hide();
  149.         }
  150.     }
  151.    
  152.     // mouse out effect for products
  153.     function MouseOutServiceID(a_ServiceID, a_ServiceCategoryID)
  154.     {
  155.         $(\'#ServiceID_Icon_Over_\' + a_ServiceID).css(\'background-image\', \'\');
  156.         // mounts have an animation
  157.         if ((a_ServiceCategoryID == g_QF_Mounts_ServiceCategoryID || a_ServiceCategoryID == g_QF_Outfits_ServiceCategoryID) && ($(\'#ServiceID_\' + a_ServiceID).attr(\'checked\') != \'checked\')) {
  158.             $(\'#ServiceID_Icon_Animation_1_\' + a_ServiceID).hide();
  159.             $(\'#ServiceID_Icon_New_\' + a_ServiceID).show();
  160.         }
  161.     }
  162. </script>
  163.  
  164.  
  165. <div id="ProgressBar">
  166.     <div id="MainContainer">
  167.         <div id="BackgroundContainer">
  168.             <img id="BackgroundContainerLeftEnd" src="' . $layout_name . '/images/global/content/stonebar-left-end.gif">
  169.             <div id="BackgroundContainerCenter">
  170.                 <div id="BackgroundContainerCenterImage" style="background-image:url(' . $layout_name . '/images/global/content/stonebar-center.gif);">
  171.                 </div>
  172.             </div>
  173.             <img id="BackgroundContainerRightEnd" src="' . $layout_name . '/images/global/content/stonebar-right-end.gif">
  174.         </div>
  175.         <img id="TubeLeftEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-left-green.gif">
  176.         <img id="TubeRightEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-right-blue.gif">
  177.         <div id="FirstStep" class="Steps">
  178.             <div class="SingleStepContainer">
  179.                 <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-1-green.gif">
  180.                 <div class="StepText" style="font-weight:bold;">Select service</div>
  181.             </div>
  182.         </div>
  183.         <div id="StepsContainer1">
  184.             <div id="StepsContainer2">
  185.                 <div class="Steps" style="width:33%">
  186.                     <div class="TubeContainer">
  187.                         <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green-blue.gif">
  188.                     </div>
  189.                     <div class="SingleStepContainer">
  190.                         <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-2-blue.gif">
  191.                         <div class="StepText" style="font-weight:normal;">Select your character</div>
  192.                     </div>
  193.                 </div>
  194.                 <div class="Steps" style="width:33%">
  195.                     <div class="TubeContainer">
  196.                         <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-blue.gif">
  197.                     </div>
  198.                     <div class="SingleStepContainer">
  199.                         <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-3-blue.gif">
  200.                         <div class="StepText" style="font-weight:normal;">Confirm your order</div>
  201.                     </div>
  202.                 </div>
  203.                 <div class="Steps" style="width:33%">
  204.                     <div class="TubeContainer">
  205.                         <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-blue.gif">
  206.                     </div>
  207.                     <div class="SingleStepContainer">
  208.                         <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-4-blue.gif">
  209.                         <div class="StepText" style="font-weight:normal;">Summary</div>
  210.                     </div>
  211.                 </div>
  212.             </div>
  213.         </div>
  214.     </div>
  215. </div>
  216.  
  217. <form method="post" action="">
  218.     <div class="TableContainer">
  219.         <div class="CaptionContainer">
  220.             <div class="CaptionInnerContainer">
  221.                 <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);">
  222.                 </span>
  223.                 <span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);">
  224.                 </span>
  225.                 <span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);">
  226.                 </span>
  227.                 <span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);">
  228.                 </span>
  229.                 <div class="Text">Select service</div>
  230.                 <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);">
  231.                 </span>
  232.                 <span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);">
  233.                 </span>
  234.                 <span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);">
  235.                 </span>
  236.                 <span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);">
  237.                 </span>
  238.             </div>
  239.         </div>
  240.        
  241.         <table class="Table5" cellpadding="0" cellspacing="0">
  242.             <tbody>
  243.                 <tr>
  244.                     <td>
  245.                         <div class="InnerTableContainer">
  246.                             <table style="width:100%;">
  247.                                 <tbody>
  248.                                     <tr>
  249.                                         <td> ';
  250.  
  251.         foreach ($config["site"]["shop_categories"] as $ServiceCategoryID => $data) {
  252.  
  253.             if ($data["enabled"]) {
  254.                 $main_content .= '
  255.                                                         <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'' . $ServiceCategoryID . '\', \'' . $data['description'] . '\', \'ProductCategoryHelperDiv_' . $data['id'] . '\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  256.                                                             <div class="InnerTableTab ';
  257.                 if ($_REQUEST['ServiceCategoryID'] == $data["id"]) {
  258.                     $main_content .= 'ActiveInnerTableTab';
  259.                 } $main_content .= '">
  260.                                                                 <div id="ProductCategoryHelperDiv_' . $data['id'] . '" class="ProductCategoryHelperDiv"></div>
  261.                                                                 <a href="?subtopic=shopsystem&ServiceCategoryID=' . $data['id'] . '">
  262.                                                                     <img src="' . $layout_name . '/images/payment/';
  263.                 if ($_REQUEST['ServiceCategoryID'] == $data["id"]) {
  264.                     $main_content .= 'products_tab_active';
  265.                 } else {
  266.                     $main_content .= 'products_tab_nonactive';
  267.                 } $main_content .= '.png">
  268.                                                                     <div class="InnerTableTabLabel">' . $ServiceCategoryID . '</div>';
  269.  
  270.                 if ($data['new']) {
  271.                     $main_content .= '<div class="RibbonNewProduct" style="background-image: url(' . $layout_name . '/images/payment/ribbon-tab-new-product.png);"></div>';
  272.                 }
  273.  
  274.                 $main_content .= '
  275.                                                                 </a>
  276.                                                             </div>
  277.                                                         </span>';
  278.             }
  279.         }
  280.  
  281.         $main_content .= '
  282.                                             </td>
  283.                                         </tr>
  284.                                         <tr>
  285.                                             <td>
  286.                                                 <div class="TableShadowContainerRightTop">
  287.                                                     <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);">
  288.                                                     </div>
  289.                                                 </div>
  290.                                                 <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
  291.                                                     <div class="TableContentContainer">
  292.                                                         <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  293.                                                             <tbody>
  294.                                                                 <tr>
  295.                                                                     <td style="text-align: center;" align="center">
  296.                                                                         <div style="max-height: 500px; overflow-y: auto;">';
  297.  
  298.         if ($offer_list['item'])
  299.             foreach ($offer_list['item'] as $item) {
  300.  
  301.                 $main_content .= '
  302.                                                                             <div class="ServiceID_Icon_Container" id="ServiceID_Icon_Container_' . $item['id'] . '" onclick="ChangeService(' . $item['id'] . ', 2);" onmouseover="MouseOverServiceID(' . $item['id'] . ', 2);" onmouseout="MouseOutServiceID(' . $item['id'] . ', 2);">  
  303.                                                                                 <div class="ServiceID_Icon_Container_Background" id="" style="background-image:url(' . $layout_name . '/images/payment/serviceid_icon_normal.png);">    <div class="ServiceID_Icon" id="ServiceID_Icon_' . $item['id'] . '" style="background-image:url(./images/items/' . $item['item_id'] . '.gif);" onclick="ChangeService(' . $item['id'] . ', 14);" onmouseover="MouseOverServiceID(' . $item['id'] . ', 14);" onmouseout="MouseOutServiceID(' . $item['id'] . ', 14);">
  304.                                                                                
  305.                                                                                     <div class="PermanentDeactivated">
  306.                                                                                         <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'' . htmlspecialchars($item['name']) . '\', \'' . htmlspecialchars($item['description']) . '<br/><br/>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  307.                                                                                             <div class="ServiceID_HelperDiv"></div>
  308.                                                                                         </span>
  309.                                                                                     </div>
  310.                                                                                    
  311.                                                                                     <div class="PermanentDeactivated ServiceID_Deactivated_ByChoice" id="ServiceID_NotAllowed_' . $item['id'] . '" style="display: none;">
  312.                                                                                         <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Service Info:\', \'<p>The product is not available for the selected payment method!</p>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  313.                                                                                             <div class="ServiceID_Deactivated" style="background-image: url(' . $layout_name . '/images/payment/serviceid_deactivated.png);"></div>
  314.                                                                                         </span>
  315.                                                                                     </div>';
  316.  
  317.                 if ($item['new']) {
  318.                     $main_content .= '<div class="RibbonNewProduct" style="background-image: url(' . $layout_name . '/images/payment/ribbon-new-product.png);"></div>';
  319.                 }
  320.  
  321.                 $main_content .= '
  322.                                                                                     <div class="ServiceID_Icon_Selected" id="ServiceID_Icon_Selected_' . $item['id'] . '"></div>    
  323.                                                                                    
  324.                                                                                     <div class="ServiceID_Icon_Over" id="ServiceID_Icon_Over_' . $item['id'] . '"></div><div class="ServiceID_Icon_Animation_1" id="ServiceID_Icon_Animation_1' . $item['id'] . '" style="background-image: url(' . $layout_name . '/images/payment/serviceid' . $item['id'] . '_animation_1.gif);"></div>
  325.                                                                                    
  326.                                                                                     <label for="ServiceID_' . $item['id'] . '">
  327.                                                                                         <div class="ServiceIDLabelContainer">  
  328.                                                                                             <div class="ServiceIDLabel">    
  329.                                                                                                 <input type="radio" id="ServiceID_' . $item['id'] . '" name="ServiceID" value="' . $item['id'] . '" style="display: none;" required>' . htmlspecialchars($item['name']) . '  
  330.                                                                                             </div>
  331.                                                                                         </div>
  332.                                                                                         <div class="ServiceIDPriceContainer">
  333.                                                                                         <span class="ServiceIDPrice" id="PD_' . $item['id'] . '">' . $item['points'] . ' TP$</div>
  334.                                                                                     </label>    
  335.                                                                                 </div>  
  336.                                                                                 </div>
  337.                                                                             </div>';
  338.             }
  339.  
  340.  
  341.         $main_content .=
  342.                                                                         </div>
  343.                                                                     </td>
  344.                                                                 </tr>                                                              
  345.                                                             </tbody>
  346.                                                         </table>
  347.                                                     </div>
  348.                                                 </div>
  349.                                                 <div class="TableShadowContainer">
  350.                                                     <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  351.                                                         <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  352.                                                         </div>
  353.                                                         <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  354.                                                         </div>
  355.                                                     </div>
  356.                                                 </div>
  357.                                                
  358.                                                 <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">  
  359.                                                     <div class="TableContentContainer">  
  360.                                                         <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  361.                                                         <form method="post" action="">
  362.                                                             <tr>
  363.                                                                 <td bgcolor="#F1E0C6">                                                                 
  364.                                                                     &nbsp;Your Points: <b>                                                             
  365.                                                                     ' . $user_premium_points . ' TP$</b>
  366.                                                                 </td>
  367.                                                                 <td bgcolor="#F1E0C6">                                                                 
  368.                                                                     <div class="BigButton" style="float:right; background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green.gif)">
  369.                                                                         <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);">
  370.                                                                             <div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green_over.gif);">
  371.                                                                             </div>
  372.                                                                             <a class="ButtonText" href="?subtopic=buypoints"> <img src="' . $layout_name . '/images/global/buttons/_sbutton_buypoints.gif"  alt="Buy points"/></a>
  373.                                                                         </div>
  374.                                                                     </div>
  375.                                                                 </td>
  376.                                                             </tr>                                      
  377.                                                            
  378.                                                            
  379.                                                            
  380.                                                         </table>  
  381.                                                     </div>
  382.                                                 </div>
  383.                                                 <br>
  384.                                                 <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">  
  385.                                                     <div class="TableContentContainer">  
  386.                                                         <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  387.                                                         <form method="post" action="">
  388.                                                             <tr>
  389.                                                                 <td bgcolor="#F1E0C6">                                                                 
  390.                                                                     <font color="red"><b>Atencao: Todos items sao entregues automaticamento por nosso sistema!</b></font>
  391.                                                                 </td>
  392.                                                             </tr>                                                                                                  
  393.                                                         </table>  
  394.                                                     </div>
  395.                                                 </div>
  396.  
  397.                                                 <div class="TableShadowContainer">
  398.                                                     <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  399.                                                         <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  400.                                                         </div>
  401.                                                         <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  402.                                                         </div>
  403.                                                     </div>
  404.                                                 </div>
  405.                                                
  406.                                                
  407.                                             </td>
  408.                                         </tr>
  409.                                        
  410.                                         <tr>
  411.                                             <td style="display:none;">
  412.                                                 <div class="TableShadowContainerRightTop">
  413.                                                     <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);">
  414.                                                     </div>
  415.                                                 </div>
  416.                                                 <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
  417.                                                     <div class="TableContentContainer">
  418.                                                         <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  419.                                                             <tbody>
  420.                                                                 <tr>
  421.                                                                     <td style="text-align: center;" align="center">
  422.                                                                         <div style="max-height: 240px; overflow-y: auto;">';
  423.  
  424.         $main_content .= '
  425.                                                                             <div class="PMCID_Icon_Container" id="PMCID_Icon_Container_1">
  426.                                                                                 <div class="PMCID_Icon" id="PMCID_Icon_1" style="background-image:url(' . $layout_name . '/images//payment/pmcid_icon_normal.png);" onclick="ChangePMC(1);" onmouseover="MouseOverPMCID(1);" onmouseout="MouseOutPMCID(1);">
  427.                                                                                     <div class="PermanentDeactivated PMCID_Deactivated_ByChoice" id="PMCID_NotAllowed_1" style="display: none;" "="">
  428.                                                                                     <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Payment Method Info:\', \'
  429.                                                                                    
  430.                                                                                     <p>The payment method is not allowed for the selected service!</p>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  431.                                                                                         <div class="PMCID_Deactivated" style="background-image: url(' . $layout_name . '/images/payment/pmcid_deactivated.png);">
  432.                                                                                         </div>
  433.                                                                                     </span>
  434.                                                                                 </div>
  435.                                                                                 <div class="PMCID_Icon_Selected" id="PMCID_Icon_Selected_1"></div>
  436.                                                                                 <div class="PMCID_Icon_Over" id="PMCID_Icon_Over_1"></div>
  437.                                                                                 <span style="position: absolute; left: 125px; top: 53px; z-index: 99;">
  438.                                                                                     <span style="margin-left: 5px; position: absolute; margin-top: 2px;">
  439.                                                                                         <a href="../common/help.php?subtopic=Field-PaymentMethodCategory-Option-1" target="_blank">
  440.                                                                                             <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Information:\', \'Your Points, go to buy points to donate and get more if you need.\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  441.                                                                                                 <img style="border:0px;" src="' . $layout_name . '/images/global/content/info.gif">
  442.                                                                                             </span>
  443.                                                                                         </a>
  444.                                                                                     </span>
  445.                                                                                 </span>
  446.                                                                                 <img class="PMCID_CP_Icon" src="' . $layout_name . '/images/payment/paymentmethodcategory11.gif">
  447.                                                                                 <div class="PMCID_CP_Label">
  448.                                                                                     <input type="radio" id="PMCID_1" name="PMCID" value="1" style="display: none;" checked>
  449.                                                                                     <label for="PMCID_1">Your points <br/>  Balance: ' . $account_logged->getCustomField("premium_points") . ' TP$</label>
  450.                                                                                 </div>
  451.                                                                             </div>';
  452.  
  453.         $main_content .= '
  454.                                                                         </div>
  455.                                                                     </div>
  456.                                                                 </div>
  457.                                                             </td>
  458.                                                         </tr>
  459.                                                     </tbody>
  460.                                                 </table>
  461.                                             </div>
  462.                                         </div>
  463.                                         <div class="TableShadowContainer">
  464.                                             <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  465.                                                 <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  466.                                                 </div>
  467.                                                 <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  468.                                                 </div>
  469.                                             </div>
  470.                                         </div>
  471.                                     </td>
  472.                                 </tr>
  473.                             </tbody>
  474.                         </table>
  475.                     </div>
  476.                 </td>
  477.             </tr>
  478.         </tbody>
  479.     </table>
  480. </div>
  481.  
  482.  
  483.  
  484.  
  485. <div class="SubmitButtonRow">
  486.     <div class="LeftButton">
  487.         <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green.gif)">
  488.             <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green_over.gif);"></div>
  489.                 <input type="hidden" name="page" value="orderinfo">
  490.                 <input class="ButtonText" type="image" name="Next" alt="Next" src="' . $layout_name . '/images/global/buttons/_sbutton_next.gif">
  491.             </div>
  492.         </div>
  493.     </div>
  494. </form>
  495.     <div class="RightButton">
  496.         <form action="?subtopic=accountmanagement" method="post" style="padding:0px;margin:0px;">
  497.             <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_red.gif)">
  498.                 <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_red_over.gif);"></div>
  499.                     <input type="hidden" name="page" value="overview">
  500.                                        <input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="' . $layout_name . '/images/global/buttons/_sbutton_cancel.gif">
  501.                 </div>
  502.             </div>
  503.         </form>
  504.     </div>
  505. </div>
  506.  
  507. ';
  508.     }
  509.  
  510.     if ($_POST['page'] == 'orderinfo') {
  511.         $main_content .= '
  512. <div class="BoxContent" style="background-image:url(' . $layout_name . '/images/global/content/scroll.gif);">
  513.     <div id="ProgressBar">
  514.         <div id="MainContainer">
  515.             <div id="BackgroundContainer">
  516.                 <img id="BackgroundContainerLeftEnd" src="' . $layout_name . '/images/global/content/stonebar-left-end.gif">
  517.                 <div id="BackgroundContainerCenter">
  518.                     <div id="BackgroundContainerCenterImage" style="background-image:url(' . $layout_name . '/images/global/content/stonebar-center.gif);">
  519.                     </div>
  520.                 </div>
  521.                 <img id="BackgroundContainerRightEnd" src="' . $layout_name . '/images/global/content/stonebar-right-end.gif">
  522.             </div>
  523.             <img id="TubeLeftEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-left-green.gif"><img id="TubeRightEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-right-blue.gif">
  524.             <div id="FirstStep" class="Steps">
  525.                 <div class="SingleStepContainer">
  526.                     <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-1-green.gif">
  527.                     <div class="StepText" style="font-weight:normal;">
  528.                         Select service
  529.                     </div>
  530.                 </div>
  531.             </div>
  532.             <div id="StepsContainer1">
  533.                 <div id="StepsContainer2">
  534.                     <div class="Steps" style="width:33%">
  535.                         <div class="TubeContainer">
  536.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  537.                         </div>
  538.                         <div class="SingleStepContainer">
  539.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-2-green.gif">
  540.                             <div class="StepText" style="font-weight:bold;">
  541.                                 Select your character
  542.                             </div>
  543.                         </div>
  544.                     </div>
  545.                     <div class="Steps" style="width:33%">
  546.                         <div class="TubeContainer">
  547.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green-blue.gif">
  548.                         </div>
  549.                         <div class="SingleStepContainer">
  550.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-3-blue.gif">
  551.                             <div class="StepText" style="font-weight:normal;">
  552.                                 Confirm your order
  553.                             </div>
  554.                         </div>
  555.                     </div>
  556.                     <div class="Steps" style="width:33%">
  557.                         <div class="TubeContainer">
  558.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-blue.gif">
  559.                         </div>
  560.                         <div class="SingleStepContainer">
  561.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-4-blue.gif">
  562.                             <div class="StepText" style="font-weight:normal;">
  563.                                 Summary
  564.                             </div>
  565.                         </div>
  566.                     </div>
  567.                 </div>
  568.             </div>
  569.         </div>
  570.     </div>
  571.     <div class="TableContainer">
  572.         <div class="CaptionContainer">
  573.             <div class="CaptionInnerContainer">
  574.                 <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span>
  575.                 <div class="Text">
  576.                     Select your character
  577.                 </div>
  578.                 <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span><span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span>
  579.             </div>
  580.         </div>
  581.         <table class="Table5" cellpadding="0" cellspacing="0">
  582.         <tbody>
  583.         <tr>
  584.             <td>
  585.                 <div class="InnerTableContainer">
  586.                     <table style="width:100%;">
  587.                     <tbody>
  588.                     <tr>
  589.                         <td>
  590.                             <div class="TableShadowContainerRightTop">
  591.                                 <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);">
  592.                                 </div>
  593.                             </div>
  594.                             <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
  595.                                 <div class="TableContentContainer">
  596.                                     <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">';
  597.  
  598.         $ServiceID = (int) $_POST['ServiceID'];
  599.  
  600.         if (empty($ServiceID)) {
  601.             $main_content .= '<tr><td>Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select item</a> first.</tr></td>';
  602.         } else {
  603.             $ServiceOffer = getItemByID($ServiceID);
  604.  
  605.             if (isset($ServiceOffer['id'])) { //item exist in database
  606.                 if ($user_premium_points >= $ServiceOffer['points']) {
  607.                     $main_content .= '
  608.                                                     <tr class="Odd">
  609.                                                         <td style="font-weight:bold; width: 1%;">';
  610.  
  611.                     $main_content .= '
  612.                                                             <div class="ServiceID_Icon_Container" id="ServiceID_Icon_Container_' . $ServiceOffer['id'] . '"> ';
  613.  
  614.  
  615.  
  616.  
  617.                     $main_content .= '
  618.                                                                 <div class="ServiceID_Icon_Container_Background" style="background-image:url(' . $layout_name . '/images/payment/serviceid_icon_normal.png);">
  619.                                                                     <div class="ServiceID_Icon" id="ServiceID_Icon_' . $ServiceOffer['id'] . '" style="background-image:url(./images/items/' . $ServiceOffer['item_id'] . '.gif); cursor: auto;">';
  620.  
  621.  
  622.                     $main_content .= '     
  623.                                                                         <label for="ServiceID_' . $ServiceOffer['id'] . '">
  624.                                                                             <div class="ServiceIDLabelContainer">  
  625.                                                                                 <div class="ServiceIDLabel" style="cursor: auto;">    
  626.                                                                                     ' . htmlspecialchars($ServiceOffer['name']) . '  
  627.                                                                                 </div>
  628.                                                                             </div>
  629.                                                                            
  630.                                                                             <div class="PermanentDeactivated">
  631.                                                                                 <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'' . htmlspecialchars($ServiceOffer['name']) . '\', \'' . htmlspecialchars($ServiceOffer['description']) . '<br/><br/>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  632.                                                                                     <div class="ServiceID_HelperDiv"></div>
  633.                                                                                 </span>
  634.                                                                             </div>
  635.                                                                                    
  636.                                                                             <div class="PermanentDeactivated ServiceID_Deactivated_ByChoice" id="ServiceID_NotAllowed_' . $ServiceOffer['id'] . '" style="display: none;">
  637.                                                                                 <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Service Info:\', \'<p>The product is not available for the selected payment method!</p>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  638.                                                                                     <div class="ServiceID_Deactivated" style="background-image: url(' . $layout_name . '/images/payment/serviceid_deactivated.png);"></div>
  639.                                                                                 </span>
  640.                                                                             </div>
  641.                                                                            
  642.                                                                             <div class="ServiceIDPriceContainer" style="cursor: auto;">
  643.                                                                                 <span class="ServiceIDPrice" id="PD_' . $ServiceOffer['id'] . '">' . $ServiceOffer['points'] . ' TP$</span>
  644.                                                                             </div>
  645.                                                                         </label>
  646.                                                                        
  647.                                                                     </div>  
  648.                                                                 </div>
  649.                                                             </div>';
  650.  
  651.                     $main_content .= '
  652.                                                         </td>
  653.                                                        
  654.                                                         <td>
  655.                                                            
  656.                                                             <form action="" method="POST">
  657.                                                                                        
  658.                                                                 <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  659.                                                                     <tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2" class="white"><b>Give item to player from your account</b></td></tr>
  660.                                                                     <tr bgcolor="' . $config['site']['lightborder'] . '"><td width="130"><b>Character name:</b></td><td><select name="buy_name" style="    width: 100%;    height: 30px;    display: block;    float: left; ">';
  661.                     $players_from_logged_acc = $account_logged->getPlayersList();
  662.                     if (count($players_from_logged_acc) > 0) {
  663.                         foreach ($players_from_logged_acc as $player) {
  664.                             $main_content .= '<option>' . htmlspecialchars($player->getName()) . '</option>';
  665.                         }
  666.                     } else {
  667.                         $main_content .= 'You don\'t have any character on your account.';
  668.                     }
  669.                     $main_content .= '</select></td></tr>';
  670.  
  671.                     if ($ServiceOffer['type'] == 'itemvip') {
  672.                         $main_content .= '<tr bgcolor="' . $config['site']['lightborder'] . '"><td width="130"><b>Quantity:</b></td><td><input type="text" name="quantity" value="1" style="width: 100%;  height: 25px;  line-height: 25px;" placeholder=" Quantity"></td></tr>';
  673.                     }
  674.  
  675.                     $main_content .= '                                                             
  676.                                                                                                                                            
  677.                                                                         <tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2" class="white"><b>Give item to other player</b></td></tr>
  678.                                                                         <tr bgcolor="' . $config['site']['lightborder'] . '"><td><b>To player:</b></td><td><input type="text" name="gift_name" style="width: 100%;  height: 25px;  line-height: 25px;" placeholder=" Name of player to give."></td></tr>
  679.                                                                         <tr bgcolor="' . $config['site']['lightborder'] . '"><td><b>From:</b></td><td><input type="text" name="gift_from" style="width: 100%;  height: 25px;  line-height: 25px;" placeholder=" Your nick, \'empty\' for Anonymous."></td></tr>
  680.                                                                        
  681.                                                                         ';
  682.  
  683.                     $main_content .=
  684.                                                                 </table>
  685.                                                                
  686.                                                                
  687.                                                            
  688.                                                            
  689.                                                            
  690.                                                         </td>
  691.                                                     </tr>
  692.                                                    
  693.                                                     ';
  694.                 } else {
  695.                     $main_content .= '<tr><td>For this item you need <b>' . $ServiceOffer['points'] . '</b> TP$. You have only <b>' . $user_premium_points . '</b> TP$. Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select other item</a> or buy TP$.</tr></td>';
  696.                 }
  697.             } else {
  698.                 $main_content .= '<tr><td>Offer ID doesn\'t exist. Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select item</a> again.</tr></td>';
  699.             }
  700.         }
  701.  
  702.         $main_content .= '
  703.                                     </table>
  704.                                 </div>
  705.                             </div>
  706.                             <div class="TableShadowContainer">
  707.                                 <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  708.                                     <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  709.                                     </div>
  710.                                     <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  711.                                     </div>
  712.                                 </div>
  713.                             </div>
  714.                         </td>
  715.                     </tr>
  716.                     </tbody>
  717.                     </table>
  718.                 </div>
  719.             </td>
  720.         </tr>
  721.         </tbody>
  722.         </table>
  723.     </div>
  724.     <div class="SubmitButtonRow">
  725.         <div class="LeftButton">
  726.             <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green.gif)">
  727.                 <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green_over.gif);"></div>
  728.                                    <input type="hidden" name="page" value="confirmorder">
  729.                                    '. $_POST['ServiceID'] .'
  730.                                    <input type="hidden" name="ServiceID" value="' . $_POST['ServiceID'] . '">
  731.                                    <input class="ButtonText" type="image" name="Next" alt="Next" src="' . $layout_name . '/images/global/buttons/_sbutton_next.gif">
  732.                 </div>
  733.             </div>
  734.         </div>
  735.         </form>
  736.         <div class="RightButton">
  737.             <form method="post" action="">
  738.                 <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton.gif)">
  739.                     <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_over.gif);"></div>
  740.                         <input type="hidden" name="page" value="">
  741.                                                <input type="hidden" name="ServiceID" value="' . $_POST['ServiceID'] . '">
  742.                                                <input class="ButtonText" type="image" name="Previous" alt="Previous" src="' . $layout_name . '/images/global/buttons/_sbutton_previous.gif">
  743.                     </div>
  744.                 </div>
  745.             </form>
  746.         </div>
  747.     </div>
  748.     <!--script type="text/javascript" src="templates/js/utils.js"></script-->
  749. </div>';
  750.     }
  751.  
  752.     if ($_POST['page'] == 'confirmorder') {
  753.         $main_content .= '
  754. <div class="BoxContent" style="background-image:url(' . $layout_name . '/images/global/content/scroll.gif);">
  755.     <div id="ProgressBar">
  756.         <div id="MainContainer">
  757.             <div id="BackgroundContainer">
  758.                 <img id="BackgroundContainerLeftEnd" src="' . $layout_name . '/images/global/content/stonebar-left-end.gif">
  759.                 <div id="BackgroundContainerCenter">
  760.                     <div id="BackgroundContainerCenterImage" style="background-image:url(' . $layout_name . '/images/global/content/stonebar-center.gif);">
  761.                     </div>
  762.                 </div>
  763.                 <img id="BackgroundContainerRightEnd" src="' . $layout_name . '/images/global/content/stonebar-right-end.gif">
  764.             </div>
  765.             <img id="TubeLeftEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-left-green.gif"><img id="TubeRightEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-right-blue.gif">
  766.             <div id="FirstStep" class="Steps">
  767.                 <div class="SingleStepContainer">
  768.                     <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-1-green.gif">
  769.                     <div class="StepText" style="font-weight:normal;">
  770.                         Select service
  771.                     </div>
  772.                 </div>
  773.             </div>
  774.             <div id="StepsContainer1">
  775.                 <div id="StepsContainer2">
  776.                     <div class="Steps" style="width:33%">
  777.                         <div class="TubeContainer">
  778.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  779.                         </div>
  780.                         <div class="SingleStepContainer">
  781.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-2-green.gif">
  782.                             <div class="StepText" style="font-weight:bold;">
  783.                                 Select your character
  784.                             </div>
  785.                         </div>
  786.                     </div>
  787.                     <div class="Steps" style="width:33%">
  788.                         <div class="TubeContainer">
  789.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  790.                         </div>
  791.                         <div class="SingleStepContainer">
  792.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-3-green.gif">
  793.                             <div class="StepText" style="font-weight:normal;">
  794.                                 Confirm your order
  795.                             </div>
  796.                         </div>
  797.                     </div>
  798.                     <div class="Steps" style="width:33%">
  799.                         <div class="TubeContainer">
  800.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green-blue.gif">
  801.                         </div>
  802.                         <div class="SingleStepContainer">
  803.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-4-blue.gif">
  804.                             <div class="StepText" style="font-weight:normal;">
  805.                                 Summary
  806.                             </div>
  807.                         </div>
  808.                     </div>
  809.                 </div>
  810.             </div>
  811.         </div>
  812.     </div>
  813.     <div class="TableContainer">
  814.         <div class="CaptionContainer">
  815.             <div class="CaptionInnerContainer">
  816.                 <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span>
  817.                 <div class="Text">
  818.                     Confirm your order
  819.                 </div>
  820.                 <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span><span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span>
  821.             </div>
  822.         </div>
  823.         <table class="Table5" cellpadding="0" cellspacing="0">
  824.         <tbody>
  825.         <tr>
  826.             <td>
  827.                 <div class="InnerTableContainer">
  828.                     <table style="width:100%;">
  829.                     <tbody>
  830.                     <tr>
  831.                         <td>
  832.                             <div class="TableShadowContainerRightTop">
  833.                                 <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);">
  834.                                 </div>
  835.                             </div>
  836.                             <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
  837.                                 <div class="TableContentContainer">
  838.                                     <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">';
  839.  
  840.         $ServiceID = (int) $_POST['ServiceID'];
  841.  
  842.         if (empty($ServiceID)) {
  843.             $main_content .= '<tr><td>Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select item</a> first.</tr></td>';
  844.         } else {
  845.  
  846.             $ServiceOffer = getItemByID($ServiceID);
  847.             $quantity = (int) $_POST['quantity'];
  848.             $priece = (int) $ServiceOffer['points'];
  849.             $total = $quantity * $priece;
  850.  
  851.             if (isset($ServiceOffer['id'])) { //item exist in database
  852.                 $errorcode = 0;
  853.                 if ($ServiceOffer['type'] == 'itemvip') {
  854.                     if (!isInteger($_POST['quantity'])) {
  855.                         $main_content .= '<tr><td>Please, enter a valid quantity (only integer numbers)!</tr></td>';
  856.                         $errorcode = 1;
  857.                     } elseif ((int) $_POST['quantity'] <= 0) {
  858.                         $main_content .= '<tr><td>Please, quantity must be higher than 0!</tr></td>';
  859.                         $errorcode = 1;
  860.                     }
  861.                 }
  862.  
  863.                 if ($errorcode == 0) {
  864.                     if ($user_premium_points >= $ServiceOffer['points']) {
  865.                         $main_content .= '<tr><td style="padding: 5px; line-height: 20px;">
  866.                        <form action="" method="POST" style="margin: 0px;">
  867.                        <b style="width: 150px; display: inline-block;">Item name:</b> ' . $ServiceOffer['name'] . '<br/>
  868.             <b style="width: 150px; display: inline-block;">Item price:</b> ' . $ServiceOffer['points'] . ' TP$ from your account<br/>
  869.             <!--<b style="width: 150px; display: inline-block;">Quantity:</b> ' . (int) $_POST['quantity'] . ' <br/>-->
  870.             <!--<b style="width: 150px; display: inline-block;">Total:</b> ' . $total . ' TP$<br/>-->';
  871.                         if ($_POST['gift_name']) {
  872.                             $main_content .= '<b style="width: 150px; display: inline-block;">From:</b> ' . $_POST['gift_from'] . '<br/><b style="width: 150px; display: inline-block;">To:</b> ' . $_POST['gift_name'] . '<br/>';
  873.                         } else {
  874.                             $main_content .= '<b style="width: 150px; display: inline-block;">Owner:</b> ' . $_POST['buy_name'] . ' <small>[<a href="index.php?subtopic=characters&amp;name=' . $_POST['buy_name'] . '" target="_blank">View Character</a>]</small><br/>';
  875.                         }
  876.                         $main_content .= '<b style="width: 150px; display: inline-block;">Payment Method:</b> Points<br/></td></tr>';
  877.                     } else {
  878.                         $main_content .= '<tr><td>For this item you need <b>' . $ServiceOffer['points'] . '</b> TP$. You have only <b>' . $user_premium_points . '</b> TP$. Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select other item</a> or buy TP$.</tr></td>';
  879.                     }
  880.                 }
  881.             } else {
  882.                 $main_content .= '<tr><td>Offer ID doesn\'t exist. Please <a href="?subtopic=shopsystem&ServiceCategoryID=1">select item</a> again.</tr></td>';
  883.             }
  884.         }
  885.  
  886.         $main_content .= '
  887.                                     </table>
  888.                                 </div>
  889.                                                                
  890.                             </div>
  891.                             <div class="TableShadowContainer">
  892.                                 <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  893.                                     <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  894.                                     </div>
  895.                                     <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  896.                                     </div>
  897.                                 </div>
  898.                             </div>
  899.                            
  900.                             <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">  
  901.                                 <div class="TableContentContainer">  
  902.                                     <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  903.                                     <form method="post" action="">
  904.                                         <tr>
  905.                                             <td colspan="2">
  906.                                                 <input type="checkbox" name="order_contract" value="1" id="AgreementsCheckbox" required>
  907.                                                 <span>
  908.                                                     <label for="AgreementsCheckbox">I have read and I agree to the <a href="?subtopic=legaldocuments" target="_blank">Extended Tibia Service Agreement</a>.</label>
  909.                                                 </span>
  910.                                             </td>
  911.                                         </tr>
  912.                                     </table>  
  913.                                 </div>
  914.                             </div>
  915.                             <div class="TableShadowContainer">
  916.                                 <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  917.                                     <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  918.                                     </div>
  919.                                     <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  920.                                     </div>
  921.                                 </div>
  922.                             </div>
  923.                            
  924.                         </td>
  925.                     </tr>
  926.                     </tbody>
  927.                     </table>
  928.                 </div>
  929.             </td>
  930.         </tr>
  931.         </tbody>
  932.         </table>
  933.     </div>
  934.     <div class="SubmitButtonRow">
  935.         <div class="LeftButton">
  936.             <input type="hidden" name="page" value="summaryorder">
  937.             <input type="hidden" name="viewed_confirmation_page" value="1">
  938.             <input type="hidden" name="buy_confirmed" value="1">
  939.             <input type="hidden" name="quantity" value="' . $_POST['quantity'] . '">
  940.             <input type="hidden" name="buy_name" value="' . $_POST['buy_name'] . '">
  941.             <input type="hidden" name="gift_name" value="' . $_POST['gift_name'] . '">
  942.             <input type="hidden" name="gift_from" value="' . $_POST['gift_from'] . '">
  943.             <input type="hidden" name="ServiceID" value="' . $_POST['ServiceID'] . '">';
  944.  
  945.         $_SESSION['add_itens'] = TRUE;
  946.  
  947.         $main_content .= '<div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green.gif)">
  948.                 <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_green_over.gif);"></div>
  949.                     <input class="ButtonText" type="image" name="Buy now" alt="Buy now" src="' . $layout_name . '/images/global/buttons/_sbutton_buynow.gif">
  950.                 </div>
  951.             </div>
  952.         </div>
  953.         </form>
  954.         <div class="RightButton">
  955.             <form method="post" action="">
  956.                 <input type="hidden" name="page" value="orderinfo">
  957.                 <input type="hidden" name="ServiceID" value="' . $_POST['ServiceID'] . '">
  958.                 <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton.gif)">
  959.                     <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_over.gif);"></div>
  960.                         <input class="ButtonText" type="image" name="Previous" alt="Previous" src="' . $layout_name . '/images/global/buttons/_sbutton_previous.gif">
  961.                     </div>
  962.                 </div>
  963.             </form>
  964.         </div>
  965.     </div>
  966.     <script type="text/javascript" src="templates/js/utils.js"></script>
  967. </div>';
  968.     }
  969.  
  970.     if ($_POST['page'] == 'summaryorder') {
  971.         $main_content .= '
  972. <div class="BoxContent" style="background-image:url(' . $layout_name . '/images/global/content/scroll.gif);">
  973.     <div id="ProgressBar">
  974.         <div id="MainContainer">
  975.             <div id="BackgroundContainer">
  976.                 <img id="BackgroundContainerLeftEnd" src="' . $layout_name . '/images/global/content/stonebar-left-end.gif">
  977.                 <div id="BackgroundContainerCenter">
  978.                     <div id="BackgroundContainerCenterImage" style="background-image:url(' . $layout_name . '/images/global/content/stonebar-center.gif);">
  979.                     </div>
  980.                 </div>
  981.                 <img id="BackgroundContainerRightEnd" src="' . $layout_name . '/images/global/content/stonebar-right-end.gif">
  982.             </div>
  983.             <img id="TubeLeftEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-left-green.gif"><img id="TubeRightEnd" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-right-green.gif">
  984.             <div id="FirstStep" class="Steps">
  985.                 <div class="SingleStepContainer">
  986.                     <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-1-green.gif">
  987.                     <div class="StepText" style="font-weight:normal;">
  988.                         Summary of your order
  989.                     </div>
  990.                 </div>
  991.             </div>
  992.             <div id="StepsContainer1">
  993.                 <div id="StepsContainer2">
  994.                     <div class="Steps" style="width:33%">
  995.                         <div class="TubeContainer">
  996.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  997.                         </div>
  998.                         <div class="SingleStepContainer">
  999.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-2-green.gif">
  1000.                             <div class="StepText" style="font-weight:bold;">
  1001.                                 Select your character
  1002.                             </div>
  1003.                         </div>
  1004.                     </div>
  1005.                     <div class="Steps" style="width:33%">
  1006.                         <div class="TubeContainer">
  1007.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  1008.                         </div>
  1009.                         <div class="SingleStepContainer">
  1010.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-3-green.gif">
  1011.                             <div class="StepText" style="font-weight:normal;">
  1012.                                 Confirm your order
  1013.                             </div>
  1014.                         </div>
  1015.                     </div>
  1016.                     <div class="Steps" style="width:33%">
  1017.                         <div class="TubeContainer">
  1018.                             <img class="Tube" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-tube-green.gif">
  1019.                         </div>
  1020.                         <div class="SingleStepContainer">
  1021.                             <img class="StepIcon" src="' . $layout_name . '/images/global/content/progressbar/progress-bar-icon-4-green.gif">
  1022.                             <div class="StepText" style="font-weight:normal;">
  1023.                                 Summary
  1024.                             </div>
  1025.                         </div>
  1026.                     </div>
  1027.                 </div>
  1028.             </div>
  1029.         </div>
  1030.     </div>
  1031.    
  1032.     <div class="TableContainer">
  1033.         <div class="CaptionContainer">
  1034.             <div class="CaptionInnerContainer">
  1035.                 <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span>
  1036.                 <div class="Text">
  1037.                     Order summary
  1038.                 </div>
  1039.                 <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);"></span><span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);"></span><span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span><span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);"></span>
  1040.             </div>
  1041.         </div>
  1042.         <table class="Table5" cellpadding="0" cellspacing="0">
  1043.         <tbody>
  1044.         <tr>
  1045.             <td>
  1046.                 <div class="InnerTableContainer">
  1047.                     <table style="width:100%;">
  1048.                     <tbody>
  1049.                     <tr>
  1050.                         <td>
  1051.                             <div class="TableShadowContainerRightTop">
  1052.                                 <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);">
  1053.                                 </div>
  1054.                             </div>
  1055.                             <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);">
  1056.                                 <div class="TableContentContainer">
  1057.                                     <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">';
  1058.  
  1059.         if (empty($_POST['ServiceID'])) {
  1060.             $errormessage .= 'Please <a href="?subtopic=shopsystem">select item</a> first.';
  1061.         } else {
  1062.             $buy_id = (int) $_POST['ServiceID'];
  1063.             $buy_offer = getItemByID($buy_id);
  1064.         }
  1065.  
  1066.         if ($_POST['gift_name']) {
  1067.             $buy_name = trim($_POST['gift_name']);
  1068.         } else {
  1069.             $buy_name = trim($_POST['buy_name']);
  1070.         }
  1071.  
  1072.         if (empty($_POST['gift_from'])) {
  1073.             $buy_from = 'Anonymous';
  1074.         } else {
  1075.             $buy_from = trim($_POST['gift_from']);
  1076.         }
  1077.  
  1078.         if (empty($_POST['order_contract'])) {
  1079.             $errormessage .= 'You need accept terms.';
  1080.         }
  1081.  
  1082.         if ($buy_offer['type'] == 'itemvip') {
  1083.             if (!isInteger($_POST['quantity'])) {
  1084.                 $errormessage .= 'Please, enter a valid quantity (only integer numbers)!';
  1085.             }
  1086.  
  1087.             if ((int) $_POST['quantity'] <= 0) {
  1088.                 $errormessage .= 'Please, quantity must be higher than 0!';
  1089.             }
  1090.         }
  1091.  
  1092.         if (!check_name($buy_from)) {
  1093.             $errormessage .= 'Invalid nick ("from player") format. Please <a href="?subtopic=shopsystem&action=select_player&buy_id=' . $buy_id . '">select other name</a> or contact with administrator.';
  1094.         } else {
  1095.             if ($_SESSION['add_itens'] and empty($errormessage)) {
  1096.  
  1097.                 $buy_offer = getItemByID($buy_id);
  1098.                 if (isset($buy_offer['id'])) { //item exist in database
  1099.                     if ($user_premium_points >= $buy_offer['points']) {
  1100.                         if (check_name($buy_name)) {
  1101.                             $buy_player = new Player();
  1102.                             $buy_player->find($buy_name);
  1103.                             if ($buy_player->isLoaded()) {
  1104.                                 $buy_player_account = $buy_player->getAccount();
  1105.                                 if ($_POST['viewed_confirmation_page'] && $_POST['buy_confirmed']) {
  1106.                                     $buy_type = 'give_item';
  1107.                                     $selectedCount = 1;
  1108.  
  1109.                                     if ($buy_offer['type'] == 'vipdays') {
  1110.                                         $buy_type = 'vipdays';
  1111.                                     } elseif ($buy_offer['type'] == 'pacc') {
  1112.                                         $buy_type = 'pacc';
  1113.                                     }
  1114.  
  1115.                                     if ($buy_offer['type'] == 'itemvip') {
  1116.                                         $selectedCount = $_POST['quantity'];
  1117.                                         $totalQ = (int) $buy_offer['item_count'] * (int) $selectedCount;
  1118.                                         $totalP = (int) $buy_offer['points'];
  1119.                                         if ($totalQ > 0) {
  1120.                                             $totalP = $totalQ * (int) $buy_offer['points'];
  1121.                                         }
  1122.                                     } else {
  1123.                                         $totalQ = (int) $buy_offer['item_count'];
  1124.                                         $totalP = (int) $buy_offer['points'];
  1125.                                     }
  1126.  
  1127.  
  1128.                                     $tizzype = 'item';
  1129.                                     if ($buy_offer['type'] == 'mount') {
  1130.                                         $tizzype = 'mount';
  1131.                                     } elseif ($buy_offer['type'] == 'addon') {
  1132.                                         $tizzype = 'addon';
  1133.                                     }
  1134.  
  1135.                                     $sql = 'INSERT INTO ' . $SQL->tableName('z_ots_comunication') . ' (' . $SQL->fieldName('id') . ',' . $SQL->fieldName('name') . ',' . $SQL->fieldName('type') . ',' . $SQL->fieldName('action') . ',' . $SQL->fieldName('param1') . ',' . $SQL->fieldName('param2') . ',' . $SQL->fieldName('param3') . ',' . $SQL->fieldName('param4') . ',' . $SQL->fieldName('param5') . ',' . $SQL->fieldName('param6') . ',' . $SQL->fieldName('param7') . ',' . $SQL->fieldName('delete_it') . ') VALUES (NULL, ' . $SQL->quote($buy_player->getName()) . ', ' . $SQL->quote('login') . ', ' . $SQL->quote($buy_type) . ', ' . $SQL->quote($buy_offer['item_id']) . ', ' . $SQL->quote($totalQ) . ', ' . $SQL->quote('') . ', ' . $SQL->quote('') . ', ' . $SQL->quote($tizzype) . ', ' . $SQL->quote($buy_offer['name']) . ', ' . $SQL->quote('') . ', ' . $SQL->quote(1) . ');';
  1136.                                     $SQL->query($sql);
  1137.                                     $save_transaction = 'INSERT INTO ' . $SQL->tableName('z_shop_history_item') . ' (' . $SQL->fieldName('id') . ',' . $SQL->fieldName('to_name') . ',' . $SQL->fieldName('to_account') . ',' . $SQL->fieldName('from_nick') . ',' . $SQL->fieldName('from_account') . ',' . $SQL->fieldName('price') . ',' . $SQL->fieldName('offer_id') . ',' . $SQL->fieldName('trans_state') . ',' . $SQL->fieldName('trans_start') . ',' . $SQL->fieldName('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']) . ', ' . $SQL->quote('wait') . ', ' . $SQL->quote(time()) . ', ' . $SQL->quote(0) . ');';
  1138.                                     $SQL->query($save_transaction);
  1139.                                     $account_logged->setCustomField('premium_points', (int) $user_premium_points - (int) $totalP);
  1140.                                     $user_premium_points = $user_premium_points - $totalP;
  1141.                                     $main_content .= '<TR style="padding: 5px; line-height: 20px;">>
  1142.                         <TD BGCOLOR="' . $config['site']['darkborder'] . '" ALIGN=left>                                                                    
  1143.                     <b>' . htmlspecialchars($buy_offer['name']) . '</b> foi enviado ao player <b>' . htmlspecialchars($buy_player->getName()) . '</b>.<br/>
  1144.                             Aguarde alguns segundos para receber.<br/>
  1145.                             Foram debitados <b>' . $totalP . ' TP$</b> da sua conta.<br/>
  1146.                             Saldo disponível: <b>' . $user_premium_points . ' TP$</b>.
  1147.                             Obrigado por colaborar! Lembramos que convertemos todo o dinheiro arrecadado em recursos para o próprio servidor.
  1148.                         </TD>
  1149.                                                        <td style="font-weight:bold; width: 1%;">
  1150.                             <div class="ServiceID_Icon_Container" id="ServiceID_Icon_Container_' . $buy_offer['id'] . '">  
  1151.                             <div class="ServiceID_Icon_Container_Background" style="background-image:url(' . $layout_name . '/images/payment/serviceid_icon_normal.png);">
  1152.                             <div class="ServiceID_Icon" id="ServiceID_Icon_' . $buy_offer['id'] . '" style="background-image:url(./images/items/' . $buy_offer['item_id'] . '.gif); cursor: auto;"><label for="ServiceID_' . $buy_offer['id'] . '"><div class="ServiceIDLabelContainer">
  1153.                                                <div class="ServiceIDLabel" style="cursor: auto;">' . htmlspecialchars($buy_offer['name']) . '</div>
  1154.                                                    </div>
  1155.                                                    <div class="PermanentDeactivated">
  1156.                                                                                                 <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'' . htmlspecialchars($buy_offer['name']) . '\', \'' . htmlspecialchars($buy_offer['description']) . '<br/><br/>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  1157.                                                                                                     <div class="ServiceID_HelperDiv"></div>
  1158.                                                                                                 </span>
  1159.                                                                                             </div>
  1160.                                                                                                    
  1161.                                                                                             <div class="PermanentDeactivated ServiceID_Deactivated_ByChoice" id="ServiceID_NotAllowed_' . $buy_offer['id'] . '" style="display: none;">
  1162.                                                                                                 <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Service Info:\', \'<p>The product is not available for the selected payment method!</p>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();">
  1163.                                                                                                     <div class="ServiceID_Deactivated" style="background-image: url(' . $layout_name . '/images/payment/serviceid_deactivated.png);"></div>
  1164.                                                                                                 </span>
  1165.                                                                                             </div>
  1166.                                                                                            
  1167.                                                                                             <div class="ServiceIDPriceContainer" style="cursor: auto;">
  1168.                                                                                                 <span class="ServiceIDPrice" id="PD_' . $buy_offer['id'] . '">' . $buy_offer['points'] . ' TP$</span>
  1169.                                                                                             </div>
  1170.                                                                                         </label>
  1171.                                                                                        
  1172.                                                                                     </div>  
  1173.                                                                                 </div>
  1174.                                                                             </div>
  1175.                                                                         </td>
  1176.                                                                     </TR>';
  1177.                                 }
  1178.                             } else {
  1179.                                 $errormessage .= 'Player with name <b>' . htmlspecialchars($buy_name) . '</b> doesn\'t exist. Please <a href="?subtopic=shopsystem&action=select_player&buy_id=' . $buy_id . '">select other name</a>.';
  1180.                             }
  1181.                         } else {
  1182.                             $errormessage .= 'Invalid name format. Please <a href="?subtopic=shopsystem&action=select_player&buy_id=' . $buy_id . '">select other name</a> or contact with administrator.';
  1183.                         }
  1184.                     } else {
  1185.                         $errormessage .= 'For this item you need <b>' . $buy_offer['points'] . '</b> points. You have only <b>' . $user_premium_points . '</b> premium points. Please <a href="?subtopic=shopsystem">select other item</a> or buy premium points.';
  1186.                     }
  1187.                 } else {
  1188.                     $errormessage .= 'Offer with ID <b>' . $buy_id . '</b> doesn\'t exist. Please <a href="?subtopic=shopsystem">select item</a> again.';
  1189.                 }
  1190.  
  1191.                 if ($_SESSION['add_itens']) {
  1192.                     $_SESSION['add_itens'] = FALSE;
  1193.                 }
  1194.             } else {
  1195.                 if (empty($errormessage)) {
  1196.                     $main_content .= '
  1197.                                                         <TR>
  1198.                                                             <TD>
  1199.                                                                 Seu pedido está sendo processado, por favor aguarde alguns segundos!
  1200.                                                             </TR>
  1201.                                                         </TD>';
  1202.                 }
  1203.             }
  1204.         }
  1205.  
  1206.         if (!empty($errormessage)) {
  1207.             $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
  1208.                                                 <TR><TD BGCOLOR="' . $config['site']['vdarkborder'] . '" ALIGN=left CLASS=white><B>Informations</B></TD></TR>
  1209.                                                 <TR><TD BGCOLOR="' . $config['site']['lightborder'] . '" ALIGN=left><b>' . $errormessage . '</b></TD></TR>
  1210.                                                 </table>';
  1211.         }
  1212.  
  1213.         $main_content .= '                                 
  1214.                                 </table>
  1215.                                 </div>
  1216.                                                                
  1217.                             </div>
  1218.                             <div class="TableShadowContainer">
  1219.                                 <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bm.gif);">
  1220.                                     <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-bl.gif);">
  1221.                                     </div>
  1222.                                     <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-br.gif);">
  1223.                                     </div>
  1224.                                 </div>
  1225.                             </div>
  1226.                            
  1227.  
  1228.                            
  1229.                         </td>
  1230.                     </tr>
  1231.                     </tbody>
  1232.                     </table>
  1233.                 </div>
  1234.             </td>
  1235.         </tr>
  1236.         </tbody>
  1237.         </table>
  1238.     </div>
  1239.     <div class="SubmitButtonRow">
  1240.         <form method="post" action="">
  1241.         <div class="LeftButton">
  1242.        
  1243.             <input type="hidden" name="page" value="">
  1244.             <input type="hidden" name="viewed_confirmation_page" value="">
  1245.             <input type="hidden" name="buy_confirmed" value="">
  1246.             <input type="hidden" name="buy_name" value="">
  1247.             <input type="hidden" name="gift_name" value="">
  1248.             <input type="hidden" name="gift_from" value="">
  1249.             <input type="hidden" name="ServiceID" value="">
  1250.             <input type="hidden" name="order_contract" value="">
  1251.            
  1252.             <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_red.gif)">
  1253.                 <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);">
  1254.                     <div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_red_over.gif);">
  1255.                     </div>
  1256.                     <input class="ButtonText" type="image" name="Buy now" alt="Buy now" src="' . $layout_name . '/images/global/buttons/_sbutton_backshop.gif">
  1257.                 </div>
  1258.             </div>
  1259.         </div>
  1260.         </form>
  1261.        
  1262.         <div class="RightButton">
  1263.             <form method="post" action="?subtopic=accountmanagement">
  1264.                 <input type="hidden" name="page" value="">
  1265.                 <input type="hidden" name="viewed_confirmation_page" value="">
  1266.                 <input type="hidden" name="buy_confirmed" value="">
  1267.                 <input type="hidden" name="buy_name" value="">
  1268.                 <input type="hidden" name="gift_name" value="">
  1269.                 <input type="hidden" name="gift_from" value="">
  1270.                 <input type="hidden" name="ServiceID" value="">
  1271.                
  1272.                 <div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton.gif)">
  1273.                     <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);">
  1274.                         <div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_over.gif);">
  1275.                         </div>
  1276.                         <input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/global/buttons/_sbutton_manageaccount.gif">
  1277.                     </div>
  1278.                 </div>
  1279.             </form>
  1280.         </div>
  1281.     </div>
  1282.     <script type="text/javascript" src="templates/js/utils.js"></script>
  1283. </div>';
  1284.     }
  1285.  
  1286.  
  1287.     $main_content .= '
  1288. <script type="text/javascript">
  1289.  
  1290. $(\'#SelectCountrySubmitButton\').hide();
  1291. $(\'.PMCID_CP_Label > input\').hide();
  1292. $(\'.ServiceIDLabel > input\').hide();
  1293. ChangeService(1, 11);
  1294. </script>
  1295.  
  1296. <script type="text/javascript">
  1297.     $(\'#SelectCountrySubmitButton\').hide();
  1298.     $(\'.PMCID_CP_Label > input\').hide();
  1299.     $(\'.ServiceIDLabel > input\').hide();
  1300.     ChangeService(1, 12);
  1301. </script>
  1302.  
  1303.  
  1304. <div id="HelperDivContainer" style="background-image: url(./layouts/tibiacom/images/content/scroll.gif);">
  1305.    <div class="HelperDivArrow" style="background-image: url(./layouts/tibiacom/images/content/helper-div-arrow.png);"></div>
  1306.    <div id="HelperDivHeadline"></div>
  1307.    <div id="HelperDivText"></div>
  1308.    <center>
  1309.        <img class="Ornament" src="./layouts/tibiacom/images/content/ornament.gif">
  1310.    </center>
  1311.    <br>
  1312. </div>
  1313.  
  1314.  
  1315. ';
  1316. } else {
  1317.     header('Location: ' . '?subtopic=accountmanagement');
  1318. }
  1319. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement