Quick Search:

View

Revision:

Diff

Diff from 1855 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/admin/includes/applications/currencies/actions/update_rates.php

Annotated File View

hpdl
1855
1 <?php
2 /*
3   $Id: update_rates.php 1855 2009-02-28 03:56:52Z hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2009 osCommerce
9
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
13 */
14
15   class osC_Application_Currencies_Actions_update_rates extends osC_Application_Currencies {
16     public function __construct() {
17       global $osC_Language, $osC_MessageStack;
18
19       parent::__construct();
20
21       $this->_page_contents = 'update_rates.php';
22
23       if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
24         if ( isset($_POST['service']) && (($_POST['service'] == 'oanda') || ($_POST['service'] == 'xe')) ) {
25           $results = osC_Currencies_Admin::updateRates($_POST['service']);
26
27           foreach ( $results[0] as $result ) {
28             $osC_MessageStack->add($this->_module, sprintf($osC_Language->get('ms_error_invalid_currency'), $result['title'], $result['code']), 'error');
29           }
30
31           foreach ( $results[1] as $result ) {
32             $osC_MessageStack->add($this->_module, sprintf($osC_Language->get('ms_success_currency_updated'), $result['title'], $result['code']), 'success');
33           }
34         }
35
36         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
37       }
38     }
39   }
40 ?>