<link rel="stylesheet"
      href="<?php echo base_url(); ?>public/static/backend/css/layouts/view.css?v=<?= rand(10000, 100000) ?>">
<style>
    .form-control {
        height:calc(1.5em + .75rem + 10px);
    }
</style>

<!-- Page Breadcrumb -->
<div class="page-breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="<?= base_url('backend/dashboard'); ?>" style="color: #797979">主頁</a>
        </li>
        <li class="active" style="color: #ef4130">物件（標題）修改</li>
    </ul>
</div>
<!-- /Page Breadcrumb -->
<!-- Page Header -->
<div class="page-header position-relative">
    <div class="header-title">
        <h1>
            物件（標題）修改
        </h1>
    </div>
    <!--Header Buttons-->
    <div class="header-buttons">
        <a class="sidebar-toggler" href="#">
            <i class="glyphicon glyphicon-resize-horizontal"></i>
        </a>
        <a class="refresh" id="refresh-toggler" href="#">
            <i class="glyphicon glyphicon-refresh"></i>
        </a>
        <a class="fullscreen" id="fullscreen-toggler" href="#">
            <i class="glyphicon glyphicon-fullscreen"></i>
        </a>
    </div>
    <!--Header Buttons End-->
</div>
<!-- /Page Header -->
<!-- Page Body -->
<div class="page-body">
    <div class="container-fluid py-2" style="min-height:80vh;">
        <!-- <h2 style="color:#7d4495;">正在架設中...敬請期待!</h2> -->

        <!-- dashboard -->
        <div class="row">
            <!-- column -->

            <div class="col">
                <!-- body table -->
                <div class="box-typical box-typical-padding">
                    <h5 class="with-border">Information</h5>
                    <form class="form-horizontal" method="post" action="<?= base_url() ?>backend/pageobjects/edit"
                          enctype="multipart/form-data">
                        <input type="hidden" name="<?= $csrf['name']; ?>" value="<?= $csrf['hash']; ?>"/>
                        <div class="form-group row">
                            <label class="col-sm-2 control-label">標題種類</label>
                            <div class="col-sm-10">
                                <select name="title_type" class="form-control">
                                    <?php
                                        $obj = $objects['objects'][0];
                                        $type = $obj['title_type'];
                                        $selected = ($type == 'M') ? ' selected="selected"' : '';
                                    ?>
                                    <option value="M"<?=$selected;?>>主標題</option>
                                    <?php
                                    $selected = ($type == 'S') ? ' selected="selected"' : '';
                                    ?>
                                    <option value="S"<?=$selected;?>>次標題</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 control-label">標題</label>
                            <div class="col-sm-10">
                             <!--   <input type="text" name="title" class="form-control" required value="<?=$obj['title'];?>"> -->
                             <textarea name="title" row="1" id="title" class="form-control"><?=$obj['title'];?></textarea>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 control-label">簡介</label>
                            <div class="col-sm-10">
                                <textarea name="summary" id="summary" rows="10" cols="80" class="form-control"><?=$obj['summary'];?></textarea>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col-sm-2"></div>
                            <div class="col-sm-10">
                                <input name="save" type="submit" class="btn btn-success" value="儲存">
                                <input type="submit" class="btn btn-danger" value="重設">
                                <input type="hidden" name="id" value="<?=$objects['object_id'];?>" />
                                <input type="hidden" name="main_id" value="<?=$objects['main_id'];?>" />
                                <input type="hidden" name="submenu_id" value="<?=$objects['submenu_id'];?>" />
                                <input type="hidden" name="page_object_type" value="<?=$objects['page_object_type'];?>" />
                            </div>
                        </div>
                    </form>
                <!-- end body table -->
            </div>
        </div>
        <!-- end dashboard -->
    </div>
</div>

<!-- /Page Body -->
<script defer="" src="<?php echo base_url(); ?>public/static/backend/js/ckeditor/ckeditor.js"></script>
<script defer="" src="<?php echo base_url(); ?>public/static/backend/js/custom/pageobject_title_edit.js"></script>
