<link rel="stylesheet"
      href="<?php echo base_url(); ?>assets/at-admin/css/layouts/view.css?v=<?= rand(10000, 100000) ?>">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/at-admin/css/drag_list.css">
<style>
    .customsearch:hover {
        background-color: #e2e6ea;
    }

    .levleonetext {
        text-align: center;
    }

    .tablerowoddbg {
        background-color: #f1ebf5;
    }

    .levleonetext span {
        color: #616161;
    }
</style>

<!-- Page Breadcrumb -->
<div class="page-breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="<?= base_url('at-admin/settings'); ?>" style="color: #797979">主頁</a>
        </li>
		<li>
			<a href="<?= base_url('at-admin/treatment'); ?>" 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">
                <!-- end dashboard -->

                <!-- body table -->
                <p>專業療程項目:
                    <select id="select_section" style="width:180px">

                        <?php
                        foreach ($treatment_main as $treatmentmainrow) {
                            ?>
                            <option value="<?php echo $treatmentmainrow['id']; ?>" <?php if ($main_id == $treatmentmainrow['id']) {
                                echo 'selected';
                            } ?>><?php echo $treatmentmainrow['title']; ?></option>

                            <?php

                        }//foreach ($landingmainmenu as $landingmainrow) {

                        ?>

                    </select></p>
                <!-- add button -->
                <div style="" class="menubar2  p-2">
                    <a href="/at-admin/treatment/edit?main_id=<?=$main_id;?>" class="btn btn-success">
                        新增</a>
                </div>

                <!-- end add button -->

                <!-- drag table test -->
                <section class="box-typical">

                    <div class="fixed-table-toolbar">
                        <div class="bars pull-left">
                            <div id="toolbar"><strong>專業療程項目 - 次項目</strong></div>
                        </div>
                        <div class="pull-right search"></div>
                    </div>

                    <div id="info" class="content">(Drag the <span style="color:red">red square</span> to re-arrange the
                        order.)
                    </div>
                    <!-- test drag table -->
                    <table width="100%" border="1" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC" class="content">
                        <tbody>
                        <tr bgcolor="#EEEEEE">
                            <td width="30" align="center"></td>
                            <td width="100">顯示次序</td>
                            <td width="200">主目錄</td>
                            <td width="200">標題</td>
                            <td width="180">更新時間</td>
                            <td width="50"></td>
                            <td width="50"></td>
                        </tr>
                        </tbody>
                    </table>
                    <ul id="content-list" class="ui-sortable">
                        <?php
                        foreach ($treatment_submenu as $contentrow) {

                            ?>
                            <li id="listItem_<?php echo $contentrow['id']; ?>" class="border border-secondary my-2">
                                <table width="100%" border="1" cellpadding="2" cellspacing="1" bgcolor="#cccccc"
                                       class="content" style="background: rgb(255, 182, 182);">
                                    <tbody>
                                    <tr bgcolor="#FFFFFF" id="<?php echo $contentrow['id']; ?>">
                                        <td width="30" align="center">
                                            <div class="handle"></div>
                                        </td>
                                        <td width="100">
                                            <div class="rank_no"><?php echo $contentrow['displayorder']; ?></div>
                                        </td>
                                        <td width="200"><?php echo $contentrow['main_title']; ?></td>
                                        <td width="200"><?php echo $contentrow['title']; ?></td>
                                        <td width="180"><?php echo $contentrow['updated']; ?></td>

                                        <td width="50" align="center"><a
											href="<?php echo base_url(); ?>at-admin/treatment/edit?id=<?php echo $contentrow['id']; ?>&main_id=<?=$main_id;?>"
											class="btn btn-primary">更改</a></td>
                                        <td width="50" align="center">
                                            <button type="submit" class="btn btn-danger remove">删除</button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </li>
                            <?php
                        }//foreach ($test_drag_content as $contentrow) {
                        ?>
                    </ul>
                </section>
            </div>

        </div>
        <!-- end body table -->
    </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(); ?>assets/at-admin/js/jquery-ui-min.js"></script>
<script defer="" src="<?php echo base_url(); ?>assets/at-admin/js/custom/treatment_submenu.js"></script>
