<!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-->

    <script src="https://cdn.ckeditor.com/ckeditor5/35.0.1/classic/ckeditor.js"></script>

    <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">
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/vendors/select2.css">

    <!-- Mapp styles -->
    <link rel="stylesheet" href="https://cdn.map.ir/web-sdk/1.4.2/css/mapp.min.css">
    <link rel="stylesheet" href="https://cdn.map.ir/web-sdk/1.4.2/css/fa/style.css">
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/anse/map/map.css">
    <link rel="stylesheet" type="text/css" href="/RTL/superAdmin/css/anse/map/extras.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">لیست پروژه ها</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 %>/project/edit/<%= project._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" value="<%= project.Title %>" required>
                                        </div>

                                        <div class="col-sm-6">
                                            <div class="col-form-label">کاربر</div>
                                            <select name="MontasherKonande" id="MontasherKonande"
                                                    class="js-example-rtl col-sm-12" required>
                                                <% for (var i = 0; i < users.length; i++) { %>
                                                    <% if(project.MontasherKonande.equals(users[i]._id)) { %>
                                                        <option value="<%= users[i]._id %>" selected><%= users[i].Mobile %> <%= users[i].UserDocument.Name %> <%= users[i].UserDocument.LastName %></option>
                                                    <% } else { %>
                                                        <option value="<%= users[i]._id %>"><%= users[i].Mobile %> <%= users[i].UserDocument.Name %> <%= users[i].UserDocument.LastName %></option>
                                                    <% } %>
                                                <% } %>
                                            </select>
                                        </div>

                                        <div class="col-sm-6">
                                            <div class="col-form-label">نوع پروژه</div>
                                            <select name="ProjectType" id="ProjectType" class="form-control" required>
                                                <% for (var i = 0; i < projectTypes.length; i++) { %>
                                                    <% if(project.ProjectType.equals(projectTypes[i]._id)) { %>
                                                        <option value="<%= projectTypes[i]._id %>" selected><%= projectTypes[i].ProjectTypeDocument.Name %></option>
                                                    <% } else { %>
                                                        <option value="<%= projectTypes[i]._id %>"><%= projectTypes[i].ProjectTypeDocument.Name %></option>
                                                    <% } %>
                                                <% } %>
                                            </select>
                                        </div>

                                        <div class="col-sm-6">
                                            <div class="col-form-label">خدمات</div>
                                            <select name="Services" id="Services" class="js-example-rtl col-sm-12"
                                                    multiple="multiple" required>
                                                <% for (var i = 0; i < services.length; i++) { %>
                                                    <% if(project.Services.includes(services[i]._id)) { %>
                                                        <option value="<%= services[i]._id %>" selected><%= services[i].Code %> <%= services[i].ServiceDocument.Title %></option>
                                                    <% } else { %>
                                                        <option value="<%= services[i]._id %>"><%= services[i].Code %> <%= services[i].ServiceDocument.Title %></option>
                                                    <% } %>
                                                <% } %>
                                            </select>
                                        </div>

                                        <div class="col-sm-6">
                                            <div class="col-form-label">مهارت ها</div>
                                            <select name="Skills" id="Skills" class="js-example-rtl col-sm-12"
                                                    multiple="multiple" required>
                                                <% for (var i = 0; i < skills.length; i++) { %>
                                                    <% if(project.Skills.includes(skills[i]._id)) { %>
                                                        <option value="<%= skills[i]._id %>" selected><%= skills[i].SkillDocument.Title %></option>
                                                    <% } else { %>
                                                        <option value="<%= skills[i]._id %>"><%= skills[i].SkillDocument.Title %></option>
                                                    <% } %>
                                                <% } %>
                                            </select>
                                        </div>

                                        <fieldset class="row">
                                            <legend>پیشنهاد کاربر</legend>

                                            <div class="col-sm-6">
                                                <label class="form-label" for="">قیمت</label>
                                                <input type="number" class="form-control" id="OrderPrice" name="OrderPrice"
                                                       placeholder="قیمت" value="<%= project.Order.Price %>">
                                            </div>

                                            <div class="col-sm-6">
                                                <div class="col-form-label">ارز</div>
                                                <select name="OrderCurrency" id="OrderCurrency" class="form-control" required>
                                                    <% for (var i = 0; i < currencys.length; i++) { %>
                                                        <% if(project.Order.Currency.equals(currencys[i]._id)) { %>
                                                            <option value="<%= currencys[i]._id %>" selected><%= currencys[i].Name %></option>
                                                        <% } else { %>
                                                            <option value="<%= currencys[i]._id %>"><%= currencys[i].Name %></option>
                                                        <% } %>
                                                    <% } %>
                                                </select>
                                            </div>

                                            <div class="col-sm-6">
                                                <label class="form-label" for="">زمان پیشنهادی</label>
                                                <input type="number" class="form-control" id="OrderDuration" name="OrderDuration"
                                                       placeholder="زمان پیشنهادی" value="<%= project.Order.Duration %>">
                                            </div>

                                            <div class="col-sm-6">
                                                <div class="col-form-label">زمان</div>
                                                <select name="OrderUnit" id="OrderUnit" class="form-control" required>
                                                    <% for (var i = 0; i < timeUnits.length; i++) { %>
                                                        <% if(project.Order.Unit.equals(timeUnits[i]._id)) { %>
                                                            <option value="<%= timeUnits[i]._id %>" selected><%= timeUnits[i].UnitDocument.Name %> <%= timeUnits[i].Symbol %></option>
                                                        <% } else { %>
                                                            <option value="<%= timeUnits[i]._id %>"><%= timeUnits[i].UnitDocument.Name %> <%= timeUnits[i].Symbol %></option>
                                                        <% } %>
                                                    <% } %>
                                                </select>
                                            </div>

                                        </fieldset>

                                        <div class="col-sm-6">
                                            <label class="form-label">کشور</label>
                                            <select name="Country" id="Country" class="form-select form-control-lg">
                                                <% for(var i = 0; i < countrys.length; i++){ %>
                                                    <% if( countrys[i]._id.equals(project.Country._id) ){ %>
                                                        <option value="<%= countrys[i]._id %>" selected><%= countrys[i].ZoneTypeDocument.Name %></option>
                                                    <% } else { %>
                                                        <option value="<%= countrys[i]._id %>"><%= countrys[i].ZoneTypeDocument.Name %></option>
                                                    <% } %>
                                                <% } %>
                                            </select>
                                        </div>

                                        <div class="mb-3">
                                            <label class="form-label" for="SmallCaption">توضیحات کوتاه</label>
                                            <textarea class="form-control" id="SmallCaption" name="SmallCaption"
                                                      placeholder="توضیحات کوتاه این پروژه را وارد کنید" required
                                                      maxlength="200"><%= project.SmallCaption %></textarea>
                                        </div>
                                        <div class="mb-3">
                                            <label class="form-label" for="Caption">توضیحات پروژه</label>
                                            <textarea class="form-control" id="Caption" name="Caption"
                                                      placeholder="توضیحات این پروژه را وارد کنید"><%= project.Caption %></textarea>
                                        </div>

                                        <div class="col-sm-3 m-4">
                                            <a href="#" class="btn btn-info" id="ChooseFile" data-bs-toggle="modal"
                                               data-bs-target="#printModal"
                                               onclick="albumPopup(lan='<%= lan.ShortName %>', btn='ChooseFile', albumFiles='AlbumFile', multi=true, exist=true, model='project', modelId='<%= project._id %>', modelFilesName='CoverImage')">انتخاب
                                                کاور</a>
                                        </div>
                                        <div id="AlbumFile">

                                        </div>

                                        <div class="col-sm-3 m-4">
                                            <a href="#" class="btn btn-info" id="ChooseFiles" data-bs-toggle="modal"
                                               data-bs-target="#printModal"
                                               onclick="albumPopup(lan='<%= lan.ShortName %>', btn='ChooseFiles', albumFiles='AlbumFiles', multi=true, exist=true, model='project', modelId='<%= project._id %>', modelFilesName='Files')">انتخاب
                                                تصاویر</a>
                                        </div>
                                        <div id="AlbumFiles">

                                        </div>

                                        <div class="col-sm-3 m-4">
                                            <a href="#" class="btn btn-info" id="ChooseResultFiles" data-bs-toggle="modal"
                                               data-bs-target="#printModal"
                                               onclick="albumPopup(lan='<%= lan.ShortName %>', btn='ChooseResultFiles', albumFiles='AlbumResultFiles', multi=true, exist=true, model='project', modelId='<%= project._id %>', modelFilesName='ResultFiles')">انتخاب
                                                تصاویر نتیجه</a>
                                        </div>
                                        <div id="AlbumResultFiles">

                                        </div>

                                        <div class="card-footer text-end">
                                            <button class="btn btn-primary" type="submit">ثبت</button>
                                            <a href="/<%= lan.ShortName %>/project/list" class="btn btn-secondary">بازگشت</a>
                                            <a href="/<%= lan.ShortName %>/projectType/list" class="btn btn-success">مشاهده
                                                دسته بندی
                                                پروژه ها</a>
                                        </div>
                                    </form>

                                </div>

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

            </div>

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

        <!-- Container-fluid Ends-->
    </div>
    <!-- popup -->
    <%- include("../../../partials/popup") %>
    <!-- popup-->

    <%- include("../../../partials/footer") %>
</div>
</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-->
<!--error message for inputs-->
<script src="/RTL/superAdmin/js/input-error.js"></script>
<script src="/RTL/superAdmin/js/tiny/tinymce.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js"></script>
<!-- script pop up -->
<script src="/RTL/superAdmin/js/anse/albumPopup.js"></script>

<!-- Mapp scripts -->
<script src="https://cdn.map.ir/web-sdk/1.4.2/js/jquery-3.2.1.min.js"></script>
<script src="https://cdn.map.ir/web-sdk/1.4.2/js/mapp.env.js"></script>
<script src="https://cdn.map.ir/web-sdk/1.4.2/js/mapp.min.js"></script>
<script src="/RTL/superAdmin/js/anse/map/hack.js"></script>
<script src="/RTL/superAdmin/js/anse/map/map.js"></script>

<!-- Plugin used-->
<script src="/RTL/superAdmin/js/select2/select2.full.min.js"></script>
<script src="/RTL/superAdmin/js/select2/select2-custom.js"></script>

<script>
    window.addEventListener("load", function () {
        getModelFiles(lan='<%= lan.ShortName %>', albumFiles='AlbumFile', model='project', modelId='<%= project._id %>', modelFilesName='CoverImage')
        getModelFiles(lan='<%= lan.ShortName %>', albumFiles='AlbumFiles', model='project', modelId='<%= project._id %>', modelFilesName='Files')
        getModelFiles(lan='<%= lan.ShortName %>', albumFiles='AlbumResultFiles', model='project', modelId='<%= project._id %>', modelFilesName='ResultFiles')
    })
</script>

</body>
</html>
