<div class="modal-header">

    <button type="button" class="close" data-dismiss="modal" aria-label="Close">

        <span aria-hidden="true">&times;</span>

    </button>

    <h4 class="modal-title">Шинээр нэмэх</h4>

</div>

<?php echo Form::open(['url' => '/admin/category', 'method' => 'post', 'id' => 'category']); ?>


<input type="hidden" value="<?php echo $parent_id; ?>" name="parent_id">

<div class="modal-body">

    <div class="form-body">

        <div class="form-group <?php echo $errors->has('lang_id') ? 'has-error' : ''; ?>">

            <?php echo Form::label('lang_id', 'Хэл'); ?>


            <select name="lang_id" id="lang_id" class="form-control">

                <?php foreach($languages as $value): ?>

                    <option value="<?php echo $value->id; ?>" <?php echo ($value->id == Session::get('locale')) ? 'selected' : ''; ?>>
                        <?php echo $value->title; ?>

                    </option>

                <?php endforeach; ?>

            </select>

            <span class="help-block">

                <?php echo $errors->has('lang_id') ? $errors->first('lang_id') : ''; ?>


            </span>

        </div>

        <div class="form-group <?php echo $errors->has('title') ? 'has-error' : ''; ?>">

            <?php echo Form::label('title', 'Нэр'); ?>


            <?php echo Form::text('title', Input::get('title'), ['class' => 'form-control', 'placeholder' => 'Нэр']); ?>


            <span class="help-block">

                <?php echo $errors->has('title') ? $errors->first('title') : ''; ?>


            </span>

        </div>

        <?php if(Auth::user()->username == 'admin'): ?>

            <div class="form-group <?php echo $errors->has('key_name') ? 'has-error' : ''; ?>">

                <?php echo Form::label('key_name', 'Онцлох үг'); ?>


                <?php echo Form::text('key_name', Input::get('key_name'), ['class' => 'form-control', 'placeholder' => 'Онцлох үг']); ?>


                <span class="help-block">

                    <?php echo $errors->has('key_name') ? $errors->first('key_name') : ''; ?>


                </span>

            </div>

        <?php endif; ?>

        <div class="form-group <?php echo $errors->has('short_content') ? 'has-error' : ''; ?>">

            <?php echo Form::label('short_content', 'Товч мэдээлэл'); ?>


            <textarea name="short_content" id="short_content" class="ckeditor" cols="30"
                      rows="10"><?php echo Input::get('short_content'); ?></textarea>

            <span class="help-block">

                <?php echo $errors->has('short_content') ? $errors->first('short_content') : ''; ?>


            </span>

        </div>

        <div class="form-group <?php echo $errors->has('content') ? 'has-error' : ''; ?>">

            <?php echo Form::label('content', 'Дэлгэрэнгүй мэдээлэл'); ?>


            <textarea name="content" id="content" class="ckeditor" cols="30"
                      rows="10"><?php echo Input::get('content'); ?></textarea>

            <span class="help-block">

                <?php echo $errors->has('content') ? $errors->first('content') : ''; ?>


            </span>

        </div>

        <div class="form-group <?php echo $errors->has('link') ? 'has-error' : ''; ?>">

            <?php echo Form::label('link', 'Холбоос'); ?>


            <?php echo Form::text('link', Input::get('link'), ['class' => 'form-control', 'placeholder' => 'Холбоос']); ?>


            <span class="help-block">

                <?php echo $errors->has('link') ? $errors->first('link') : ''; ?>


            </span>

        </div>

        <?php echo $__env->make('backend.contents.media.for_create', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <div class="form-group">

            <?php echo Form::label('is_active', 'Идэвхтэй'); ?>


            <label>
                <input type="checkbox" value="1" <?php echo (Input::get('is_active') == 1) ? 'checked' : ''; ?> name="is_active"
                       class="flat-red">
            </label>

        </div>

    </div>

</div>

<div class="modal-footer">

    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">
        Хаах
    </button>

    <button type="button" class="btn btn-primary" onclick="custom_submit('category')">
        Хадгалах
    </button>

</div>

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