<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>
    .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('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">
                <!-- end dashboard -->

                <!-- body table -->
                <p>主目錄:
                    <select id="select_section" style="width:180px">

                        <?php
                        foreach ($landingmainmenu as $landingmainrow) {
                            ?>
                            <option value="<?php echo $landingmainrow->id; ?>" <?php if ($web == $landingmainrow->id) {
                                echo 'selected';
                            } ?>><?php echo $landingmainrow->title; ?></option>

                            <?php

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

                        ?>

                    </select></p>
                <!-- add button -->
                <div style="" class="menubar2  p-2">
                    <a href="/backend/landingsubmenu/edit" 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>Landing Page 次目錄</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="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 ($landingsubmenu 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="200"><?php echo $contentrow->title_en; ?></td>
                                        <td width="200"><?php echo $contentrow->uri; ?></td>
                                        <td width="180"><?php echo $contentrow->updated; ?></td>

                                        <td width="50" align="center"><a
                                                    href="<?php echo base_url(); ?>backend/landingsubmenu/edit?id=<?php echo $contentrow->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>

<!-- pop up add modal  -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered  " role="document" style="max-width: 600px;">
        <div class="modal-content px-3">
            <div class="modal-body ">
                <h5 style="color:#7d4495" class="text-center py-2"><i class="fas fa-plus mr-2"
                                                                      style="color:#7d4495"></i>新增用戶</h5>
                <form>

                    <div class="form-group row">
                        <label for="inputadminname" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">管理員名稱</span></label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="inputadminname" placeholder="請填寫管理員名稱">

                            <div class="valid-feedback">正確</div>
                            <div class="invalid-feedback">没有资料</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputloginname" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">登入名稱</span></label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="inputloginname" placeholder="請填寫登入名稱">
                            <div class="valid-feedback">正確</div>
                            <div class="invalid-feedback">没有资料</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputPassword" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">登入密碼</span></label>
                        <div class="col-sm-9">
                            <!-- <input type="password" class="form-control" id="inputPassword" placeholder="請填寫登入密碼">
                            <div class="input-group">
                            <input type="password" class="form-control pwd" value="iamapassword">
                            <span class="input-group-btn">
                                <button class="btn btn-default reveal" type="button"><i class="glyphicon glyphicon-eye-open"></i></button>
                            </span>
                            </div>   -->
                            <!-- password field -->
                            <div class="input-group ">
                                <input type="password" class="form-control" id="inputPassword" placeholder="請填寫登入密碼">
                                <div class="input-group-append form-password-icon">
                                    <span class="input-group-text "><i class="fas fa-eye-slash"></i></span>
                                    <div class="valid-feedback">正確</div>
                                    <div class="invalid-feedback">没有资料</div>
                                </div>
                            </div>
                            <!-- end password field -->
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputRePassword" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">重新輸入密碼</span></label>
                        <div class="col-sm-9">
                            <!-- <input type="password" class="form-control" id="inputRePassword" placeholder="請重新輸入密碼"> -->
                            <!-- password field -->
                            <div class="input-group ">
                                <input type="password" class="form-control" id="inputRePassword" placeholder="請重新輸入密碼">
                                <div class="input-group-append form-password-icon">
                                    <span class="input-group-text "><i class="fas fa-eye-slash"></i></span>
                                    <div class="valid-feedback">正確</div>
                                    <div class="invalid-feedback">没有资料或密碼和登入密碼不同</div>
                                </div>
                            </div>
                            <!-- end password field -->
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-sm-12">
                            <p style="font-size: 12px;"><span
                                        style="color:#616161">*為必填項目<br>登入名稱為英文字或數字組成(不分大小寫)</span></p>
                            <span id="newmsg" class="text-center"></span>
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-sm-12 text-center">
                            <button type="button" class="btn  px-5  custombutton" id="btnSubmit">確定</button>
                        </div>
                    </div>

                </form>
            </div>
            <!-- <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div> -->
        </div>
    </div>
</div>
<!-- end pop up add modal -->

<!-- edit modal -->
<script>

</script>

<div class="modal fade" id="editModalCenter" tabindex="-1" role="dialog" aria-labelledby="editModalCenterTitle"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered  " role="document" style="max-width: 600px;">
        <div class="modal-content px-3">
            <!-- <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
                </button>
            </div> -->
            <div class="modal-body ">
                <h5 style="color:#7d4495" class="text-center py-2"><i class="fas fa-plus mr-2"
                                                                      style="color:#7d4495"></i>更改用戶</h5>
                <form>

                    <div class="form-group row">
                        <label for="inputadminname" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">管理員名稱</span></label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="inputadminnameedit" placeholder="請填寫管理員名稱">

                            <div class="valid-feedback">正確</div>
                            <div class="invalid-feedback">没有资料</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputloginname" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">登入名稱</span></label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="inputloginnameedit" placeholder="請填寫登入名稱">
                            <div class="valid-feedback">正確</div>
                            <div class="invalid-feedback">没有资料</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputPassword" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">登入密碼</span></label>
                        <div class="col-sm-9">
                            <!-- <input type="password" class="form-control" id="inputPassword" placeholder="請填寫登入密碼">
                            <div class="input-group">
                            <input type="password" class="form-control pwd" value="iamapassword">
                            <span class="input-group-btn">
                                <button class="btn btn-default reveal" type="button"><i class="glyphicon glyphicon-eye-open"></i></button>
                            </span>
                            </div>   -->
                            <!-- password field -->
                            <div class="input-group ">
                                <input type="password" class="form-control" id="inputPasswordedit"
                                       placeholder="請填寫登入密碼">
                                <div class="input-group-append form-password-icon">
                                    <span class="input-group-text "><i class="fas fa-eye-slash"></i></span>
                                    <div class="valid-feedback">正確</div>
                                    <div class="invalid-feedback">没有资料</div>
                                </div>
                            </div>
                            <!-- end password field -->
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputRePassword" class="col-sm-3 col-form-label"><span
                                    style="color:#7d4495;">重新輸入密碼</span></label>
                        <div class="col-sm-9">
                            <!-- <input type="password" class="form-control" id="inputRePassword" placeholder="請重新輸入密碼"> -->
                            <!-- password field -->
                            <div class="input-group ">
                                <input type="password" class="form-control" id="inputRePasswordedit"
                                       placeholder="請重新輸入密碼">
                                <div class="input-group-append form-password-icon">
                                    <span class="input-group-text "><i class="fas fa-eye-slash"></i></span>
                                    <div class="valid-feedback">正確</div>
                                    <div class="invalid-feedback">没有资料或密碼和登入密碼不同</div>
                                </div>
                            </div>
                            <!-- end password field -->
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-sm-12">
                            <p style="font-size: 12px;"><span
                                        style="color:#616161">*為必填項目<br>登入名稱為英文字或數字組成(不分大小寫)</span></p>
                            <span id="editmsg" class="text-center"></span>
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-sm-12 text-center">
                            <button type="button" class="btn  px-5  custombutton" id="btneditSubmit">確定</button>
                        </div>
                    </div>
                    <input type="hidden" class="form-control" id="inputadminid" placeholder="">
                </form>
            </div>
            <!-- <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div> -->
        </div>
    </div>
</div>
<!-- end edit modal -->

<!-- delete modal -->
<script>

</script>

<div class="modal fade" id="deleteModalCenter" tabindex="-1" role="dialog" aria-labelledby="deleteModalCenterTitle"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered  " role="document" style="max-width: 600px;">
        <div class="modal-content px-3">
            <!-- <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
                </button>
            </div> -->
            <div class="modal-body ">
                <h5 style="color:#7d4495" class="text-center py-2"><i class="fas fa-plus mr-2"
                                                                      style="color:#7d4495"></i>删除用戶</h5>
                <form>


                    <div class="form-group row">
                        <label for="inputRePassword" class="col-sm-12 "><span style="color:#7d4495;">確定删除</span><span
                                    id="deletenum" style="color:#7d4495;"></span><span
                                    style="color:#7d4495;">個用戶?</span></label>

                        <span id="deletemsg" class="text-center"></span>
                    </div>
                    <!-- <div class="form-group row">
                        <div class="col-sm-12">
                        <p style="font-size: 12px;"><span style="color:#616161">*為必填項目<br>登入名稱為英文字或數字組成(不分大小寫)</span></p>
                        <span id="editmsg" class="text-center"></span>
                         </div>
                    </div> -->
                    <div class="form-group row">
                        <div class="col-sm-12 text-center">
                            <button type="button" class="btn  px-5  custombutton" id="btndeleteSubmit">確定</button>
                        </div>
                    </div>
                    <input type="hidden" class="form-control" id="inputadminid" placeholder="">
                </form>
            </div>
            <!-- <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div> -->
        </div>
    </div>
</div>
<!-- end delete modal -->

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