root/trunk/gui/reseller/order_settings.php

Revision 1327, 3.2 kB (checked in by rats, 4 months ago)

* Fixed: --scan-knownbad-files and --check-deleted are no longer supported by rkhunter
* Fixed #1471: chkrootkit should be in lenny / hardy
* Updated Chinese (simplified)
* Updated German
* Fixed #1475: typo on installation (ispcp-setup)
* Fixed: default user for rkhunter.log

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 define('OVERRIDE_PURIFIER', true);
22
23 require '../include/ispcp-lib.php';
24
25 check_login(__FILE__);
26
27 $tpl = new pTemplate();
28 $tpl->define_dynamic('page', Config::get('RESELLER_TEMPLATE_PATH') . '/order_settings.tpl');
29 $tpl->define_dynamic('logged_from', 'page');
30 // Table with orders
31 $tpl->define_dynamic('purchase_header', 'page');
32
33 $tpl->define_dynamic('purchase_footer', 'page');
34 $tpl->define_dynamic('page_message', 'page');
35
36 $theme_color = Config::get('USER_INITIAL_THEME');
37
38 $tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Reseller/Order settings'),
39         'THEME_COLOR_PATH' => "../themes/$theme_color",
40         'THEME_CHARSET' => tr('encoding'),
41         'ISP_LOGO' => get_logo($_SESSION['user_id'])));
42 // Functions
43 // *
44 // *
45 function save_haf(&$tpl, &$sql) {
46     $user_id = $_SESSION['user_id'];
47     $header = $_POST['header'];
48     $footer = $_POST['footer'];
49
50     $query = <<<SQL_QUERY
51         select
52             id
53         from
54             orders_settings
55         where
56             user_id = ?
57 SQL_QUERY;
58     $rs = exec_query($sql, $query, array($user_id));
59
60     if ($rs->RecordCount() !== 0) {
61         // update query
62         $query = <<<SQL_QUERY
63         update
64             orders_settings
65         set
66             header = ?,
67             footer = ?
68         where
69             user_id = ?
70 SQL_QUERY;
71
72         $rs = exec_query($sql, $query, array($header, $footer, $user_id));
73     } else {
74         // create query
75         $query = <<<SQL_QUERY
76               insert into
77                       orders_settings(user_id, header, footer)
78               values
79                  (?, ?, ?)
80 SQL_QUERY;
81
82         $rs = exec_query($sql, $query, array($user_id, $header, $footer));
83     }
84 }
85
86 // end of functions
87
88 /*
89  *
90  * static page messages.
91  *
92  */
93 if (isset($_POST['header']) && $_POST['header'] !== '' && isset ($_POST['footer']) && $_POST['footer'] !== '')
94     save_haf($tpl, $sql);
95
96 gen_purchase_haf($tpl, $sql, $_SESSION['user_id'], true);
97
98 gen_reseller_mainmenu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/main_menu_orders.tpl');
99 gen_reseller_menu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/menu_orders.tpl');
100
101 gen_logged_from($tpl);
102
103 $tpl->assign(array('TR_MANAGE_ORDERS' => tr('Manage Orders'),
104         'TR_APPLY_CHANGES' => tr('Apply changes'),
105         'TR_HEADER' => tr('Header'),
106         'TR_PREVIEW' => tr('Preview'),
107         'TR_IMPLEMENT_INFO' => tr('Implementation URL'),
108         'TR_IMPLEMENT_URL' => 'http://' . Config::get('BASE_SERVER_VHOST') . '/orderpanel/index.php?user_id=' . $_SESSION['user_id'],
109         'TR_FOOTER' => tr('Footer')));
110
111 gen_page_message($tpl);
112
113 $tpl->parse('PAGE', 'page');
114 $tpl->prnt();
115
116 if (Config::get('DUMP_GUI_DEBUG'))
117     dump_gui_debug();
118
119 unset_messages();
120 ?>
Note: See TracBrowser for help on using the browser.