<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Page extends CI_Controller {
	public function __construct(){
		parent::__construct();
	}

	public function byId(){
		if(isset($_REQUEST['fiPageId']) > 0){
				$this->db->select('*')->from('hotel_static_pages');
				$this->db->where('hotel_static_pages.ID',$_REQUEST['fiPageId']);
				$rowPages = $this->db->get()->row_array();

				$query = 'select setting.s_value from setting where id=1';
		        $fontFmaily = $this->db->query($query);
		        $fontFmaily = $fontFmaily->result_array();

				if(isset($rowPages['fsDescription'])){
					?>
					<div class="pageDetails">
						<div class="details">
							<?php echo $rowPages['fsDescription']!=""?html_entity_decode($rowPages['fsDescription']):$rowPages['fsDescription']; ?>
						</div>
					</div>
					<style type="text/css">
						body{ margin:0; padding: 0; }
						.pageDetails{ padding: 15px; }
						.pageDetails .heading h1{ margin: 0; padding: 0; text-align: center; }
						.pageDetails .heading h1 span{ position: relative; }
						.pageDetails .heading h1 span::before{ position: absolute; content: ""; width: 150px; height: 3px; background: red; }

						<?php if ($fontFmaily[0]['s_value'] == "roboto") { ?>
							@font-face {
							  font-family: 'Roboto', sans-serif;
							  src: url('<?php echo base_url() ?>assets/ckeditor/customfonts/Roboto-Regular.woff') format('woff');
							}
							body{ font-family: 'Roboto', sans-serif !important; }

						<?php } elseif($fontFmaily[0]['s_value'] == "Optimo"){ ?>
							@font-face {
							 	font-family: 'TheMixSemiBold-Plain';
							  	src: url('<?php echo base_url() ?>assets/ckeditor/customfonts/themixsemilight-plain.woff') format('woff');
							}
							body{ font-family: 'TheMixSemiBold-Plain' !important; }
						<?php } else{ ?>

						<?php }  ?>
					</style>
					<?php
					die;
				
			}

		}else{
			header("HTTP/1.1 404 Not Found");
		}
		//echo "g"; die;
	}
}

?>

