<?php $page = "About Us"; ?>
<?php include "../../routes/about.php"; ?>
<?php include "../layout/header.php"; ?>
<body>

    <?php include "../layout/navbar.php"; ?>

    <div class="container-fluid">
      <div class="row">
        <?php include "../layout/sidenav.php"; ?>
        
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
                <h1 class="h2">Edit <?php echo $page; ?></h1>
            </div>
            <form action="" method="POST" autocomplete="off" enctype="multipart/form-data">
                <div class="input-group mb-3">
                    <div class="custom-file ml-3">
                        <input type="hidden" name="oldImage" value="<?php echo $about->image; ?>">                                
                        <input type="file" name="fileToUpload" class="custom-file-input" id="thumbnail" aria-describedby="thumbnail">
                        <label class="custom-file-label" for="thumbnail">Choose thumbnail</label>
                    </div>    
                </div>
                <div class="input-group mb-3 justify-content-center">
                    <div class="col-6" id="displayThumbnail">
                        <img src="../assets/images/<?php echo $image->filename;?>" class="img-fluid">
                    </div>
                </div>
                <div class="input-group mb-3">
                    <h4>Description</h4>
                    <textarea name="description" class="form-control editor-sub" aria-label="Description" rows="10" placeholder="Write a short description"><?php echo $about->description; ?></textarea>
                </div>
                <div class="input-group mb-3">
                    <h4>Content</h4>
                    <textarea name="content" class="form-control editor-main" placeholder="Write content here"><?php echo $about->content; ?></textarea>
                </div>
                <div class="input-group mb-3">
                    <input type="submit" class="btn btn-sm btn-primary gsa-text-white" name="update" value="Update">
                </div>
            </form>
        </main>

      </div>
    </div>
</body>
</html>