[Weberp-svn] SF.net SVN: weberp:[8881] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-05-10 18:57:14
|
Revision: 8881 http://weberp.svn.sourceforge.net/weberp/?rev=8881&view=rev Author: tim_schofield Date: 2012-05-10 18:57:08 +0000 (Thu, 10 May 2012) Log Message: ----------- Check country name is entered before updatin database Modified Paths: -------------- trunk/Currencies.php trunk/includes/MiscFunctions.php Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2012-05-10 18:56:52 UTC (rev 8880) +++ trunk/Currencies.php 2012-05-10 18:57:08 UTC (rev 8881) @@ -80,6 +80,12 @@ $Errors[$i] = 'Country'; $i++; } + if (strlen($_POST['Country']) == 0) { + $InputError = 1; + prnMsg(_('You must enter a country name'),'error'); + $Errors[$i] = 'Country'; + $i++; + } if (strlen($_POST['HundredsName']) > 15) { $InputError = 1; prnMsg(_('The hundredths name must be 15 characters or less long'),'error'); Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2012-05-10 18:56:52 UTC (rev 8880) +++ trunk/includes/MiscFunctions.php 2012-05-10 18:57:08 UTC (rev 8881) @@ -172,13 +172,11 @@ $stack = array(); foreach ($tags as $tag) { $index = count($elements); - if (isset($tag['attributes']) and ($tag['type'] == 'complete' OR $tag['type'] == 'open')) { + if ($tag['type'] == 'complete' OR $tag['type'] == 'open') { $elements[$index] = new XmlElement; $elements[$index]->name = $tag['tag']; - $elements[$index]->attributes = $tag['attributes']; - if (isset($tag['value'])) { - $elements[$index]->content = $tag['value']; - } +// $elements[$index]->attributes = $tag['attributes']; +// $elements[$index]->content = $tag['value']; if ($tag['type'] == 'open') { // push $elements[$index]->children = array(); $stack[count($stack)] = &$elements; @@ -193,10 +191,8 @@ $Currencies = array(); - if (isset($elements)) { - foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ - $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; - } + foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ + $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; } $Currencies['EUR']=1; //ECB delivers no rate for Euro //return an array of the currencies and rates @@ -238,7 +234,6 @@ } } - function AddCarriageReturns($str) { return str_replace('\r\n',chr(10),$str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |