<?php
/**
 * Countries manages required data for countries
 */
class Countries {

    /**
     * get currency by package
     * @param  INT $idPackage id for the package
     * @return String         curency
     */
    public function getCurrencyForPackage($idPackage){
        global $database;

        $sql = "SELECT c.currency
                FROM ".TABLES['countries']." c
                INNER JOIN ".TABLES['packages']." p
                ON p.idCountry=c.id
                WHERE p.id=$idPackage";
        $row = $database->fetchResultArray($sql);

        return !empty($row) ? $row[0] : '';
    }
}
