<link rel="stylesheet" href="<?php echo base_url(); ?>public/static/backend/css/layouts/view.css?v=<?= rand(10000, 100000) ?>">
<link rel="stylesheet" href="<?php echo base_url(); ?>public/static/backend/css/drag_list.css">
<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">纖體APP介紹及下載管理</li>
    </ul>
</div>
<!-- /Page Breadcrumb -->
<!-- Page Header -->
<div class="page-header position-relative">
    <div class="header-title">
        <h1>
        纖體APP介紹及下載管理
        </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">
                    <form class="form-horizontal" method="post" action="<?= base_url() ?>backend/app_recommand_setting/edit_link" enctype="multipart/form-data">
                        <h5 class="with-border">標題</h5>

                        <textarea id="summary" name="title" value=''><?= $link[0]['title'] ?></textarea>
                </div>
            </div>
        </div>
        <div class="row">



        </div>
        <div class="row pt-5">
            <div class="col">
                <h3 class="with-border">上載圖片</h3>

                <input type="hidden" name="<?= $csrf['name']; ?>" value="<?= $csrf['hash']; ?>" />
                <div class="form-group">
                    
                    <input type="file" id="picture" name="picture" class="form-control" />
                </div>
                <h3 class="with-border">超連結</h3>
                <div class="form-group">
               
                    <input type="text" id="link" name="link" class="form-control" value="<?=$link[0]['link']?>" />
                </div>
                <div class="form-group">
                    <h3 class="with-border">顯示</h3>


                    <select id="display" name="display">
                        <?php if ($link[0]['display'] == 1) { ?>
                            <option value="1" selected>是</option>
                            <option value='0'>否</option>
                        <?php } else { ?>
                            <option value="1">是</option>
                            <option value='0' selected>否</option>
                        <?php } ?>
                    </select>
                </div>
                <div class="form-group">
                    <input name="save" type="submit" class="btn btn-success" value="儲存">
                    <input type="submit" class="btn btn-danger" value="重設">

                    <input type="hidden" name="id" value="<?= $link[0]['id'] ?>" />


                    <!-- <input type="hidden" name="main_id" value=""/>
                        <input type="hidden" name="submenu_id" value=""/>
                        <input type="hidden" name="picture_info_id" value=""/>
                        <input type="hidden" name="page_object_type"
                               value=""/> -->
                </div>
                </form>
            </div>
        </div>
        <!-- end dashboard -->
    </div>
</div>

<!-- /Page Body -->
<script>
    var base_url = '<?= base_url(); ?>';
    var csrf_name = '<?= $csrf['name']; ?>';
    var csrf_hash = '<?= $csrf['hash']; ?>';
</script>

<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/jquery-ui-min.js"></script>
<script defer="" src="<?php echo base_url(); ?>public/static/backend/js/custom/pageobject_picture_edit.js"></script>
<script defer="" src="<?php echo base_url(); ?>public/static/backend/js/custom/pageobject_title_edit.js"></script>