shop_guest.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2010 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. foreach ($services as $key => $row) {
  37. $service_id[$key] = $row['service_id'];
  38. $home_cfg_id[$key] = $row['home_cfg_id'];
  39. $mod_cfg_id[$key] = $row['mod_cfg_id'];
  40. $service_name[$key] = $row['service_name'];
  41. $remote_server_id[$key] = $row['remote_server_id'];
  42. $slot_max_qty[$key] = $row['slot_max_qty'];
  43. $slot_min_qty[$key] = $row['slot_min_qty'];
  44. $price_hourly[$key] = $row['price_hourly'];
  45. $price_monthly[$key] = $row['price_monthly'];
  46. $price_year[$key] = $row['price_year'];
  47. $description[$key] = $row['description'];
  48. $img_url[$key] = $row['img_url'];
  49. $ftp[$key] = $row['ftp'];
  50. $install_method[$key] = $row['install_method'];
  51. $manual_url[$key] = $row['manual_url'];
  52. $access_rights[$key] = $row['access_rights'];
  53. }
  54. //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.
  55. array_multisort($service_name,
  56. $service_id,
  57. $home_cfg_id,
  58. $mod_cfg_id,
  59. $remote_server_id,
  60. $slot_max_qty,
  61. $slot_min_qty,
  62. $price_hourly,
  63. $price_monthly,
  64. $price_year,
  65. $description,
  66. $img_url,
  67. $ftp,
  68. $install_method,
  69. $manual_url,
  70. $access_rights, SORT_DESC, $services);
  71. foreach($services as $row)
  72. {
  73. ?>
  74. <div style="float:left; border: 4px solid transparent;border-bottom: 25px solid transparent;">
  75. <img src="<?php echo $row['img_url'] ;?>" width=280 height=132 border=0 alt="Bad Image">
  76. <br>
  77. <center><b><?php echo $row['service_name'];?></b></center>
  78. <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>
  79. </div>
  80. <?php
  81. }
  82. ?>
  83. </div>
  84. <?php
  85. }
  86. ?>