Created
April 21, 2015 05:28
-
-
Save tranepura/7d5ddbc416d016148f94 to your computer and use it in GitHub Desktop.
To remove global variable $tax_config from conn.php ticket #2129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Ticket #2129 | |
| * Remove Global Variable $tax_settings from conn.php | |
| * | |
| */ | |
| class MainTaxSettings{ | |
| //Returns Tax rate by Country | |
| function getTaxRateByCountry ($country){ | |
| $taxRates = array( | |
| "default" => 0, | |
| "australia" => 10, | |
| "new_zealand" => 15, | |
| "united_states" => 0, | |
| "canada" => 0, | |
| "united_kingdom" => 20, | |
| "ireland" => 20, | |
| "south_africa" => 14 | |
| ); | |
| $taxRate = ""; | |
| foreach ($taxRates as $key => $value) { | |
| if ($key == $country) { | |
| $taxRate = $value; | |
| } | |
| } | |
| return $taxRate; | |
| } | |
| //returns a result set for sql query | |
| private function fetchRowFromSql ($sql){ | |
| $result_select = mysql_query($sql); | |
| if (mysql_num_rows($result_select)==0) | |
| { | |
| mysql_free_result($result_select); | |
| return null; | |
| } | |
| else | |
| { | |
| $fetchedrow = mysql_fetch_row($result_select); | |
| } | |
| $returnresult = $fetchedrow; | |
| return $returnresult; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment