<body id="page-top">

    <!-- Sidebar -->
    <?php $this->load->view('restricted/layout/sidebar_admin'); ?>
    <!-- Sidebar -->

    <div id="content-wrapper" class="d-flex flex-column">
        <div id="content">

            <!-- NavBar -->
            <?php $this->load->view('restricted/layout/navbar'); ?>
            <!-- Navbar -->

            <!-- Container Fluid-->
            <div class="container-fluid" id="container-wrapper">
                <div class="d-sm-flex align-items-center justify-content-between mb-4">
                    <h1 class="h3 mb-0 text-purple"><?php echo $title; ?></h1>
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="./">Home</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo $title; ?></li>
                    </ol>
                </div>


                <!--  -->
                <?php
                if (isset($book)) {
                  $book_id = $book->id;
                } else {
                  $book_id = '';
                }
                ?>
                <!--  -->

                <div class="row mb-3">
                    <!-- Pending Requests Card Example -->
                    <div class="col-xl-7 col-md-7 mb-4" style="margin: 0 auto;">
                    <div class="py-3 d-flex flex-row align-items-center justify-content-between">
                        <p></p>
                        <a href="<?php echo base_url('restricted/admin/books/'); ?>" class="btn btn-primary"><i class="fas fa-arrow-left"></i>&nbsp;&nbsp;Voltar</a>
                    </div>
                        <div class="card">
                            <div class="card-body">
                                <h6 class="mb-3 font-weight-bold text-primary"><?php echo $title; ?></h6>
                                
                            <?php echo form_open('restricted/admin/books/core/' .  $book_id); ?>
                                <div class="form-group row mt-1">
                                    <div class="col-sm-12">
                                        <label for="title">Título</label>
                                        <input type="text" class="form-control" name="title" id="title"  placeholder="Título..." value="<?php echo isset($book) ? $book->title : set_value('title'); ?> ">
                                        <?php echo form_error('title', '<div class="text-danger">', '</div>'); ?>
                                    </div>
                                    <div class="col-sm-12 mt-2">
                                        <label for="title">Regras de submissão</label>
                                        <textarea class="ck_editor_general" name="submission_rule" rows="10"><?php echo isset($book) ? $book->submission_rule : set_value('submission_rule'); ?></textarea>
                                    </div>
                                    <div class="col-sm-4 mt-2">
                                        <button class="btn btn-primary">Salvar</button>
                                    </div>
                                </div>
                            <?php echo form_close(); ?>

                            </div>
                        </div>
                    </div>

                </div><!--/Row-->

                <!-- Modal Logout -->
                <?php $this->load->view('restricted/layout/modal_logout'); ?>
                <!-- /Modal -->

            </div><!--- /Container Fluid-->
        </div><!-- /Content -->
