<!DOCTYPE html>
<html lang="fa" dir="rtl">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <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="/adminassets/css/font-awesome.css">
    <!-- ico-font-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/icofont.css">
    <!-- Themify icon-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/themify.css">
    <!-- Flag icon-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/flag-icon.css">
    <!-- Feather icon-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/feather-icon.css">
    <!-- Plugins css start-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/scrollbar.css">
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/prism.css">
    <!-- Plugins css Ends-->
    <!-- Bootstrap css-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/vendors/bootstrap.css">
    <!-- App css-->
    <link rel="stylesheet" type="text/css" href="/adminassets/css/style.css">
    <link id="color" rel="stylesheet" href="/adminassets/css/color-1.css" media="screen">
    <!-- Responsive css-->
    <link rel="stylesheet" type="text/css" href="/adminassets/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-6">
                  <h3>مدیریت تیکت

                    </h3>
                </div>
                <div class="col-6">
                  <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index.html"><i data-feather="home"></i></a></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="/ticket/admin/edit/<%= ticket._id %>" method="post">

                         <div class="col-sm-6">
                           <label class="form-label"> عنوان تیکت </label>
                           <input class="form-control" name="Title" id="Title" type="text" placeholder="عنوان تیکت" maxlength="80" required oninvalid="invalidChecker(this)" oninput="invalidChecker(this)" value="<%= ticket.Title %>">
                         </div>

                         <div class="col-sm-6">
                           <label class="form-label">موبایل کاربر </label>
                           <input autocomplete="off" class="form-control" list="users" name="Mobile" id="Mobile" value="<%= ticket.User.Mobile %>"><%= ticket.User.Name %> <%= ticket.User.LastName %>
                           <datalist id="users">
                             <% for(var i=0; i < users.length; i++) { %>
                               <option value="<%= users[i].Mobile %>"></option>
                             <% } %>
                           </datalist>
                         </div>

                        <div class="col-sm-6">
                           <label class="form-label"> نوع تیکت</label>
                           <select  name="TicketType" id="TicketType" class="form-select form-control-lg">
                             <option value="<%= ticket.TicketType._id %>" ><%= ticket.TicketType.Name %></option>
                           </select>
                       </div>

                       <div class="col-sm-6">
                          <label class="form-label">  اولویت</label>
                          <select  name="Olaviat" id="Olaviat" class="form-select form-control-lg">

                            <% if(ticket.Olaviat == "1") { %>
                              <option value="3"> زیاد</option>
                              <option value="2">متوسط </option>
                              <option value="1" selected>کم </option>
                            <% } else if(ticket.Olaviat == "2") { %>
                              <option value="3"> زیاد</option>
                              <option value="2" selected>متوسط </option>
                              <option value="1">کم </option>
                            <% } else { %>
                              <option value="3" selected> زیاد</option>
                              <option value="2">متوسط </option>
                              <option value="1">کم </option>
                            <% } %>
                          </select>
                      </div>
                       <div class="mb-3">
                          <label class="form-label" for="SmallCaption"> پیام ارسالی</label>
                          <textarea class="form-control" id="Caption" name="Caption" placeholder="پیام این تیکت را وارد کنید" required maxlength="200"><%= ticket.Caption %></textarea>
                        </div>



                   <div class="card-footer text-end">
                        <button class="btn btn-primary" type="submit">ثبت</button>
                        <a href="https://amarify.com/ticket/admin/list" class="btn btn-secondary">بازگشت</a>
                        <a href="https://amarify.com/tickettype/admin/list" class="btn btn-success">مشاهده دسته بندی تیکت</a>
                      </div>
                        </form>
                      </div>

                    </div>
                  </div>
                </div>
              </div>
          </div>

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

          <!-- Container-fluid Ends-->
        </div>
        <!-- footer start-->
        <%- include("../../partials/footer") %>
      </div>
    </div>
    <!-- latest jquery-->
    <script src="/adminassets/js/jquery-3.5.1.min.js"></script>
    <!-- Bootstrap js-->
    <script src="/adminassets/js/bootstrap/bootstrap.bundle.min.js"></script>
    <!-- feather icon js-->
    <script src="/adminassets/js/icons/feather-icon/feather.min.js"></script>
    <script src="/adminassets/js/icons/feather-icon/feather-icon.js"></script>
    <!-- scrollbar js-->
    <script src="/adminassets/js/scrollbar/simplebar.js"></script>
    <script src="/adminassets/js/scrollbar/custom.js"></script>
    <!-- Sidebar jquery-->
    <script src="/adminassets/js/config.js"></script>
    <!-- Plugins JS start-->
    <script src="/adminassets/js/sidebar-menu.js"></script>
    <script src="/adminassets/js/prism/prism.min.js"></script>
    <script src="/adminassets/js/clipboard/clipboard.min.js"></script>
    <script src="/adminassets/js/custom-card/custom-card.js"></script>
    <script src="/adminassets/js/tooltip-init.js"></script>
    <!-- Plugins JS Ends-->
    <!-- Theme js-->
    <script src="/adminassets/js/script.js"></script>
    <script src="/adminassets/js/tiny/tinymce.min.js"></script>
    <!-- login js-->
    <!-- Plugin used-->

    <script>

        $(document).ready(function(){
    $("#addTags").click(function(){

//        $("#propertyField").clone().appendTo("#rowProperties");
         $("#rowTags").append("<div class='col-sm-6'><a class='removeTag'><i class='fa fa-trash-o'></i></a><input class='form-control' name='Tags' id='Tags' type='text' placeholder='متن تگ را وارد کنید '></div>");
    });
//$(".removeproperty").click(function(e) {
//    alert('salam')
////    e.preventDefault();
//    $(this).parent().parent().remove();
//});

            $("#rowTags").on("click",  "div a.removeTag", function(){

                $(this).parent().remove();
                });
});
</script>
<script>
    tinymce.init({ selector: '#editor',
      plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount',
      toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table | align lineheight | numlist bullist indent outdent | emoticons charmap | removeformat',
    });
  </script>
  </body>
</html>
