<?php


if (isset($_GET['id'])) {
    $id = $_GET['id'];

    $conn = get_instance()->db->conn_id;
    $sql = "SELECT * FROM ebook WHERE id='$id'";
    $result = $conn->query($sql);
    $row = $result->fetch_assoc();
    ?>
    <!doctype html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
            <title>View Page Demo</title>
            <!--<link href="<?php echo editor() ?>css/theme.css" rel="stylesheet"
                  type="text/css" />-->
            <link rel="stylesheet" href="<?php echo editor() ?>css/bootnavbar.css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">

            <style>
                <?php
                $fff =  html_entity_decode($row['style']) . "\n";
                echo  str_replace('&#039;', '"', $fff);
                ?>
            </style>
        </head>
        <body>

           <?php
             $data = htmlspecialchars_decode($row['content']);
             $string = str_replace('&#039;', '"', $data);
             echo str_replace('\n', ' ', $string);
            ?>
            <script src="<?php echo editor() ?>js/bootstrap.min.js"
            type="text/javascript"></script>
            <script src="<?php echo editor() ?>js/jquery.min.js"
            type="text/javascript"></script>
            <script src="<?php echo editor() ?>js/popper.min.js"
            type="text/javascript"></script>
            <script src="<?php echo editor() ?>js/bootnavbar.js"></script>
            <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
            <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
            <script>
                $(function () {
                    $('#main_navbar').bootnavbar();
                })
            </script>
        </body>
    </html>
    <?php
}else{
    header('Location: list.php');
}
?>