shop_guest.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2017 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. function exec_ogp_module()
  25. {
  26. require('includes/config.inc.php');
  27. global $db;
  28. $settings = $db->getSettings();
  29. ?>
  30. <p style="text-align:center;background-color:cyan;color:blue;">&nbsp;<?php print_lang("you_need_to");?> <a href="?m=register&p=form"><?php print_lang("register");?></a> <?php print_lang("and");?> <a href="index.php"><?php print_lang("log_in");?></a>&nbsp;<?php print_lang("to_purchase_a_service");?>.</p>
  31. <h2><?php print_lang("available_services");?></h2>
  32. <div style="border: 5px solid transparent;">
  33. <?php
  34. $qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services";
  35. $services = $db->resultQuery($qry_services);
  36. if(is_array($services) && count($services) > 0){
  37. foreach ($services as $key => $row) {
  38. $service_id[$key] = $row['service_id'];
  39. $home_cfg_id[$key] = $row['home_cfg_id'];
  40. $mod_cfg_id[$key] = $row['mod_cfg_id'];
  41. $service_name[$key] = $row['service_name'];
  42. $remote_server_id[$key] = $row['remote_server_id'];
  43. $slot_max_qty[$key] = $row['slot_max_qty'];
  44. $slot_min_qty[$key] = $row['slot_min_qty'];
  45. $price_hourly[$key] = $row['price_hourly'];
  46. $price_monthly[$key] = $row['price_monthly'];
  47. $price_year[$key] = $row['price_year'];
  48. $description[$key] = $row['description'];
  49. $img_url[$key] = $row['img_url'];
  50. $ftp[$key] = $row['ftp'];
  51. $install_method[$key] = $row['install_method'];
  52. $manual_url[$key] = $row['manual_url'];
  53. $access_rights[$key] = $row['access_rights'];
  54. }
  55. //Sort by service name, the 1st position in this array multisort, service_name, defines the row that sorts the array, if there are two equal service names then the next row, service_id, will sort these rows.
  56. array_multisort($service_name,
  57. $service_id,
  58. $home_cfg_id,
  59. $mod_cfg_id,
  60. $remote_server_id,
  61. $slot_max_qty,
  62. $slot_min_qty,
  63. $price_hourly,
  64. $price_monthly,
  65. $price_year,
  66. $description,
  67. $img_url,
  68. $ftp,
  69. $install_method,
  70. $manual_url,
  71. $access_rights, SORT_DESC, $services);
  72. foreach($services as $row)
  73. {
  74. ?>
  75. <div style="float:left; border: 4px solid transparent;border-bottom: 25px solid transparent;">
  76. <img src="<?php echo $row['img_url'] ;?>" width=280 height=132 border=0 alt="Bad Image">
  77. <br>
  78. <center><b><?php echo $row['service_name'];?></b></center>
  79. <center><em style="text-align:center;background-color:orange;color:blue;"><?php echo get_lang('starting_on') . " <b>" . floatval(round(($row['price_monthly']*$row['slot_min_qty']),2 )) . "</b>&nbsp;" . $settings['currency'] . "/" . get_lang('month') . " (" . $row['slot_min_qty'] . " " . get_lang('slots') . ").";?></em></center>
  80. </div>
  81. <?php
  82. }
  83. ?>
  84. <?php
  85. }
  86. ?>
  87. </div>
  88. <?php
  89. }
  90. ?>