Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (85) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-08-12 (1 month ago) | Not yet rated by the users | Total: 18 This week: 2 | All time: 10,036 This week: 169 |
Version | License | PHP version | Categories | |||
nbg-currency 1.0 | Custom (specified... | 5 | PHP 5, Web services, Finances |
Description | Author | |
This package is specific mainly for applications used in Georgia .
This class can get currency values from National Bank of Georgia. |
PHP Library for getting data from National Bank of Georgia (NBG)'s API.
See documentation generated by phpDocumentor in docs/ folder.
You can install this library with Composer:
Include composer autoloader in your main file (Ex.: index.php)
Import Classes:
Now you can create new Currency
Class object ex. for USD
currency:
The Currency
class constructor takes a single argument - the Currency Code.
You can pass it manually (ISO 4217) or using ABGEO\NBG\Helper\CurrencyCodes
class constants:
AED, AMD, AUD, AZN, BGN, BYR, CAD, CHF, CNY, CZK, DKK, EEK, EGP, EUR,
GBP, HKD, HUF, ILS, INR, IRR, ISK, JPY, KGS, KWD, KZT, LTL, LVL, MDL,
NOK, NZD, PLN, RON, RSD, RUB, SEK, SGD, TJS, TMT, TRY, UAH, USD, UZS.
After creating a class object, we can get currency data. The API gives us:
...
echo "Currency: \t{$USD->getCurrency()}\n";
echo "Description: \t{$USD->getDescription()}\n";
echo "Change: \t{$USD->getChange()}\n";
echo "Change Rate: \t{$USD->getRate()}\n";
echo "Date: \t\t{$USD->getDate()->format('m/d/Y')}\n";
...
<?php
// Include Composer Autoloader.
require_once __DIR__.'/../vendor/autoload.php';
// Import namespace.
use ABGEO\NBG\Currency;
use ABGEO\NBG\Helper\CurrencyCodes;
// Create new Currency class object for USD and EUR Currencies.
$USD = new Currency(CurrencyCodes::USD);
$EUR = new Currency(CurrencyCodes::EUR);
// Print results.
echo "USD: \n\n";
echo "Currency: \t{$USD->getCurrency()}\n";
echo "Description: \t{$USD->getDescription()}\n";
echo "Change: \t{$USD->getChange()}\n";
echo "Change Rate: \t{$USD->getRate()}\n";
echo "Date: \t\t{$USD->getDate()->format('m/d/Y')}\n";
echo "\n------------------------------------------\n\n";
echo "EUR: \n\n";
echo "Currency: \t{$EUR->getCurrency()}\n";
echo "Description: \t{$EUR->getDescription()}\n";
echo "Change: \t{$EUR->getChange()}\n";
echo "Change Rate: \t{$EUR->getRate()}\n";
echo "Date: \t\t{$EUR->getDate()->format('m/d/Y')}\n";
You can use ABGEO\NBG\Exporter
Class for exporting currency data to CSV file or PHP Stream output.
ABGEO\NBG\Exporter
class has export()
method that takes 3 arguments:
...
Exporter::export(CurrencyCodes::USD, Exporter::EXPORT_2_FILE, 'single.csv');
...
...
Exporter::export(
[
CurrencyCodes::USD,
CurrencyCodes::EUR,
CurrencyCodes::BGN,
CurrencyCodes::AMD,
],
Exporter::EXPORT_2_STREAM
);
...
NOTE: Don't print anything before exporting to stream coz we use header()
function.
This project is licensed under the MIT License - see the LICENSE file for details
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 file, 1 directory) | ||||
docs (2 files, 9 directories) | ||||
examples (1 file) | ||||
src (2 files, 3 directories) | ||||
tests (1 file) | ||||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Read me |
Files | / | docs |
Files | / | docs | / | classes |
File | Role | Description |
---|---|---|
ABGEO.NBG.Currency.html | Doc. | Documentation |
ABGEO.NBG.CurrencyDataTrait.html | Doc. | Documentation |
ABGEO.NBG.Exceptio...rencyException.html | Doc. | Documentation |
ABGEO.NBG.Exporter.html | Doc. | Documentation |
ABGEO.NBG.Model.Currency.html | Doc. | Documentation |
Files | / | docs | / | css |
File | Role | Description | ||
---|---|---|---|---|
phpdocumentor-clean-icons (2 files, 1 directory) | ||||
bootstrap-combined.no-icons.min.css | Data | Auxiliary data | ||
font-awesome.min.css | Data | Auxiliary data | ||
jquery.iviewer.css | Data | Auxiliary data | ||
prism.css | Data | Auxiliary data | ||
template.css | Data | Auxiliary data |
Files | / | docs | / | css | / | phpdocumentor-clean-icons |
File | Role | Description | ||
---|---|---|---|---|
fonts (2 files) | ||||
lte-ie7.js | Data | Auxiliary data | ||
style.css | Data | Auxiliary data |
Files | / | docs | / | css | / | phpdocumentor-clean-icons | / | fonts |
File | Role | Description |
---|---|---|
phpdocumentor-clean-icons.dev.svg | Data | Auxiliary data |
phpdocumentor-clean-icons.svg | Data | Auxiliary data |
Files | / | docs | / | files |
File | Role | Description | ||
---|---|---|---|---|
Exception (1 file) | ||||
Helper (1 file) | ||||
Model (1 file) | ||||
Currency.html | Doc. | Documentation | ||
Currency.php.txt | Doc. | Documentation | ||
CurrencyDataTrait.html | Doc. | Documentation | ||
CurrencyDataTrait.php.txt | Doc. | Documentation | ||
Exception.InvalidCurrencyException.html | Doc. | Documentation | ||
Exporter.html | Doc. | Documentation | ||
Exporter.php.txt | Doc. | Documentation | ||
Helper.CurrencyCodes.html | Doc. | Documentation | ||
Model.Currency.html | Doc. | Documentation |
Files | / | docs | / | files | / | Exception |
File | Role | Description |
---|---|---|
InvalidCurrencyException.php.txt | Doc. | Documentation |
Files | / | docs | / | graphs |
File | Role | Description |
---|---|---|
class.html | Doc. | Documentation |
classes.svg | Data | Auxiliary data |
Files | / | docs | / | images |
File | Role | Description | ||
---|---|---|---|---|
iviewer (8 files) | ||||
apple-touch-icon-114x114.png | Icon | Icon image | ||
apple-touch-icon-72x72.png | Icon | Icon image | ||
apple-touch-icon.png | Icon | Icon image | ||
custom-icons.svg | Data | Auxiliary data | ||
favicon.ico | Data | Auxiliary data | ||
hierarchy-item.png | Icon | Icon image | ||
icon-class-13x13.png | Icon | Icon image | ||
icon-class.svg | Data | Auxiliary data | ||
icon-interface-13x13.png | Icon | Icon image | ||
icon-interface.svg | Data | Auxiliary data | ||
icon-trait-13x13.png | Icon | Icon image | ||
icon-trait.svg | Data | Auxiliary data |
Files | / | docs | / | images | / | iviewer |
File | Role | Description |
---|---|---|
grab.cur | Data | Auxiliary data |
hand.cur | Data | Auxiliary data |
iviewer.rotate_left.png | Icon | Icon image |
iviewer.rotate_right.png | Icon | Icon image |
iviewer.zoom_fit.png | Icon | Icon image |
iviewer.zoom_in.png | Icon | Icon image |
iviewer.zoom_out.png | Icon | Icon image |
iviewer.zoom_zero.png | Icon | Icon image |
Files | / | docs | / | js |
File | Role | Description | ||
---|---|---|---|---|
ui (1 directory) | ||||
bootstrap.min.js | Data | Auxiliary data | ||
html5.js | Data | Auxiliary data | ||
jquery-1.11.0.min.js | Data | Auxiliary data | ||
jquery.dotdotdot-1.5.9.js | Data | Auxiliary data | ||
jquery.dotdotdot-1.5.9.min.js | Data | Auxiliary data | ||
jquery.iviewer.js | Data | Auxiliary data | ||
jquery.iviewer.min.js | Data | Auxiliary data | ||
jquery.mousewheel.js | Data | Auxiliary data | ||
jquery.smooth-scroll.js | Data | Auxiliary data | ||
prism.min.js | Data | Auxiliary data |
Files | / | docs | / | namespaces |
File | Role | Description |
---|---|---|
ABGEO.html | Doc. | Documentation |
ABGEO.NBG.Exception.html | Doc. | Documentation |
ABGEO.NBG.html | Doc. | Documentation |
ABGEO.NBG.Model.html | Doc. | Documentation |
default.html | Doc. | Documentation |
Files | / | docs | / | reports |
File | Role | Description |
---|---|---|
deprecated.html | Doc. | Documentation |
errors.html | Doc. | Documentation |
markers.html | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Exception (1 file) | ||||
Helper (1 file) | ||||
Model (1 file) | ||||
Currency.php | Class | Class source | ||
Exporter.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.