<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="book-add-wrapper">
            <h2>Grāmatas pievienošana</h2>
            <?php echo Form::open(array('files'=>true, 'url' => '/admin/book')); ?>

            <div class="form-group">
                <?php echo Form::label('name', 'Nosaukums', array('class' => 'control-label')); ?>

                <?php echo Form::text('name','',array('class' => 'form-control','required')); ?>

            </div>

            <div class="form-group">
                <?php echo Form::label('author', 'Autori',array('class' => 'control-label')); ?>

                <select class="form-control author-ajax" multiple="multiple" id="author" name="author[]">
                </select>
            </div>

            <div class="form-group">
                <?php echo Form::label('series', 'Sērija', array('class' => 'control-label')); ?>

                <?php echo Form::text('series','',array('class' => 'form-control')); ?>

            </div>

            <div class="form-group">
                <?php echo Form::label('series_nr', 'Daļas numurs',array('class' => 'control-label')); ?>

                <?php echo Form::text('series_nr','',array('class' => 'form-control')); ?>

            </div>

            <div class="form-group">
                <?php echo Form::label('isbn', 'ISBN',array('class' => 'control-label')); ?>

                <?php echo Form::text('isbn','',array('class' => 'form-control')); ?>

            </div>

            <?php $genreModel = new Genre(); ?>
            <div class="form-group">
                <?php echo Form::label('genre', 'Kategorija',array('class' => 'control-label')); ?>

                <select class="form-control" required="required" multiple="multiple" id="genre" name="genre[]">
                    <?php foreach($genres as $genre): ?>
                        <optgroup label="<?php echo $genre->name; ?>">
                            <?php foreach($genre->subGenres as $subGenre): ?>
                                <option value="<?php echo $subGenre->id; ?>" ><?php echo $subGenre->name; ?></option>
                            <?php endforeach; ?>
                        </optgroup>
                    <?php endforeach; ?>
                </select>
            </div>

            <div class="form-group col-xs-9">
                <?php echo Form::label('publisher', 'Izdevniecība',array('class' => 'control-label')); ?>

                <?php echo Form::select('publisher', array(null => 'Izvēlieties izdevēju') + $publishers->lists('name', 'id'), null, array('class' => 'form-control','required')); ?>

            </div>

            <div class="form-group col-xs-3">
                <?php echo Form::label('year', 'Izdošanas gads',array('class' => 'control-label')); ?>

                <?php echo Form::text('year','',array('class' => 'form-control')); ?>

            </div>

            <div class="form-group col-xs-9">
                <?php echo Form::label('subject', 'Mācību priekšmets',array('class' => 'control-label')); ?>

                <?php echo Form::select('subject', array(null => 'Izvēlieties mācību priekšmetu') + $subjects->lists('name', 'id'), null, array('class' => 'form-control')); ?>

            </div>

            <div class="form-group col-xs-3">
                <?php echo Form::label('grade', 'Klase',array('class' => 'control-label')); ?>

                <?php echo Form::text('grade','',array('class' => 'form-control')); ?>

            </div>

            <?php /*<div class="form-group">*/ ?>
                <?php /*<?php echo Form::label('image', 'Attēls',array('class' => 'control-label')); ?>*/ ?>
                <?php /*<?php echo Form::file('image', array('class' => 'form-control')); ?>*/ ?>
            <?php /*</div>*/ ?>

            <div class="form-group col-xs-6">
                <?php echo Form::label('is_new', 'Grāmatas iepirkuma veids', array('class' => 'control-label')); ?>

                <?php echo Form::select('is_new', array('0' => 'Rekataloģizācija', '1' => 'Jauna'), '0', array('class' => 'form-control no-search','required')); ?>

            </div>

            <div class="form-group col-xs-6">
            </div>

            <div class="form-group col-xs-12">
                <?php echo Form::label('tags', 'Atslēgvārdi',array('class' => 'control-label')); ?>

                <?php echo Form::textarea('tags','',array('class' => 'form-control tags')); ?>

            </div>

            <div class="form-group">
                <div class="col-xs-6 col-xs-offset-4">
                    <?php echo Form::submit('Pievienot!',array('class' => 'btn btn-success')); ?>

                </div>
            </div>

                <?php echo Form::close(); ?>


        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>