<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$sourceFile = FCPATH . '_tmp_gotur/gotur-html/destination-one.html';
$content = '';

if (is_file($sourceFile)) {
    $html = file_get_contents($sourceFile);

    if ($html !== false && preg_match('/<section class="page-header">[\s\S]*?<footer class="main-footer">/i', $html, $matches)) {
        $content = preg_replace('/<footer class="main-footer">[\s\S]*$/i', '', $matches[0]);

        $content = str_replace(
            ['src="assets/', 'href="assets/', "url(assets/"],
            ['src="' . base_url('assets/') , 'href="' . base_url('assets/') , 'url(' . base_url('assets/')],
            $content
        );
    }
}
?>
<?php if ($content !== ''): ?>
<?php echo $content; ?>
<?php else: ?>
<section class="page-header">
    <div class="container">
        <div class="page-header__content">
            <h2 class="page-header__title">Destinations</h2>
        </div>
    </div>
</section>
<?php endif; ?>
