<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description"
          content="Cuba admin is super flexible, powerful, clean &amp; modern responsive bootstrap 5 admin template with unlimited possibilities.">
    <meta name="keywords"
          content="admin template, Cuba admin template, dashboard template, flat admin template, responsive admin template, web app">
    <meta name="author" content="pixelstrap">
    <link rel="icon" href="/RTL/superAdmin/images/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="/RTL/superAdmin/images/favicon.png" type="image/x-icon">
    <title>آنسه تیم</title>
    <!-- Google font-->
    <link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i&amp;display=swap"
          rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900&amp;display=swap"
          rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/font-awesome.css">
    <!-- ico-font-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/icofont.css">
    <!-- Themify icon-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/themify.css">
    <!-- Flag icon-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/flag-icon.css">
    <!-- Feather icon-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/feather-icon.css">
    <!-- Plugins css start-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/scrollbar.css">
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/prism.css">
    <!-- Plugins css Ends-->
    <!-- Bootstrap css-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/bootstrap.css">
    <!-- App css-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/style.css">
    <link id="color" rel="stylesheet" href="/RTL/superAdmin/css/color-1.css" media="screen">
    <!-- Responsive css-->
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/responsive.css">
</head>
<body class="rtl">
<!-- tap on top starts-->
<div class="tap-top"><i data-feather="chevrons-up"></i></div>
<!-- tap on tap ends-->
<!-- page-wrapper Start-->
<div class="page-wrapper compact-wrapper" id="pageWrapper">
    <!-- Page Header Start-->

    <%- include('../../../partials/header') %>

    <!-- Page Sidebar Ends-->
    <div class="page-body">
        <div class="container-fluid">
            <div class="page-title">
                <div class="row">

                    <div class="col-12">
                        <ol class="breadcrumb" style="-webkit-box-pack: start!important;">
                            <li class="breadcrumb-item"><a href="/<%= lan.ShortName %>/dashboard"><i
                                            data-feather="home"></i></a></li>
                            <li class="breadcrumb-item">کالا ها</li>
                            <li class="breadcrumb-item">دیدگاه ها</li>
                            <li class="breadcrumb-item active">لیست دیدگاه ها</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- Container-fluid starts-->
        <!-- Container-fluid starts-->
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-12 col-xl-12">
                    <div class="row">
                        <div class="col-sm-10" style="margin:0 auto">
                            <div class="card">
                                <div class="card-header">
                                    <h5>ثبت دیدگاه ها در سامانه آنسه تیم</h5>
                                </div>
                                <div class="card-body">
                                    <form class="form-space theme-form row"
                                          action="/<%= lan.ShortName %>/viewpoint/add/<%= modelType %>/<%= model._id %>" method="post">

                                        <div class="col-sm-6">
                                            <label class="form-label">عنوان</label>
                                            <input class="form-control" name="Title" id="Title" type="text"
                                                   placeholder="عنوان" required>
                                        </div>

                                        <div class="col-sm-6">
                                            <div class="col-form-label">نام ارسال کننده</div>
                                            <select name="User" id="User" class="js-example-rtl col-sm-12"
                                                    required>
                                                <% for (var i = 0; i < users.length; i++) { %>
                                                    <option value="<%= users[i]._id %>"><%= users[i].UserDocument.Name %> <%= users[i].UserDocument.LastName %></option>
                                                <% } %>
                                            </select>
                                        </div>

                                        <div class="col-sm-6">
                                            <label class="form-label">امتیاز</label>
                                            <input class="form-range" dir="ltr" name="Rate" id="Rate" type="range"
                                                   placeholder="امتیاز" required min="1" max="5" value="5">
                                            <p>امتیاز: <span id="rangeValue">5</span></p>
                                        </div>

                                        <div class="col-sm-12">
                                            <button id="addStrengths" class="btn btn-outline-primary" type="button">جهت
                                                افزودن نقاط مثبت کلیک کنید
                                            </button>
                                        </div>

                                        <!-- Tags -->
                                        <div class="row rowStrengths" id="rowStrengths">
                                        </div>

                                        <div class="col-sm-12">
                                            <button id="addWeakPoints" class="btn btn-outline-primary" type="button">جهت
                                                افزودن نقاط منفی کلیک کنید
                                            </button>
                                        </div>

                                        <!-- Tags -->
                                        <div class="row rowWeakPoints" id="rowWeakPoints">
                                        </div>

                                        <div class="col-sm-12">
                                            <label class="form-label">متن دیدگاه</label>
                                            <textarea class="form-control" name="Caption" id="Caption" type="text"
                                                      placeholder="متن دیدگاه" required></textarea>
                                        </div>

                                        <div class="card-footer text-end">
                                            <button class="btn btn-primary" type="submit">ثبت دیدگاه </button>
                                            <% if(model.Vendor){ %>
                                                <a href="/<%= lan.ShortName %>/<%= modelType %>/list/<%= model.Vendor %>/<%= model._id %>" class="btn btn-secondary">بازگشت</a>
                                                <a href="/<%= lan.ShortName %>/product/list" class="btn btn-success">مشاهده کالاها</a>
                                            <% } else { %>
                                                <a href="/<%= lan.ShortName %>/<%= modelType %>/list/<%= model.Team %>/<%= model._id %>" class="btn btn-secondary">بازگشت</a>
                                                <a href="/<%= lan.ShortName %>/service/list" class="btn btn-success">مشاهده خدمات</a>
                                            <% } %>
                                        </div>
                                    </form>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="card">
                        <div class="card-header">
                            <h5>مشاهده لیست دیدگاه ها </h5>
                        </div>
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <tr class="border-bottom-primary" style="text-align:center">
                                    <th scope="col">#</th>
                                    <th scope="col">عنوان</th>
                                    <th scope="col">ارسال کننده</th>
                                    <th scope="col">متن دیدگاه</th>
                                    <th scope="col">نمایش</th>
                                    <th scope="col">ویرایش</th>
                                    <th scope="col">حذف</th>
                                </tr>
                                </thead>
                                <tbody>

                                <% for (var i = 0; i < viewpoints.length; i++) { %>
                                    <tr class="border-bottom-info" style="text-align:center">
                                        <th scope="row"><%= i + 1 %></th>
                                        <td><%= viewpoints[i].Title %></td>
                                        <td><%= viewpoints[i].Forwarder.Name %> <%= viewpoints[i].Forwarder.LastName %></td>
                                        <td><%= viewpoints[i].Caption %></td>
                                        <% if(viewpoints[i].Show == true) { %>
                                            <td><a href="/<%= lan.ShortName %>/viewpoint/show/<%= viewpoints[i]._id %>" class="btn btn-square btn-info-gradien"><i class="fa fa-check"></i></a></td>
                                        <% } else { %>
                                            <td><a href="/<%= lan.ShortName %>/viewpoint/show/<%= viewpoints[i]._id %>" class="btn btn-square btn-warning-gradien"><i class="fa fa-xmark"></i></a></td>
                                        <% } %>
                                        <td><a href="/<%= lan.ShortName %>/viewpoint/edit/<%= modelType %>/<%= model._id %>/<%= viewpoints[i]._id %>"
                                               class="btn btn-square btn-primary-gradien"><i class="fa fa-edit"></i></a>
                                        </td>
                                        <td><a href="/<%= lan.ShortName %>/viewpoint/remove/<%= viewpoints[i]._id %>"
                                               class="btn btn-square btn-danger-gradien"><i class="fa fa-trash-o"></i></a>
                                        </td>
                                    </tr>
                                <% } %>

                                </tbody>
                            </table>
                            <nav aria-label="...">
                                <ul class="pagination pagination-primary m-3">
                                    <li class="page-item"><a class="page-link" href="javascript:void(0)">بعدی</a></li>
                                    <li class="page-item"><a class="page-link" href="javascript:void(0)">3</a></li>
                                    <li class="page-item "><a class="page-link" href="javascript:void(0)">2 <span
                                                    class="sr-only">(current)</span></a></li>
                                    <li class="page-item active"><a class="page-link" href="javascript:void(0)">1</a>
                                    </li>
                                    <li class="page-item disabled"><a class="page-link" href="javascript:void(0)"
                                                                      tabindex="-1">قبلی</a></li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>

            </div>

        </div>
        <!-- Container-fluid Ends-->

        <!-- Container-fluid Ends-->
    </div>
    <!-- popup -->
    <div class="modal fade modal-bookmark" id="printModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">انتخاب عکس</h5>
                    <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>

                <div class="modal-body list-persons" id="showAlbums">
                    <div class="container-fluid">
                        <div class="row flex-direction-row-reverse return">
                            <div class="return-btn" onclick="makePopup('all')"><img class="w-100" src="/superAdmin/img/albumPopup/undo.png"></div>
                        </div>
                        <div class="row showAlbums">

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- popup-->
    <!-- footer start-->
    <%- include("../../../partials/footer") %>

</div>

<!-- latest jquery-->
<script src="/RTL/superAdmin/js/jquery-3.5.1.min.js"></script>
<!-- Bootstrap js-->
<script src="/RTL/superAdmin/js/bootstrap/bootstrap.bundle.min.js"></script>
<!-- feather icon js-->
<script src="/RTL/superAdmin/js/icons/feather-icon/feather.min.js"></script>
<script src="/RTL/superAdmin/js/icons/feather-icon/feather-icon.js"></script>
<!-- scrollbar js-->
<script src="/RTL/superAdmin/js/scrollbar/simplebar.js"></script>
<script src="/RTL/superAdmin/js/scrollbar/custom.js"></script>
<!-- Sidebar jquery-->
<script src="/RTL/superAdmin/js/config.js"></script>
<!-- Plugins JS start-->
<script src="/RTL/superAdmin/js/sidebar-menu.js"></script>
<script src="/RTL/superAdmin/js/prism/prism.min.js"></script>
<script src="/RTL/superAdmin/js/clipboard/clipboard.min.js"></script>
<script src="/RTL/superAdmin/js/custom-card/custom-card.js"></script>
<script src="/RTL/superAdmin/js/tooltip-init.js"></script>
<!-- Plugins JS Ends-->
<!-- Theme js-->
<script src="/RTL/superAdmin/js/script.js"></script>
<!-- login js-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js"></script>
<!-- Plugin used-->
<script src="/RTL/superAdmin/js/anse/albumPopup.js"></script>

<script>
    $(document).ready(function () {
        $('#addStrengths').click(function () {
            $('#rowStrengths').append(
                "<div class='col-sm-6'><a class='removeStrength'><i class='fa fa-trash-o'></i></a><input class='form-control' name='Strengths' id='Strengths' type='text' placeholder='نقاط مثبت را وارد کنید '></div>"
            );
        });
        $('#rowStrengths').on('click', 'div a.removeStrength', function () {
            $(this).parent().remove();
        });

        $('#addWeakPoints').click(function () {
            $('#rowWeakPoints').append(
                "<div class='col-sm-6'><a class='removeWeakPoint'><i class='fa fa-trash-o'></i></a><input class='form-control' name='WeakPoints' id='WeakPoints' type='text' placeholder='نقاط منفی را وارد کنید '></div>"
            );
        });
        $('#rowWeakPoints').on('click', 'div a.removeWeakPoint', function () {
            $(this).parent().remove();
        });
    });
</script>

<script>
    window.onload = function (){
        var rangeValue = $('#Rate').val()
        $("#rangeValue").text(rangeValue)
    }
    $('#Rate').change(function () {
        var rangeValue = $(this).val()
        $("#rangeValue").text(rangeValue)
    })
</script>

</body>
</html>
