<?php
class ModelCatalogEbook extends Model {
	public function getData($product_id) {
		$this->load->model('catalog/product');

    $product = $this->model_catalog_product->getProduct($product_id);

    if (strtotime($product['acceptdate'])<(time()+86400)) return "E-kniha již není zapůjčena";

    $data = file_get_contents(DIR_BOOKS.$product['meta_title'].".html");
    
    $data = "<div class='DRM'>Zapůjčeno do ".date($this->language->get('date_format_short'), strtotime($product['acceptdate']))
      ." uživateli ".$this->customer->getFirstName()." ".$this->customer->getLastName()." (".$this->customer->getEmail().")"
      ."</div>"
      .$data;
    return $data;
	}
}