root/trunk/gui/orderpanel/index.php

Revision 1327, 3.5 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 require '../include/ispcp-lib.php';
22
23 $tpl = new pTemplate();
24
25 $tpl->define_dynamic('page', Config::get('PURCHASE_TEMPLATE_PATH') . '/index.tpl');
26 $tpl->define_dynamic('purchase_list', 'page');
27 $tpl->define_dynamic('purchase_message', 'page');
28 $tpl->define_dynamic('purchase_header', 'page');
29 $tpl->define_dynamic('purchase_footer', 'page');
30
31 /*
32 * Functions start
33 */
34 function gen_packages_list(&$tpl, &$sql, $user_id) {
35     if (Config::exists('HOSTING_PLANS_LEVEL') && Config::get('HOSTING_PLANS_LEVEL') === 'admin') {
36         $query = <<<SQL_QUERY
37             select
38                 t1.*,
39                 t2.admin_id, t2.admin_type
40             from
41                 hosting_plans as t1,
42                 admin as t2
43             where
44                 t2.admin_type=?
45             and
46                 t1.reseller_id = t2.admin_id
47             and
48                 t1.status=1
49             order by
50                 t1.id
51 SQL_QUERY;
52
53         $rs = exec_query($sql, $query, array('admin'));
54     } else {
55         $query = <<<SQL_QUERY
56                 select
57                     *
58                 from
59                     hosting_plans
60                 where
61                     reseller_id = ?
62                   and
63                     status = '1'
64 SQL_QUERY;
65
66         $rs = exec_query($sql, $query, array($user_id));
67     }
68
69     if ($rs->RecordCount() == 0) {
70         system_message(tr('No available hosting packages'));
71     } else {
72         while (!$rs->EOF) {
73             $description = $rs->fields['description'];
74             if ($description == '') {
75                 $description = '';
76             }
77             $price = $rs->fields['price'];
78             if ($price == 0 || $price == '') {
79                 $price = "/ " . tr('free of charge');
80             } else {
81                 $price = "/ " . $price . " " . $rs->fields['value'] . " " . $rs->fields['payment'];
82             }
83
84             $tpl->assign(
85                 array('PACK_NAME' => $rs->fields['name'],
86                     'PACK_ID' => $rs->fields['id'],
87                     'USER_ID' => $user_id,
88                     'PURCHASE' => tr('Purchase'),
89                     'PACK_INFO' => $description,
90                     'PRICE' => $price,
91                     )
92                 );
93
94             $tpl->parse('PURCHASE_LIST', '.purchase_list');
95
96             $rs->MoveNext();
97         }
98     }
99 }
100
101 /*
102 * Functions end
103 */
104
105 /*
106 *
107 * static page messages.
108 *
109 */
110
111 if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) {
112     $user_id = $_GET['user_id'];
113     $_SESSION['user_id'] = $user_id;
114 } else if (isset($_SESSION['user_id'])) {
115     $user_id = $_SESSION['user_id'];
116 } else {
117     system_message(tr('You do not have permission to access this interface!'));
118 }
119 if (isset($_SESSION['plan_id']))
120     unset($_SESSION['plan_id']);
121
122 gen_purchase_haf($tpl, $sql, $user_id);
123 gen_packages_list($tpl, $sql, $user_id);
124
125 gen_page_message($tpl);
126
127 $tpl->assign(
128     array('THEME_CHARSET' => tr('encoding'),
129         )
130     );
131
132 $tpl->parse('PAGE', 'page');
133 $tpl->prnt();
134
135 if (Config::get('DUMP_GUI_DEBUG'))
136     dump_gui_debug();
137
138 unset_messages();
139
140 ?>
Note: See TracBrowser for help on using the browser.