source: extensions/MyPiwiShop/admin/config.php @ 27781

Revision 27781, 1.7 KB checked in by Miklfe, 6 years ago (diff)
Line 
1<?php
2defined('MPS_PATH') or die('Hacking attempt!');
3
4  $select_options_currency = array(
5   'AUD'=>'Australian Dollar(AUD)',
6   'BRL'=>'Brazilian Real(BRL)',
7   'CAD'=>'Canadian Dollar(CAD)',
8   'CZK'=>'Czech Koruna(CZK)',
9   'DKK'=>'Danish Krone(DKK)',
10   'EUR'=>'Euro(EUR)',
11   'HKD'=>'Hong Kong Dollar(HKD)',
12   'HUF'=>'Hungarian Forint(HUF)',
13   'ILS'=>'Israeli New Sheqel(ILS)',
14   'JPY'=>'Japanese Yen(JPY)',
15   'MYR'=>'Malaysian Ringgit(MYR)',
16   'MXN'=>'Mexican Peso(MXN)',
17   'NOK'=>'Norwegian Krone(NOK)',
18   'NZD'=>'New Zealand Dollar(NZD)',
19   'PHP'=>'Philippine Peso(PHP)',
20   'PLN'=>'Polish Zloty(PLN)',
21   'GBP'=>'Pound Sterling(GBP)',
22   'SGD'=>'Singapore Dollar(SGD)',
23   'SEK'=>'Swedish Krona(SEK)',
24   'CHF'=>'Swiss Franc(CHF)',
25   'TWD'=>'Taiwan New Dollar(TWD)',
26   'THB'=>'Thai Baht(THB)',
27   'USD'=>'U.S. Dollar(USD)'
28  );
29
30// update config 
31  if (isset($_POST['save_config'])) {
32 
33   $PPid                = $_POST['PPid'];
34   $currency    = $_POST['currency'];
35   $ship                = $_POST['ship'];
36   $comm                = $_POST['comm'];
37   $tprmulti    = $_POST['tprmulti'];
38   $tpruniq     = $_POST['tpruniq'];
39       
40   pwg_query('
41   UPDATE '.MPS_CONF_TABLE.'
42   SET PPid = \''.$PPid.'\',currency = \''.$currency.'\',ship = \''.$ship.'\',comm = \''.$comm.'\' ,tprmulti = \''.$tprmulti.'\',tpruniq = \''.$tpruniq.'\'
43   WHERE id = 1
44   ;');
45       
46    $page['infos']=l10n('Your configuration settings are saved');
47  }
48
49//set config
50  $query='
51  SELECT *
52  FROM '.MPS_CONF_TABLE.'
53  ;';
54  $result       = pwg_query($query);
55 
56  while($row = pwg_db_fetch_assoc($result)) {
57   $config = $row ;
58  }
59
60//template assign
61  $template->assign(array(
62   'mps_currency'       => $select_options_currency,
63   'mps_conf'           => $config
64  ));
65
66  $template->set_filename('mps_content', realpath(MPS_PATH . 'admin/template/config.tpl'));
Note: See TracBrowser for help on using the repository browser.