@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = "_LooperLayout";
}

@section Style {
    <link rel="stylesheet" href="~/assets/vendor/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css">
}
@section Script {
    <script src="~/assets/vendor/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="~/assets/vendor/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="~/assets/vendor/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
    <script src="~/assets/javascript/pages/dataTables.bootstrap.js"></script>
    <script src="~/assets/javascript/custom/ratelist.js" asp-append-version="true"></script>
}

<div class="page-inner">
    <!-- .page-title-bar -->
    <header class="page-title-bar">
        <!-- .breadcrumb -->
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item active">
                    <a href="#"><i class="breadcrumb-icon fa fa-angle-left mr-2"></i>主項目清單</a>
                </li>
            </ol>
        </nav><!-- /.breadcrumb -->
        <!-- title -->
        <h1 class="page-title"> 主項目清單 </h1>
        <p class="text-muted">  </p><!-- /title -->
    </header><!-- /.page-title-bar -->
    <!-- .page-section -->
    <div class="page-section">
        <button type="button" id="maintItemNewModal" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
        <!-- .card -->
        <div class="card card-fluid">
            <!-- .card-body -->
            <div class="card-body">
                <div class="form-row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="dept_select">單位</label>
                            <select class="custom-select custom-select-sm" id="dept_select" name="dept_select" required="">
                            </select>
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="form-group">
                            <label for="search_btn" style="display: block;">&nbsp; &nbsp;</label>
                            <button type="button" class="btn btn-info btn-sm" id="search_btn">切換單位</button>
                        </div>
                    </div>
                </div>

            </div><!-- /.card-body -->
        </div><!-- /.card -->
        <!-- .card -->
        <div class="card card-fluid">
            <!-- .card-body -->
            <div class="card-body">
                <!-- .table -->
                <table id="dt-responsive" class="table dt-responsive nowrap w-100">
                    <thead>
                        <tr>
                            <th style="width: 75%;"> 主項目名稱 </th>                        
                        
                            <th> 功能 </th>
                        </tr>
                    </thead>
                   
                </table><!-- /.table -->
            </div><!-- /.card-body -->
        </div><!-- /.card -->
    </div><!-- /.page-section -->
</div>


<!-- .modal -->
<form id="clientItemEditForm" name="clientItemEditForm">
    <div class="modal fade" id="mainItemModal" tabindex="-1" role="dialog" aria-labelledby="mainItemModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="mainItemModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">主項目內容</span> <input id="group_content" type="text" class="form-control form-control-lg" value="" placeholder="主項目內容" readonly="readonly " required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="mainItem_method" />
                    <input type="hidden" id="mainItem_uid" />
                    <input type="hidden" id="dept_uid" />
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modal_mainItem_name" class="form-control" value="" placeholder="主項目名稱" maxlength="36" required=""> <label for="modal_mainItem_name">主項目名稱</label>
                        </div>
                    </div><!-- /.form-group -->

                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="mainItemDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->


<!-- .modal -->
<form id="clientSubItemListForm" name="clientSubItemListForm">
    <div class="modal fade" id="clientSubItemListModal" tabindex="-1" role="dialog" aria-labelledby="clientSubItemListModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientNewModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">子項目列表</span> <input id="mainItemTitle" type="text" class="form-control form-control-lg" placeholder="子項目列表" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="subItemList_method" />
                    <input type="hidden" id="subItemList_mainItem_uid" />
                    <!-- .page-section -->
                    <div class="page-section">
                        <button type="button" id="subItemListNewBtn" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
                        <!-- .card -->
                        <div class="card card-fluid">
                            <!-- .card-body -->
                            <div class="card-body">
                                <!-- .table -->
                                <table id="dt-responsive-subItem" class="table dt-responsive nowrap w-100">
                                    <thead>
                                        <tr>
                                            <th> 子項目名稱 </th>
                                            <th> 單價 </th>
                                            <th> 單位 </th>
                                            <th style="width: 25px;">  </th>
                                        </tr>
                                    </thead>

                                </table><!-- /.table -->
                            </div><!-- /.card-body -->
                        </div><!-- /.card -->
                    </div><!-- /.page-section -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="kolSaveBtn" style="visibility:hidden;" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal" >關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!-- .modal -->
<form id="clientSubItemModalForm" name="clientSubItemModalForm">
    <div class="modal fade" id="clientSubItemModal" tabindex="-1" role="dialog" aria-labelledby="clientSubItemModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientSubItemModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">Client name</span> <input id="clientSubItemModalTitle" type="text" class="form-control form-control-lg" placeholder="子項目資料新增與維護" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="clientSubItem_method" />                    
                    <input type="hidden" id="clientSubItem_subItem_uid" />
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modal_subItem_name" class="form-control" value="" placeholder="次項目名稱" maxlength="36" required=""> <label for="modal_subItem_name">次項目名稱</label>
                        </div>
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <label for="modal_subItem_descript">製作說明 <span class="badge badge-secondary"><em>選填</em></span></label>
                        <textarea class="form-control" id="modal_subItem_descript" rows="5" placeholder="製作說明"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="modal_subItem_price">單價</label> <!-- .input-group -->
                        <div class="input-group">
                            <label class="input-group-prepend" for="modal_subItem_price"><span class="badge">$</span></label> <input type="text" class="form-control" maxlength="8" id="modal_subItem_price">
                        </div><!-- /.input-group -->
                    </div>
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modal_subItem_unitType" class="form-control" value="" placeholder="單位" maxlength="6" required=""> <label for="modal_subItem_unitType">單位</label>
                        </div>
                    </div>
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="clientSubItemSaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->