2 /************************************************************************
3 * MXChange v0.2.1 Start: 06/10/2005 *
4 * =============== Last change: 05/18/2008 *
6 * -------------------------------------------------------------------- *
7 * File : what-sponsor_infos.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Informations and prices for the sponsor *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Informationen/Preise fuer den Sponsoren *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software. You can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License. *
22 * This program is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25 * GNU General Public License for more details. *
27 * You should have received a copy of the GNU General Public License *
28 * along with this program; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
31 ************************************************************************/
33 // Some security stuff...
34 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
40 // Add description as navigation point
41 ADD_DESCR("guest", basename(__FILE__));
46 // Load all sponsor actions
47 $result_act = SQL_QUERY("SELECT DISTINCT m.title, c.conv_rate, c.conv_name
48 FROM "._MYSQL_PREFIX."_sponsor_menu AS m
49 LEFT JOIN "._MYSQL_PREFIX."_sponsor_action_convert AS c ON m.what=c.ext_name
50 LEFT JOIN "._MYSQL_PREFIX."_sponsor_registry AS r ON m.what=r.ext_name
51 WHERE m.action='actions' AND r.is_active='Y'
52 ORDER BY m.sort ASC", __FILE__, __LINE__);
53 $num_act = SQL_NUMROWS($result_act);
58 $OUT_ACT = ""; $SW = 2;
59 while (list($title, $conv, $name) = SQL_FETCHROW($result_act))
61 // Prepare data for the row template
65 'conv' => round($conv),
69 // Load row template and switch color
70 $OUT_ACT .= LOAD_TEMPLATE("guest_sponsor_act_row", true, $content);
74 // Check for pay types
75 $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name", __FILE__, __LINE__);
76 if (SQL_NUMROWS($result_pay) > 0)
79 $OUT_PAY = ""; $SW = 2;
80 while (list($name, $rate, $min, $curr) = SQL_FETCHROW($result_pay))
82 // Prepare data for the row template
86 'rate' => TRANSLATE_COMMA($rate),
92 if (!ereg(",", $content['price']))
95 $content['price'] .= ",".str_repeat("0", $_CONFIG['max_comma']);
98 // Load row template and switch color
99 $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content);
105 // No pay types setuped so far!
106 $OUT_PAY = "<TR><TD colspan=\"2\">
107 ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
113 // No actions activated so far!
114 $OUT_ACT = "<TR><TD colspan=\"2\" class=\"bottom2\" style=\"padding-top: 10px; padding-bottom: 10px\">
115 ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
117 $OUT_PAY = "<TR><TD colspan=\"2\" class=\"bottom2\" style=\"padding-top: 10px; padding-bottom: 10px\">
118 ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
122 // Transfer rows to constans
123 define('__SPONSOR_ACTIONS' , $OUT_ACT);
124 define('__SPONSOR_PAYTYPES', $OUT_PAY);
127 if (isset($result_act)) SQL_FREERESULT($result_act);
128 if (isset($result_pay)) SQL_FREERESULT($result_pay);
130 // Load main template
131 LOAD_TEMPLATE("guest_sponsor_infos");