<?php

class ModelSetupCurrencyRate extends HModel {

    protected function getTable() {
        return 'currency_rate';
    }

    public function getCurrencyRate($currency_id, $date) {
        $sql = "";
        $sql .= " SELECT *";
        $sql .= " FROM currency_rate";
        $sql .= " WHERE currency_id = '$currency_id'";
        $sql .= " AND DATE <='$date'";
        $sql .= " ORDER BY DATE DESC";

        $query = $this->conn->query($sql);
        return $query->row;
    }

}

?>