<?php require_once ('model.php'); ?>
<form action="<?=ADMIN_URL?>/store" class="needs-validation" novalidate method="POST">
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']['value']; ?>">
<input type="hidden" name="model" value="<?=$model?>">
<div class="row">
    <div class="col-xxl-10">
        <div class="card">
            <div class="card-header align-items-center d-flex">
                <h4 class="card-title mb-0 flex-grow-1 text-muted"><?=lang('form_detail')?></h4>
            </div><!-- end card header -->
            <div class="card-body">
                <div class="live-preview">
                    <div class="row">


                        <div class="col-md-12">
                            <div class="mb-3 input-group-v ">
                                <label for="title" class="form-label"><?=lang('form_input_title')?></label>
                                <input type="text" name="title"  class="form-control input-group-flat" id="title"  value="<?php echo htmlspecialchars(m_get_session('title')); ?>"  placeholder="<?=lang('form_input_title_placeholder')?>" required>
                                <div class="invalid-feedback">
                                    <?=lang('form_vali_title')?>
                                </div>
                            </div>
                        </div>

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

    </div> <!-- end col -->

    <div class="col-xxl-2">
        <div class="card card-body">
            <h4 class="card-title  flex-grow-1 text-muted"><?=lang('published')?></h4>
            <hr>
            <div class="saved">
                <button class="btn btn-primary" type="submit" value="save_and_edit" name="save_and_edit">
                <span class="icon-tabler-wrapper icon-left">
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-device-floppy" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
                      <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                      <path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"></path>
                      <path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
                      <path d="M14 4l0 4l-6 0l0 -4"></path>
                    </svg>
                </span>
                    <?=lang('save_and_edit')?>
                </button>
                <button class="btn btn-light" type="submit" name="save" value="save">
                <span class="icon-tabler-wrapper icon-left">
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-transfer-in" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
                      <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                      <path d="M4 18v3h16v-14l-8 -4l-8 4v3"></path>
                      <path d="M4 14h9"></path>
                      <path d="M10 11l3 3l-3 3"></path>
                    </svg>
                </span>
                    <?=lang('save')?>
                </button>
            </div>
        </div>
        <div class="card card-body">
            <h4 class="card-title  flex-grow-1 text-muted"><?=lang('status')?></h4>
            <hr>
            <select class="form-select mb-3" name="status">
                <option selected="selected" value="1"><?=lang('status_option_published')?> </option>
                <option value="2"><?=lang('status_option_draft')?> </option>
                <option value="0"><?=lang('status_option_unpublished')?> </option>
            </select>
        </div>
    </div> <!-- end col -->
</div>


</form>