Example #1
0
// If the POST forms are set, override the retrieved settings
$currency = "";
$countrycode = "";
if ($_POST['currencycode']) {
    $currency = $_POST['currencycode'];
}
if ($_POST['countrycode']) {
    $countrycode = $_POST['countrycode'];
}
if ($_POST['Save']) {
    $fv = new formValidator();
    //from functions.php
    $fv->validateEmpty('countrycode', $_L['CUR_country_error']);
    $fv->validateEmpty('currencycode', $_L['CUR_currency_error1']);
    if (!empty($_POST['currencycode'])) {
        $fv->validateAlphabetic('currencycode', $_L['CUR_currency_error2']);
    }
    if ($fv->checkErrors()) {
        //display errors
        $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>";
    } else {
        Save_Currency($countrycode, $currency);
    }
}
// Retrieve the currency for the country code currently set.
$currency = Get_Currency_by_Countrycode($countrycode);
?>

       <table height="500" class="listing-table">	        
	       <tbody>
	       	<tr>