Add project files.
This commit is contained in:
26
Views/Home/Index.cshtml
Normal file
26
Views/Home/Index.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
<main>
|
||||
<section class="row" aria-labelledby="aspnetTitle">
|
||||
<h1 id="aspnetTitle">ASP.NET</h1>
|
||||
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
|
||||
<p><a href="https://asp.net" class="btn btn-primary btn-md">Learn more »</a></p>
|
||||
</section>
|
||||
<div class="row">
|
||||
<section class="col-md-4" aria-labelledby="gettingStartedTitle">
|
||||
<h2 id="gettingStartedTitle">Getting started</h2>
|
||||
<p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach
|
||||
a broad range of clients, including browsers and mobile devices. ASP.NET Web API
|
||||
is an ideal platform for building RESTful applications on the .NET Framework.</p>
|
||||
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301870">Learn more »</a></p>
|
||||
</section>
|
||||
<section class="col-md-4" aria-labelledby="librariesTitle">
|
||||
<h2 id="librariesTitle">Get more libraries</h2>
|
||||
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
|
||||
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301871">Learn more »</a></p>
|
||||
</section>
|
||||
<section class="col-md-4" aria-labelledby="hostingTitle">
|
||||
<h2 id="hostingTitle">Web Hosting</h2>
|
||||
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
|
||||
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301872">Learn more »</a></p>
|
||||
</section>>
|
||||
</div>
|
||||
</main>
|
||||
131
Views/Panel/Index.cshtml
Normal file
131
Views/Panel/Index.cshtml
Normal file
@ -0,0 +1,131 @@
|
||||
@using boilerplate.Models
|
||||
@{
|
||||
ViewBag.Title = ViewBag.PageTitle;
|
||||
Layout = "~/Views/_PanelSideBar.cshtml";
|
||||
var User = Session["User"] as User;
|
||||
if (User == null) { return; }
|
||||
bool HasAccess(string Access) => new Functions().HasAccess(User.User_Access, Access);
|
||||
}
|
||||
|
||||
<h2>@ViewBag.PageTitle</h2>
|
||||
|
||||
|
||||
@if (HasAccess("ManageDashboard"))
|
||||
{
|
||||
@section Heads {
|
||||
<link href="~/Content/Panel/plugins/custom/fullcalendar/fullcalendar.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
}
|
||||
<style>
|
||||
.text-gray-75 {
|
||||
color: #3F4254;
|
||||
}
|
||||
</style><div class="row">
|
||||
<div class="col-sm-12 form-group">
|
||||
<div class="card card-custom">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="fa fa-network-wired text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/Groups" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">@ViewBag.Groups</a>
|
||||
<div class="text-gray-75">مجموعه ها</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="fa fa-people-group text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/Units" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">@ViewBag.Units</a>
|
||||
<div class="text-gray-75">واحد ها</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="fa fa-address-card text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/HrList" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">@ViewBag.Hr</a>
|
||||
<div class="text-gray-75">منابع انسانی</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="fa fa-comments text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/Chats" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">
|
||||
تالار گفتگو
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-lg-4 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="fa fa-meet text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/Meetings/0" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">
|
||||
جلسات
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="col-lg-6 form-group">
|
||||
<div class="card card-custom wave wave-animate-slow wave-primary mb-8 mb-lg-0">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center p-5">
|
||||
<div class="mr-6">
|
||||
<i class="flaticon2-settings text-primary icon-3x"></i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="~/panel/setting" class="text-gray text-hover-primary font-weight-bold font-size-h4 mb-3">
|
||||
تنظیمات
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
@section Script{
|
||||
}
|
||||
158
Views/Panel/Login.cshtml
Normal file
158
Views/Panel/Login.cshtml
Normal file
@ -0,0 +1,158 @@
|
||||
@{
|
||||
ViewBag.Title = "ورود";
|
||||
Layout = "~/Views/_LayoutAdmin.cshtml";
|
||||
}
|
||||
<div class="d-flex flex-center flex-row-fluid bgi-size-cover bgi-position-top bgi-no-repeat" style="background-image: url('../assets/media/bg/bg-3.jpg');">
|
||||
<div class="login-form text-center p-7 position-relative overflow-hidden w-50">
|
||||
<div class="d-flex flex-center mb-15">
|
||||
<a href="#">
|
||||
<img src="~/Media/logo.png" class="max-h-75px" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="login-signin">
|
||||
<div class="mb-20">
|
||||
<h3>ورود به پنل مدیریت</h3>
|
||||
<div class="text-muted font-weight-bold">شماره تلفن خود را وارد کنید</div>
|
||||
</div>
|
||||
<form class="form fv-plugins-bootstrap fv-plugins-framework" id="kt_sign_in_form">
|
||||
@if (!Response.IsRequestBeingRedirected)
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
}
|
||||
<div class="form-group mb-5 fv-plugins-icon-container">
|
||||
<input class="form-control h-auto form-control-solid py-4 px-8" id="txtPhone" type="text" placeholder="شماره همراه ..." name="Username" maxlength="11">
|
||||
<div class="fv-plugins-message-container"></div>
|
||||
</div>
|
||||
<div class="form-group mb-5 fv-plugins-icon-container">
|
||||
<input class="form-control h-auto form-control-solid py-4 px-8" id="txtCode" type="password" placeholder="کد تایید" name="Password">
|
||||
<div class="fv-plugins-message-container"></div>
|
||||
</div>
|
||||
<a id="SaveBtn" class="btn btn-primary font-weight-bold px-9 py-4 my-3 mx-4" onclick="Login()">ارسال کد تایید</a>
|
||||
<a id="SaveBtn" class="btn btn-primary font-weight-bold px-9 py-4 my-3 mx-4" onclick="LoginPass()">ورود با پسورد</a>
|
||||
<input type="hidden"><div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Script{
|
||||
<script src="~/siteassets/js/bootstrap.js"></script>
|
||||
<script src="~/siteassets/js/notyf.min.js"></script>
|
||||
|
||||
<script>
|
||||
const Return = '@ViewBag.Return';
|
||||
|
||||
$("#txtPhone").keydown(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$("#SaveBtn").click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
function LoginPass() {
|
||||
let Username = $("input[name=Username]").val();
|
||||
let Password = $("input[name=Password]").val();
|
||||
if (Username.length && Password.length) {
|
||||
$("#kt_sign_in_submit").removeAttr("onclick");
|
||||
$("#kt_sign_in_submit").css("opacity", 0.5);
|
||||
$.post("../Panel/Login", $("#kt_sign_in_form").serialize(), function (data) {
|
||||
if (data.Status == "Success") {
|
||||
location.href = "../Panel/Index";
|
||||
}
|
||||
else {
|
||||
$("#kt_sign_in_submit").attr("onclick", "Login()");
|
||||
if (data.Status == "Error") {
|
||||
toastr.warning("خطا هنگام برقراری ارتباط با سرور");
|
||||
}
|
||||
else if (data.Status == "Block") {
|
||||
toastr.warning("شما دسترسی ورود به پنل را ندارید");
|
||||
}
|
||||
else {
|
||||
toastr.warning("اطلاعات وارد شده صحیح نمی باشد");
|
||||
}
|
||||
}
|
||||
}).fail(function () {
|
||||
$("#kt_sign_in_submit").attr("onclick", "Login()");
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
}).always(function () {
|
||||
$("#kt_sign_in_submit").css("opacity", 1);
|
||||
});
|
||||
}
|
||||
else {
|
||||
toastr.warning("نام کاربری و رمز عبور را وارد کنید");
|
||||
}
|
||||
}
|
||||
|
||||
function Login() {
|
||||
var Phone = $("#txtPhone").val();
|
||||
if (Phone.length != 11) {
|
||||
toastr.error('شماره موبایل به درستی وارد نشده !!!');
|
||||
} else {
|
||||
$("#SaveBtn").css("opacity", 0.5);
|
||||
$("#SaveBtn").attr("onclick", "");
|
||||
$.post("../api/User/Login", { Phone: Phone }, function (data) {
|
||||
if (data.Status == "OK") {
|
||||
toastr.success('کد فعال سازی ارسال شد !!!');
|
||||
$("#txtPhone").prop("disabled", true);
|
||||
$(".lvl-2").fadeIn();
|
||||
$("#SaveBtn").attr("onclick", "Submit()");
|
||||
$("#SaveBtn").text("ورود به پنل");
|
||||
//setTimeout(function () {
|
||||
// let RedirectUrl = Return == '' ? '' : `&Return=${Return}`;
|
||||
// location.href = "Verify?Phone=" + Phone + RedirectUrl;
|
||||
//}, 2500);
|
||||
}
|
||||
else {
|
||||
$("#SaveBtn").attr("onclick", "Login()");
|
||||
toastr.error('خطا هنگام برقراری ارتباط با سرور !!!');
|
||||
}
|
||||
}).fail(function (xhr) {
|
||||
console.error("Error:", xhr.responseText);
|
||||
toastr.error('خطا هنگام برقراری ارتباط با سرور !!!');
|
||||
$("#SaveBtn").attr("onclick", "Login()");
|
||||
}).always(function () {
|
||||
$("#SaveBtn").css("opacity", 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function Submit() {
|
||||
var Phone = $("#txtPhone").val();
|
||||
var Code = $("#txtCode").val();
|
||||
if (Code.length == 5) {
|
||||
$.post("../api/User/CheckCode", { Phone: Phone, Code: Code }, function (data) {
|
||||
if (data.Status == "Success") {
|
||||
//$("#SaveBtn").attr("onclick", "");
|
||||
$.get("@Url.Action("Complete", "Panel")", { User: data.Id, Token: data.Token, Phone: Phone })
|
||||
.done(function () {
|
||||
toastr.success('ورود با موفقیت انجام شد !!!');
|
||||
setTimeout(function () {
|
||||
if (Return == '') {
|
||||
location.href = "Index";
|
||||
} else {
|
||||
location.href = Return;
|
||||
}
|
||||
}, 2500);
|
||||
})
|
||||
.fail(function (xhr, status, error) {
|
||||
// Handle error here
|
||||
console.error("Request failed: ", status, error);
|
||||
toastr.error('There was an error while processing your request.');
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
toastr.error('کد وارد شده صحیح نمی باشد');
|
||||
}
|
||||
}).fail(function () {
|
||||
|
||||
toastr.error('خطا هنگام برقراری ارتباط با سرور !!!');
|
||||
}).always(function () {
|
||||
});
|
||||
} else {
|
||||
|
||||
toastr.error('کد تایید را وارد کنید.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
322
Views/Panel/Setting.cshtml
Normal file
322
Views/Panel/Setting.cshtml
Normal file
@ -0,0 +1,322 @@
|
||||
@using boilerplate.Models
|
||||
@using Newtonsoft.Json
|
||||
@model Setting
|
||||
@{
|
||||
ViewBag.Title = "تنظیمات";
|
||||
Layout = "~/Views/_PanelSideBar.cshtml";
|
||||
var Socials = JsonConvert.DeserializeObject<List<SocialModel>>(Model.Setting_Social);
|
||||
}
|
||||
<style>
|
||||
.dataTables_scrollHeadInner, .select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
<div class="card card-custom">
|
||||
<div class="card-header card-header-tabs-line">
|
||||
<div class="card-toolbar">
|
||||
<ul class="nav nav-tabs nav-bold nav-tabs-line">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#Tab_Panel_1">
|
||||
<span class="nav-text">عمومی</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_2">
|
||||
<span class="nav-text">تصاویر</span>
|
||||
</a>
|
||||
</li>
|
||||
@*<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_3">
|
||||
<span class="nav-text">سئو</span>
|
||||
</a>
|
||||
</li>*@
|
||||
@*<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_4">
|
||||
<span class="nav-text">فوتر سایت</span>
|
||||
</a>
|
||||
</li>*@
|
||||
@*<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_5">
|
||||
<span class="nav-text">شبکه های اجتماعی</span>
|
||||
</a>
|
||||
</li>*@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_6">
|
||||
<span class="nav-text">اس ام اس</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Tab_Panel_7">
|
||||
<span class="nav-text">اطلاعات فاکتور</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<a class="btn btn-success font-weight-bold" onclick="Save()" id="btnSave">ذخیره</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="Tab_Panel_1" role="tabpanel" aria-labelledby="Tab_Panel_1">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtName">نام سایت:</label>
|
||||
<input class="form-control" id="txtName" value="@Model.Setting_Name" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtTitle">عنوان سایت:</label>
|
||||
<input class="form-control" id="txtTitle" value="@Model.Setting_Title" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtHeader">تگ های اضافی هدر (استایل، اسکریپت، ...):</label>
|
||||
<textarea class="form-control" id="txtHeader" rows="7" dir="ltr">@HttpUtility.UrlDecode(Model.Setting_Header)</textarea>
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtFooter">تگ های اضافی فوتر (اسکریپت، ...):</label>
|
||||
<textarea class="form-control" id="txtFooter" rows="7" dir="ltr">@HttpUtility.UrlDecode(Model.Setting_Footer)</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="Tab_Panel_2" role="tabpanel" aria-labelledby="Tab_Panel_2">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="fuImage">لوگو:</label>
|
||||
<input class="form-control" id="fuImage" type="file" accept=".png" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<a class="mt-2 float-left" href="~/Media/logo.png?v=1" target="_blank">
|
||||
<img src="~/Media/logo.png?v=1" class="img-thumbnail" style="width: 200px; background-color: #222222;" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="fuIcon">فاوآیکون:</label>
|
||||
<input class="form-control" id="fuIcon" type="file" accept=".ico" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<a class="mt-2 float-left" href="~/Media/favicon.ico?v=1" target="_blank">
|
||||
<img src="~/Media/favicon.ico?v=1" class="img-thumbnail" style="width: 50px;" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="Tab_Panel_3" role="tabpanel" aria-labelledby="Tab_Panel_3">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtDescription">توضیحات سئو:</label>
|
||||
<textarea class="form-control" id="txtDescription" rows="3" placeholder="لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است">@Model.Setting_Description</textarea>
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="ddlKeywords">کلمات کلیدی سئو:</label>
|
||||
<select class="form-control w-100" id="ddlKeywords" multiple>
|
||||
@if (!string.IsNullOrEmpty(Model.Setting_Keywords))
|
||||
{
|
||||
foreach (var item in Model.Setting_Keywords.Split(','))
|
||||
{
|
||||
<option value="@item" selected>@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="tab-pane fade" id="Tab_Panel_4" role="tabpanel" aria-labelledby="Tab_Panel_4">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtDescriptionFooter">توضیحات فوتر:</label>
|
||||
<textarea class="form-control" id="txtDescriptionFooter" rows="3" placeholder="لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است">@Model.DescriptionFooter</textarea>
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="tab-pane fade" id="Tab_Panel_5" role="tabpanel" aria-labelledby="Tab_Panel_5">
|
||||
<div class="row">
|
||||
@foreach (var item in Socials)
|
||||
{
|
||||
<div class="col-md-12 form-group">
|
||||
<div class="row form-group">
|
||||
<label class="col-md-2 col-form-label"><i class="@item.Icon vertical-middle"></i> @item.Value</label>
|
||||
<div class="col-6 col-md-3">
|
||||
<input class="form-control placeholder-right" id="txtSocialTitle_@item.Key" placeholder="عنوان را وارد نمایید" value="@item.Title" />
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<input class="form-control placeholder-right" id="txtSocialLink_@item.Key" placeholder="لینک را وارد نمایید" value="@item.Link" />
|
||||
</div>
|
||||
<div class="col-2 col-md-1">
|
||||
<input type="hidden" class="Socials" value="@JsonConvert.SerializeObject(item)" />
|
||||
<span class="switch switch-sm switch-success">
|
||||
<label>
|
||||
<input type="checkbox" id="chkSocial_@item.Key" @(item.Checked ? "checked" : "")>
|
||||
<span></span>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="Tab_Panel_6" role="tabpanel" aria-labelledby="Tab_Panel_6">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtSmsUsername">نام کاربری:</label>
|
||||
<input class="form-control" id="txtSmsUsername" dir="ltr" value="@Model.Setting_Username" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtSmsPassword">رمز عبور:</label>
|
||||
<input class="form-control" id="txtSmsPassword" dir="ltr" value="@Model.Setting_Password" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtSmsFromNumber">ارسال سریع از خط:</label>
|
||||
<input class="form-control" id="txtSmsFromNumber" dir="ltr" value="@Model.Setting_FromNumber" />
|
||||
<span class="text-muted" style="font-size: 13px;">برای اتصال به پنل پیامکی، می توانید از <a href="http://sms.avinpayamak.ir" target="_blank">این لینک</a> استفاده کنید</span>
|
||||
<br />
|
||||
<span class="text-muted d-block mt-2" style="font-size: 13px;">ترجیحا از شماره <span class="text-primary" dir="ltr">+983000505</span> برای ارسال استفاده کنید و حتما شماره باید در پنل شما فعال باشد</span>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="SmsPaternLogin">پترن ارسال کد ورود:</label>
|
||||
<input class="form-control" id="txtSmsPaternLogin" dir="ltr" value="@Model.Setting_PaternLogin" />
|
||||
<span class="text-muted d-block mt-2" style="font-size: 13px;">متن پترن جهت ثبت: کد احراز هویت شما در سایت : %verification-code%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="Tab_Panel_7" role="tabpanel" aria-labelledby="Tab_Panel_6">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtaddress">آدرس شرکت:</label>
|
||||
<input class="form-control" id="txtaddress" value="@Model.Setting_Address" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtpostcode">کد پستی:</label>
|
||||
<input class="form-control" id="txtpostcode" value="@Model.Setting_PostCode" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtphone">شماره تماس:</label>
|
||||
<input class="form-control" id="txtphone" value="@Model.Setting_Phone" />
|
||||
</div>
|
||||
<div class="col-md-6 form-group"></div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="txtwebsite">وبسایت:</label>
|
||||
<input class="form-control" id="txtwebsite" value="@Model.Setting_Website" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="col-12 form-group d-none" id="ProgressSection">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped" id="Progress" role="progressbar" style="width: 0%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100">0%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section Script {
|
||||
<script>
|
||||
$("#SettingMenu").addClass("menu-item-active");
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#ddlKeywords").select2({ placeholder: 'تایپ کنید و اینتر بزنید ...', tags: true });
|
||||
//KTLayoutAsideToggle.getToggle().toggleOn();
|
||||
});
|
||||
|
||||
$(window).bind('keydown', function (event) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
switch (String.fromCharCode(event.which).toLowerCase()) {
|
||||
case 's':
|
||||
event.preventDefault();
|
||||
$("#btnSave").click();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function Save() {
|
||||
|
||||
// Proceed with the rest of the function if validation passes
|
||||
let SocialList = [];
|
||||
$(".Socials").each(function () {
|
||||
let item = JSON.parse($(this).val());
|
||||
item.Title = $(`#txtSocialTitle_${item.Key}`).val().trim();
|
||||
item.Link = $(`#txtSocialLink_${item.Key}`).val().trim();
|
||||
item.Checked = $(`#chkSocial_${item.Key}`).prop("checked");
|
||||
SocialList.push(item);
|
||||
});
|
||||
|
||||
let model = {
|
||||
Auth: { UserId: UserId, Token: Token },
|
||||
Id: @Model.Setting_Id,
|
||||
Name: $("#txtName").val().trim(),
|
||||
Title: $("#txtTitle").val().trim(),
|
||||
Description: $("#txtDescription").val().trim(),
|
||||
Keywords: $("#ddlKeywords").val().join(','),
|
||||
Header: escape($("#txtHeader").val().trim()),
|
||||
Footer: escape($("#txtFooter").val().trim()),
|
||||
Socials: SocialList,
|
||||
SmsUsername: $("#txtSmsUsername").val().trim(),
|
||||
SmsPassword: $("#txtSmsPassword").val().trim(),
|
||||
SmsFromNumber: $("#txtSmsFromNumber").val().trim(),
|
||||
SmsPaternLogin: $("#txtSmsPaternLogin").val().trim(),
|
||||
|
||||
address: $("#txtaddress").val().trim(),
|
||||
postcode: $("#txtpostcode").val().trim(),
|
||||
phone: $("#txtphone").val().trim(),
|
||||
website: $("#txtwebsite").val().trim(),
|
||||
};
|
||||
|
||||
$("#btnSave").css("opacity", 0.5);
|
||||
$("#btnSave").removeAttr("onclick");
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("Model", JSON.stringify(model));
|
||||
formData.append("Logo", $("#fuImage")[0].files[0]);
|
||||
formData.append("Icon", $("#fuIcon")[0].files[0]);
|
||||
|
||||
let ajax = new XMLHttpRequest();
|
||||
ajax.upload.addEventListener("progress", function (event) {
|
||||
let percent = parseInt((event.loaded / event.total) * 100);
|
||||
$("#Progress").css("width", `${percent}%`);
|
||||
$("#Progress").text(`${percent.toFixed()}%`);
|
||||
}, false);
|
||||
|
||||
ajax.addEventListener("load", function (event) {
|
||||
$("#ProgressSection").addClass('d-none');
|
||||
$("#btnSave").css("opacity", 1);
|
||||
let data = JSON.parse(event.target.responseText);
|
||||
if (data.Status == "Success") {
|
||||
toastr.success("ذخیره سازی با موفقیت انجام شد");
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
$("#btnSave").attr("onclick", "Save()");
|
||||
toastr.warning("خطا هنگام ذخیره سازی اطلاعات");
|
||||
}
|
||||
}, false);
|
||||
|
||||
ajax.addEventListener("error", function () {
|
||||
$("#ProgressSection").addClass('d-none');
|
||||
$("#btnSave").css("opacity", 1);
|
||||
$("#btnSave").attr("onclick", "Save()");
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
}, false);
|
||||
|
||||
ajax.open("post", "@Url.Action("SaveSettings", "Panel")");
|
||||
ajax.send(formData);
|
||||
$("#ProgressSection").removeClass('d-none');
|
||||
}
|
||||
</script>
|
||||
}
|
||||
311
Views/Panel/User.cshtml
Normal file
311
Views/Panel/User.cshtml
Normal file
@ -0,0 +1,311 @@
|
||||
@using boilerplate.Models
|
||||
@model User
|
||||
@{
|
||||
var User = Session["User"] as User;
|
||||
if (Model == null || User == null) { return; }
|
||||
ViewBag.Title = Model.User_Id == 0 ? "کاربر جدید" : Model.User_Name + " " + Model.User_Family;
|
||||
Layout = "~/Views/_PanelSideBar.cshtml";
|
||||
Functions functions = new Functions();
|
||||
|
||||
}
|
||||
<form autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-md-8 form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 form-group">
|
||||
<div class="card card-custom">
|
||||
<div class="card-body">
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="txtName">نام:</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" id="txtName" placeholder="نام ..." value="@Model.User_Name" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="txtFamily">نام خانوادگی:</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" id="txtFamily" placeholder="نام خانوادگی ..." value="@Model.User_Family" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="txtPhone">شماره موبایل:</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" id="txtPhone" placeholder="شماره موبایل ..." value="@Model.User_Phone" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="txtPassword">رمز عبور:</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" id="txtPassword" placeholder="رمز عبور ..." />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="ddlRole">نوع کاربر:</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<select class="form-control" id="ddlRole">
|
||||
<option value="Admin" @(Model.User_Role == "Admin" ? "selected" : "")>مدیر</option>
|
||||
<option value="User" @(Model.User_Role == "User" ? "selected" : "")>کاربر</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="fuImage">تصویر:</label>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" id="fuImage" type="file" accept="image/*" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a href="~/Media/User/@Model.User_Image" target="_blank">
|
||||
<div class="symbol symbol-100 border">
|
||||
<img src="~/Media/User/@Model.User_Image" id="fuPreview" style="object-fit: cover;">
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 form-group">
|
||||
<div class="card card-custom">
|
||||
<div class="card-header bg-secondary-o-100">
|
||||
<div class="card-title">
|
||||
<label>انتشار</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body align-items-center">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<label for="chkStatus">فعال:</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="switch switch-outline switch-icon switch-sm switch-success">
|
||||
<label>
|
||||
<input type="checkbox" id="chkActive" @(Model.User_Status == 1 ? "checked" : "")>
|
||||
<span></span>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
@if (Model.User_Id != 0)
|
||||
{
|
||||
if (User.User_Id != Model.User_Id && functions.HasAccess(User.User_Access, "ManageDeleteUser"))
|
||||
{
|
||||
<div class="col text-center">
|
||||
<a class="btn btn-danger btn-shadow btn-sm w-100 btns" onclick="Delete()">حذف</a>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="col text-center">
|
||||
<a class="btn btn-success btn-shadow btns @(Model.User_Id != 0 ? $"btn-sm {(User.User_Id == Model.User_Id ? "" : "w-100")}" : "")" onclick="Save()" id="btnSave">@(Model.User_Id == 0 ? "انتشار" : "ذخیره")</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 form-group" id="CategoryBlock">
|
||||
<div class="card card-custom">
|
||||
<div class="card-header bg-secondary-o-100">
|
||||
<div class="card-title">
|
||||
<label>دسترسی ها</label>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<a class="btn btn-sm btn-icon btn-primary mx-1" onclick="$(`input[name='chkAccess']`).prop('checked', false)" data-toggle="tooltip" title="عدم علامت همه">
|
||||
<i class="fa fa-minus"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-primary mx-1" onclick="$(`input[name='chkAccess']`).prop('checked', true)" data-toggle="tooltip" title="علامت زدن همه">
|
||||
<i class="fa fa-check"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body align-items-center">
|
||||
<div class="max-h-250px overflow-auto">
|
||||
<div class="checkbox-list mb-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" value="ManageDashboard" name="chkAccess">
|
||||
<span></span>
|
||||
آمار داشبورد
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox-list mb-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" value="ManageUser" name="chkAccess">
|
||||
<span></span>
|
||||
مدیریت کاربران
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox-list mb-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" value="ManageDeleteUser" name="chkAccess">
|
||||
<span></span>
|
||||
مدیریت حذف کاربران
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox-list mb-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" value="ManageSetting" name="chkAccess">
|
||||
<span></span>
|
||||
تنظیمات
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@section Script {
|
||||
<script>
|
||||
const Id = @Model.User_Id;
|
||||
|
||||
$("#UserList").addClass("menu-item-open");
|
||||
if (Id == 0) { $("#UserMenu").addClass("menu-item-active"); }
|
||||
|
||||
const UserAccess = "@Model.User_Access";
|
||||
if (UserAccess == "All") {
|
||||
$(`input[name="chkAccess"]`).prop("checked", true);
|
||||
}
|
||||
else {
|
||||
UserAccess.split(',').forEach(item => { $(`input[name="chkAccess"][value="${item}"]`).prop("checked", true); });
|
||||
}
|
||||
|
||||
$(window).bind('keydown', function (event) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
switch (String.fromCharCode(event.which).toLowerCase()) {
|
||||
case 's':
|
||||
event.preventDefault();
|
||||
$("#btnSave").click();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#fuImage").on("change", function () {
|
||||
if (this.files.length) {
|
||||
try {
|
||||
let Image = this.files[0];
|
||||
if (Image.type.includes("image/")) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function () {
|
||||
$("#fuPreview").attr("src", reader.result);
|
||||
};
|
||||
reader.readAsDataURL(Image);
|
||||
}
|
||||
else {
|
||||
$(this).val(null);
|
||||
toastr.error('فایل انتخاب شده پشتیبانی نمی شود !');
|
||||
}
|
||||
} catch (e) { }
|
||||
}
|
||||
});
|
||||
|
||||
function Save() {
|
||||
let Phone = $("#txtPhone").val().trim();
|
||||
if (Phone.length) {
|
||||
let Access = "";
|
||||
if ($('input[name="chkAccess"]').length == $('input[name="chkAccess"]:checked').length) {
|
||||
Access = "All";
|
||||
}
|
||||
else if ($('input[name="chkAccess"]:checked').length) {
|
||||
$('input[name="chkAccess"]:checked').each(function () {
|
||||
if (Access) {
|
||||
Access += `,${this.value}`;
|
||||
}
|
||||
else {
|
||||
Access = this.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#btnSave").css("opacity", 0.5);
|
||||
$("#btnSave").attr("onclick", "");
|
||||
let model = {
|
||||
Auth: { UserId: UserId, Token: Token },
|
||||
Id: Id,
|
||||
Name: $("#txtName").val().trim(),
|
||||
Family: $("#txtFamily").val().trim(),
|
||||
Phone: Phone,
|
||||
Password: $("#txtPassword").val().trim(),
|
||||
Role: $("#ddlRole").val(),
|
||||
Status: $("#chkActive").prop("checked") ? 1 : 2,
|
||||
Access: Access
|
||||
};
|
||||
let formData = new FormData();
|
||||
formData.append("Model", JSON.stringify(model));
|
||||
formData.append("Image", $("#fuImage")[0].files[0]);
|
||||
let ajax = new XMLHttpRequest();
|
||||
ajax.addEventListener("load", function (event) {
|
||||
$("#btnSave").css("opacity", 1);
|
||||
let data = JSON.parse(event.target.responseText);
|
||||
if (data.Status == "Success") {
|
||||
toastr.success("ذخیره سازی با موفقیت انجام شد");
|
||||
setTimeout(function () {
|
||||
location.href = `../Panel/User/${data.Result}`;
|
||||
}, 1500);
|
||||
} else {
|
||||
$("#btnSave").attr("onclick", "Save()");
|
||||
console.log(data);
|
||||
toastr.warning("خطا هنگام ذخیره سازی اطلاعات");
|
||||
}
|
||||
}, false);
|
||||
ajax.addEventListener("error", function () {
|
||||
$("#btnSave").css("opacity", 1);
|
||||
$("#btnSave").attr("onclick", "Save()");
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
}, false);
|
||||
ajax.open("POST", "../api/User/Manage");
|
||||
ajax.send(formData);
|
||||
}
|
||||
else {
|
||||
toastr.warning("شماره موبایل را وارد کنید");
|
||||
}
|
||||
}
|
||||
|
||||
function Delete() {
|
||||
Swal.fire({
|
||||
title: "آیا از انجام این عملیات مطمئن هستید ؟",
|
||||
text: "این عملیات قابل برگشت نمی باشد !!!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
cancelButtonText: 'خیر',
|
||||
confirmButtonText: 'بله'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.post("../api/User/Delete", { Id: Id, UserId: UserId, Token: Token }).done(function (data) {
|
||||
if (data.Status == "Success") {
|
||||
$(".btns").remove();
|
||||
toastr.success("حذف با موفقیت انجام شد");
|
||||
setTimeout(function () {
|
||||
location.href = "../Panel/Users";
|
||||
}, 1500);
|
||||
} else {
|
||||
toastr.warning("خطا هنگام برقراری ارتباط با سرور");
|
||||
}
|
||||
}).fail(function () {
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
}
|
||||
136
Views/Panel/Users.cshtml
Normal file
136
Views/Panel/Users.cshtml
Normal file
@ -0,0 +1,136 @@
|
||||
@using boilerplate.Models
|
||||
@model List<UserModel>
|
||||
@{
|
||||
ViewBag.Title = "کاربران";
|
||||
Layout = "~/Views/_PanelSideBar.cshtml";
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-custom">
|
||||
<div class="card-header flex-wrap border-0 pt-6 pb-0">
|
||||
<div class="card-title">
|
||||
<h3 class="card-label">@ViewBag.Title</h3>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<a class="btn btn-primary font-weight-bolder" href="Panel/User/0">
|
||||
<span class="svg-icon svg-icon-md m-0">
|
||||
جدید
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect x="0" y="0" width="24" height="24" />
|
||||
<circle fill="#000000" opacity="0.3" cx="12" cy="12" r="10" />
|
||||
<path d="M11,11 L11,7 C11,6.44771525 11.4477153,6 12,6 C12.5522847,6 13,6.44771525 13,7 L13,11 L17,11 C17.5522847,11 18,11.4477153 18,12 C18,12.5522847 17.5522847,13 17,13 L13,13 L13,17 C13,17.5522847 12.5522847,18 12,18 C11.4477153,18 11,17.5522847 11,17 L11,13 L7,13 C6.44771525,13 6,12.5522847 6,12 C6,11.4477153 6.44771525,11 7,11 L11,11 Z" fill="#000000" />
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-separate text-center table-vertical-center table-hover table-head-custom table-checkable" id="DatatableList">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ردیف</th>
|
||||
<th>نام و نام خانوادگی</th>
|
||||
<th>شماره موبایل</th>
|
||||
<th>کد</th>
|
||||
<th>وضعیت</th>
|
||||
<th>نقش</th>
|
||||
<th>تاریخ ایجاد</th>
|
||||
<th>مدیریت</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@try
|
||||
{
|
||||
int Counter = 0;
|
||||
foreach (var item in Model)
|
||||
{
|
||||
Counter++;
|
||||
<tr id="RowSection_@item.Id">
|
||||
<td>@Counter</td>
|
||||
<td>@item.Name @item.Family</td>
|
||||
<td>@item.Phone</td>
|
||||
<td>@item.Code</td>
|
||||
<td>
|
||||
@if (item.Status == 0)
|
||||
{
|
||||
<span class="label label-xl label-secondary label-pill label-inline">در انتظار احرازهویت</span>
|
||||
}
|
||||
else if (item.Status == 1)
|
||||
{
|
||||
<span class="label label-xl label-success label-pill label-inline">فعال</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="label label-xl label-warning label-pill label-inline">غیرفعال</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.Role == "User")
|
||||
{
|
||||
<span class="label label-xl label-info label-pill label-inline">کاربر</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="label label-xl label-success label-pill label-inline">مدیر</span>
|
||||
}
|
||||
</td>
|
||||
<td dir="ltr">@item.CreatedDate</td>
|
||||
<td>
|
||||
<a class="btn btn-success btn-sm mb-1" href="~/Panel/User/@item.Id">مدیریت</a>
|
||||
@if (item.Role == "User")
|
||||
{
|
||||
<a class="btn btn-info btn-sm mb-1" onclick="Login(@item.Id)">ورود به پنل</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section Script {
|
||||
<script>
|
||||
$("#UserList").addClass("menu-item-open");
|
||||
$("#UsersMenu").addClass("menu-item-active");
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#DatatableList").DataTable({
|
||||
order: [[0, 'asc']],
|
||||
scrollX: true,
|
||||
language: { url: 'Media/datatables.json' },
|
||||
columnDefs: [{ targets: [0, 3, 4], type: "num" }]
|
||||
});
|
||||
});
|
||||
|
||||
function Login(Id) {
|
||||
Swal.fire({
|
||||
title: "آیا مایل به ورود به پنل کاربر مورد نظر هستید ؟",
|
||||
text: "",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
cancelButtonText: 'خیر',
|
||||
confirmButtonText: 'بله'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.post(`../Admin/PanelLogin/User/${Id}`).done(function (data) {
|
||||
if (data.Status == "Success") {
|
||||
location.href = "../Panel/Index";
|
||||
} else {
|
||||
toastr.warning("خطا هنگام برقراری ارتباط با سرور");
|
||||
}
|
||||
}).fail(function () {
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
}
|
||||
13
Views/Shared/Error.cshtml
Normal file
13
Views/Shared/Error.cshtml
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>Error</title>
|
||||
</head>
|
||||
<body>
|
||||
<hgroup>
|
||||
<h1>Error.</h1>
|
||||
<h2>An error occurred while processing your request.</h2>
|
||||
</hgroup>
|
||||
</body>
|
||||
</html>
|
||||
39
Views/Shared/_Layout.cshtml
Normal file
39
Views/Shared/_Layout.cshtml
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>@ViewBag.Title - My ASP.NET Application</title>
|
||||
@Styles.Render("~/Content/css")
|
||||
@Scripts.Render("~/bundles/modernizr")
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-dark">
|
||||
<div class="container">
|
||||
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
|
||||
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" title="Toggle navigation" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse d-sm-inline-flex justify-content-between">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "nav-link" })</li>
|
||||
<li>@Html.ActionLink("API", "Index", "Help", new { area = "" }, new { @class = "nav-link" })</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container body-content">
|
||||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@Scripts.Render("~/bundles/jquery")
|
||||
@Scripts.Render("~/bundles/bootstrap")
|
||||
@RenderSection("scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
43
Views/Web.config
Normal file
43
Views/Web.config
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Optimization"/>
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="boilerplate" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
<system.web>
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
</configuration>
|
||||
171
Views/_LayoutAdmin.cshtml
Normal file
171
Views/_LayoutAdmin.cshtml
Normal file
@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html>
|
||||
<html direction="rtl" dir="rtl" style="direction: rtl">
|
||||
<head>
|
||||
<base href="">
|
||||
<meta charset="utf-8" />
|
||||
<meta name="robots" content="index,follow" />
|
||||
<title>پنل مدیریت - @ViewBag.Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<link href="~/assets/plugins/custom/datatables/datatables.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/plugins/global/plugins.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/plugins/custom/prismjs/prismjs.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/style.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/themes/layout/header/base/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/themes/layout/header/menu/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/themes/layout/brand/dark.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/themes/layout/aside/dark.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
|
||||
@*
|
||||
<link href="~/assets/css/themes/layout/brand/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/assets/css/themes/layout/aside/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
*@
|
||||
<link href="~/assets/PersianDate/persian-datepicker.min.css" rel="stylesheet" />
|
||||
<link rel="shortcut icon" href="~/Media/favicon.png" />
|
||||
<script>
|
||||
let IsSingleMode = true;
|
||||
let SingleImageList = {};
|
||||
let MultiImageList = [];
|
||||
</script>
|
||||
<style>
|
||||
@@media (max-width: 991.98px) {
|
||||
.header-mobile-fixed .wrapper {
|
||||
padding-top: 65px;
|
||||
}
|
||||
}
|
||||
|
||||
.vertical-middle {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* webkit solution */
|
||||
::-webkit-input-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
/* mozilla solution */
|
||||
.placeholder-right:-moz-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.placeholder-right {
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.blockUI, .blockui {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
text {
|
||||
font-family: 'IRANSansWeb';
|
||||
}
|
||||
|
||||
#DataModal {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
@RenderSection("Head", false)
|
||||
</head>
|
||||
<body id="kt_body" class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading">
|
||||
@RenderBody()
|
||||
<div id="kt_scrolltop" class="scrolltop">
|
||||
<span class="svg-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24" />
|
||||
<rect fill="#000000" opacity="0.3" x="11" y="10" width="2" height="10" rx="1" />
|
||||
<path d="M6.70710678,12.7071068 C6.31658249,13.0976311 5.68341751,13.0976311 5.29289322,12.7071068 C4.90236893,12.3165825 4.90236893,11.6834175 5.29289322,11.2928932 L11.2928932,5.29289322 C11.6714722,4.91431428 12.2810586,4.90106866 12.6757246,5.26284586 L18.6757246,10.7628459 C19.0828436,11.1360383 19.1103465,11.7686056 18.7371541,12.1757246 C18.3639617,12.5828436 17.7313944,12.6103465 17.3242754,12.2371541 L12.0300757,7.38413782 L6.70710678,12.7071068 Z" fill="#000000" fill-rule="nonzero" />
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<script src="~/assets/plugins/global/plugins.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/assets/plugins/custom/prismjs/prismjs.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/assets/js/scripts.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/assets/PersianDate/persian-date.min.js"></script>
|
||||
<script src="~/assets/PersianDate/persian-datepicker.min.js"></script>
|
||||
<script src="~/assets/js/pages/widgets.js?v=7.0.6"></script>
|
||||
<script src="~/assets/plugins/custom/datatables/datatables.bundle.js?v=7.0.6"></script>
|
||||
<script>
|
||||
$.fn.digits = function () {
|
||||
return this.each(function () {
|
||||
$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
|
||||
});
|
||||
}
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"newestOnTop": false,
|
||||
"progressBar": true,
|
||||
"positionClass": "toast-top-left",
|
||||
"preventDuplicates": false,
|
||||
"onclick": null,
|
||||
"showDuration": "300",
|
||||
"hideDuration": "1000",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "linear",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
};
|
||||
var KTAppSettings = {
|
||||
"breakpoints": {
|
||||
"sm": 576,
|
||||
"md": 768,
|
||||
"lg": 992,
|
||||
"xl": 1200,
|
||||
"xxl": 1200
|
||||
},
|
||||
"colors": {
|
||||
"theme": {
|
||||
"base": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#0BB783",
|
||||
"secondary": "#E5EAEE",
|
||||
"success": "#1BC5BD",
|
||||
"info": "#8950FC",
|
||||
"warning": "#FFA800",
|
||||
"danger": "#F64E60",
|
||||
"light": "#F3F6F9",
|
||||
"dark": "#212121"
|
||||
},
|
||||
"light": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#D7F9EF",
|
||||
"secondary": "#ECF0F3",
|
||||
"success": "#C9F7F5",
|
||||
"info": "#EEE5FF",
|
||||
"warning": "#FFF4DE",
|
||||
"danger": "#FFE2E5",
|
||||
"light": "#F3F6F9",
|
||||
"dark": "#D6D6E0"
|
||||
},
|
||||
"inverse": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#ffffff",
|
||||
"secondary": "#212121",
|
||||
"success": "#ffffff",
|
||||
"info": "#ffffff",
|
||||
"warning": "#ffffff",
|
||||
"danger": "#ffffff",
|
||||
"light": "#464E5F",
|
||||
"dark": "#ffffff"
|
||||
}
|
||||
},
|
||||
"gray": {
|
||||
"gray-100": "#F3F6F9",
|
||||
"gray-200": "#ECF0F3",
|
||||
"gray-300": "#E5EAEE",
|
||||
"gray-400": "#D6D6E0",
|
||||
"gray-500": "#B5B5C3",
|
||||
"gray-600": "#80808F",
|
||||
"gray-700": "#464E5F",
|
||||
"gray-800": "#1B283F",
|
||||
"gray-900": "#212121"
|
||||
}
|
||||
},
|
||||
"font-family": "Poppins"
|
||||
};
|
||||
</script>
|
||||
@RenderSection("Script", false)
|
||||
</body>
|
||||
</html>
|
||||
168
Views/_PanelLayout.cshtml
Normal file
168
Views/_PanelLayout.cshtml
Normal file
@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html>
|
||||
<html direction="rtl" dir="rtl" style="direction: rtl">
|
||||
<head>
|
||||
<base href="~/">
|
||||
<meta charset="utf-8" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>پنل مدیریت - @ViewBag.Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<link href="~/Content/PersianDate/persian-datepicker.min.css" rel="stylesheet" />
|
||||
<link href="~/Content/Panel/plugins/custom/datatables/datatables.bundle.rtl.css" rel="stylesheet" />
|
||||
<link href="~/Content/Panel/plugins/global/plugins.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/plugins/custom/prismjs/prismjs.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/css/style.bundle.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/css/themes/layout/header/base/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/css/themes/layout/header/menu/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/css/themes/layout/brand/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link href="~/Content/Panel/css/themes/layout/aside/light.rtl.css?v=7.0.6" rel="stylesheet" type="text/css" />
|
||||
<link rel="shortcut icon" href="~/Media/favicon.png" />
|
||||
<link href="~/assets/fontawesome-free-6.6.0-web/css/all.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
@@media (max-width: 991.98px) {
|
||||
.header-mobile-fixed .wrapper {
|
||||
padding-top: 65px;
|
||||
}
|
||||
}
|
||||
|
||||
.vertical-middle {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* webkit solution */
|
||||
::-webkit-input-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
/* mozilla solution */
|
||||
.placeholder-right:-moz-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.placeholder-right {
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.blockUI, .blockui {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
text {
|
||||
font-family: 'IRANSansWeb';
|
||||
}
|
||||
|
||||
#DataModal {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
@RenderSection("Heads", false)
|
||||
</head>
|
||||
<body id="kt_body" class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading">
|
||||
@RenderBody()
|
||||
<div id="kt_scrolltop" class="scrolltop">
|
||||
<span class="svg-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24" />
|
||||
<rect fill="#000000" opacity="0.3" x="11" y="10" width="2" height="10" rx="1" />
|
||||
<path d="M6.70710678,12.7071068 C6.31658249,13.0976311 5.68341751,13.0976311 5.29289322,12.7071068 C4.90236893,12.3165825 4.90236893,11.6834175 5.29289322,11.2928932 L11.2928932,5.29289322 C11.6714722,4.91431428 12.2810586,4.90106866 12.6757246,5.26284586 L18.6757246,10.7628459 C19.0828436,11.1360383 19.1103465,11.7686056 18.7371541,12.1757246 C18.3639617,12.5828436 17.7313944,12.6103465 17.3242754,12.2371541 L12.0300757,7.38413782 L6.70710678,12.7071068 Z" fill="#000000" fill-rule="nonzero" />
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
var KTAppSettings = {
|
||||
"breakpoints": {
|
||||
"sm": 576,
|
||||
"md": 768,
|
||||
"lg": 992,
|
||||
"xl": 1200,
|
||||
"xxl": 1400
|
||||
},
|
||||
"colors": {
|
||||
"theme": {
|
||||
"base": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#3699FF",
|
||||
"secondary": "#E5EAEE",
|
||||
"success": "#1BC5BD",
|
||||
"info": "#8950FC",
|
||||
"warning": "#FFA800",
|
||||
"danger": "#F64E60",
|
||||
"light": "#E4E6EF",
|
||||
"dark": "#181C32"
|
||||
},
|
||||
"light": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#E1F0FF",
|
||||
"secondary": "#EBEDF3",
|
||||
"success": "#C9F7F5",
|
||||
"info": "#EEE5FF",
|
||||
"warning": "#FFF4DE",
|
||||
"danger": "#FFE2E5",
|
||||
"light": "#F3F6F9",
|
||||
"dark": "#D6D6E0"
|
||||
},
|
||||
"inverse": {
|
||||
"white": "#ffffff",
|
||||
"primary": "#ffffff",
|
||||
"secondary": "#3F4254",
|
||||
"success": "#ffffff",
|
||||
"info": "#ffffff",
|
||||
"warning": "#ffffff",
|
||||
"danger": "#ffffff",
|
||||
"light": "#464E5F",
|
||||
"dark": "#ffffff"
|
||||
}
|
||||
},
|
||||
"gray": {
|
||||
"gray-100": "#F3F6F9",
|
||||
"gray-200": "#EBEDF3",
|
||||
"gray-300": "#E4E6EF",
|
||||
"gray-400": "#D1D3E0",
|
||||
"gray-500": "#B5B5C3",
|
||||
"gray-600": "#7E8299",
|
||||
"gray-700": "#5E6278",
|
||||
"gray-800": "#3F4254",
|
||||
"gray-900": "#181C32"
|
||||
}
|
||||
},
|
||||
"font-family": "Poppins"
|
||||
};
|
||||
</script>
|
||||
<script src="~/Content/Panel/plugins/global/plugins.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/Content/Panel/plugins/custom/prismjs/prismjs.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/Content/Panel/js/scripts.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/Content/Panel/plugins/custom/datatables/datatables.bundle.js?v=7.0.6"></script>
|
||||
<script src="~/Content/PersianDate/persian-date.min.js"></script>
|
||||
<script src="~/Content/PersianDate/persian-datepicker.min.js"></script>
|
||||
<script src="~/Content/summernote-fa-IR.min.js"></script>
|
||||
<script src="~/Content/Main.js?v=1"></script>
|
||||
<script src="~/assets/fontawesome-free-6.6.0-web/js/all.js"></script>
|
||||
<script>
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"newestOnTop": false,
|
||||
"progressBar": true,
|
||||
"positionClass": "toast-top-left",
|
||||
"preventDuplicates": false,
|
||||
"onclick": null,
|
||||
"showDuration": "300",
|
||||
"hideDuration": "1000",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "linear",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
};
|
||||
|
||||
|
||||
$.fn.digits = function () {
|
||||
return this.each(function () {
|
||||
$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@RenderSection("Script", false)
|
||||
</body>
|
||||
</html>
|
||||
413
Views/_PanelSideBar.cshtml
Normal file
413
Views/_PanelSideBar.cshtml
Normal file
@ -0,0 +1,413 @@
|
||||
@using boilerplate.Models
|
||||
@{
|
||||
Layout = "~/Views/_PanelLayout.cshtml";
|
||||
var User = Session["User"] as User;
|
||||
if (User == null) { return; }
|
||||
bool HasAccess(string Access) => new Functions().HasAccess(User.User_Access, Access);
|
||||
}
|
||||
@section Heads {
|
||||
@RenderSection("Heads", false)
|
||||
}
|
||||
<style>
|
||||
/* Modal fixed size with scrollable content */
|
||||
.modal-dialogNotif {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.notificationButton {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgb(149, 202, 255);
|
||||
}
|
||||
|
||||
/* Red dot for unread notifications */
|
||||
.unread::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: red;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Modal fixed size with scrollable content */
|
||||
.modal-dialogNotif {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.scrolling-container {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.scrolling-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
animation: scroll-items 25s linear infinite;
|
||||
}
|
||||
|
||||
.scrolling-item {
|
||||
display: inline-block;
|
||||
margin: 0 30px; /* Space between items */
|
||||
font-size: 16px;
|
||||
opacity: 100; /* Start with invisible items */
|
||||
white-space: nowrap;
|
||||
animation: scroll 300s linear infinite;
|
||||
}
|
||||
|
||||
/* Keyframes for scrolling the content */
|
||||
@@keyframes scroll-items {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateX(300%); /* Move content fully */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="kt_header_mobile" class="header-mobile align-items-center header-mobile-fixed">
|
||||
<button class="btn p-0 burger-icon burger-icon-left mr-4" id="kt_aside_mobile_toggle">
|
||||
<span></span>
|
||||
</button>
|
||||
<a href="~/Panel">
|
||||
<img class="w-50" src="~/Media/Logo.png" />
|
||||
</a>
|
||||
<div class="d-flex align-items-center">
|
||||
<button class="btn p-0 burger-icon ml-4 d-none d-md-block" id="kt_header_mobile_toggle">
|
||||
<span></span>
|
||||
</button>
|
||||
<!-- Notification Icon with Counter -->
|
||||
<div class="notification-container" style="margin-left: 20px;">
|
||||
|
||||
<button id="notificationButton" class="position-relative notificationButton">
|
||||
<i class="fa fa-bell fa-2x"></i> <!-- Notification Icon -->
|
||||
<span style="color:aliceblue" id="notificationCounter" class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
||||
0 <!-- Unread Count -->
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<button class="btn btn-hover-text-primary p-0 ml-2" id="kt_header_mobile_topbar_toggle">
|
||||
<span class="svg-icon svg-icon-xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24" />
|
||||
<path d="M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z" fill="#000000" fill-rule="nonzero" opacity="0.3" />
|
||||
<path d="M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z" fill="#000000" fill-rule="nonzero" />
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-root">
|
||||
<div class="d-flex flex-row flex-column-fluid page">
|
||||
<div class="aside aside-left aside-fixed d-flex flex-column flex-row-auto" id="kt_aside">
|
||||
<div class="brand flex-column-auto d-flex" id="kt_brand">
|
||||
<a href="~/Panel">
|
||||
<img class="w-75" src="~/Media/Logo.png" />
|
||||
</a>
|
||||
<button class="brand-toggle btn btn-sm px-0 d-none d-md-inline-block" id="kt_aside_toggle">
|
||||
<span class="svg-icon svg-icon svg-icon-xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24"></polygon>
|
||||
<path d="M5.29288961,6.70710318 C4.90236532,6.31657888 4.90236532,5.68341391 5.29288961,5.29288961 C5.68341391,4.90236532 6.31657888,4.90236532 6.70710318,5.29288961 L12.7071032,11.2928896 C13.0856821,11.6714686 13.0989277,12.281055 12.7371505,12.675721 L7.23715054,18.675721 C6.86395813,19.08284 6.23139076,19.1103429 5.82427177,18.7371505 C5.41715278,18.3639581 5.38964985,17.7313908 5.76284226,17.3242718 L10.6158586,12.0300721 L5.29288961,6.70710318 Z" fill="#000000" fill-rule="nonzero" transform="translate(8.999997, 11.999999) scale(-1, 1) translate(-8.999997, -11.999999) "></path>
|
||||
<path d="M10.7071009,15.7071068 C10.3165766,16.0976311 9.68341162,16.0976311 9.29288733,15.7071068 C8.90236304,15.3165825 8.90236304,14.6834175 9.29288733,14.2928932 L15.2928873,8.29289322 C15.6714663,7.91431428 16.2810527,7.90106866 16.6757187,8.26284586 L22.6757187,13.7628459 C23.0828377,14.1360383 23.1103407,14.7686056 22.7371482,15.1757246 C22.3639558,15.5828436 21.7313885,15.6103465 21.3242695,15.2371541 L16.0300699,10.3841378 L10.7071009,15.7071068 Z" fill="#000000" fill-rule="nonzero" opacity="0.3" transform="translate(15.999997, 11.999999) scale(-1, 1) rotate(-270.000000) translate(-15.999997, -11.999999) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
<button class="btn btn-sm p-0 burger-icon-left d-inline-block d-sm-none" onclick="$('#kt_aside_mobile_toggle').click();">
|
||||
<span>
|
||||
<i class="fa fa-window-close fa-2x"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
|
||||
<div id="kt_aside_menu" class="aside-menu my-4" data-menu-vertical="1" data-menu-scroll="1" data-menu-dropdown-timeout="500">
|
||||
<ul class="menu-nav">
|
||||
<li class="menu-item" aria-haspopup="true" id="DashboardMenu">
|
||||
<a href="~/panel" class="menu-link">
|
||||
<span class="svg-icon menu-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24"></polygon>
|
||||
<path d="M12.9336061,16.072447 L19.36,10.9564761 L19.5181585,10.8312381 C20.1676248,10.3169571 20.2772143,9.3735535 19.7629333,8.72408713 C19.6917232,8.63415859 19.6104327,8.55269514 19.5206557,8.48129411 L12.9336854,3.24257445 C12.3871201,2.80788259 11.6128799,2.80788259 11.0663146,3.24257445 L4.47482784,8.48488609 C3.82645598,9.00054628 3.71887192,9.94418071 4.23453211,10.5925526 C4.30500305,10.6811601 4.38527899,10.7615046 4.47382636,10.8320511 L4.63,10.9564761 L11.0659024,16.0730648 C11.6126744,16.5077525 12.3871218,16.5074963 12.9336061,16.072447 Z" fill="#000000" fill-rule="nonzero"></path>
|
||||
<path d="M11.0563554,18.6706981 L5.33593024,14.122919 C4.94553994,13.8125559 4.37746707,13.8774308 4.06710397,14.2678211 C4.06471678,14.2708238 4.06234874,14.2738418 4.06,14.2768747 L4.06,14.2768747 C3.75257288,14.6738539 3.82516916,15.244888 4.22214834,15.5523151 C4.22358765,15.5534297 4.2250303,15.55454 4.22647627,15.555646 L11.0872776,20.8031356 C11.6250734,21.2144692 12.371757,21.2145375 12.909628,20.8033023 L19.7677785,15.559828 C20.1693192,15.2528257 20.2459576,14.6784381 19.9389553,14.2768974 C19.9376429,14.2751809 19.9363245,14.2734691 19.935,14.2717619 L19.935,14.2717619 C19.6266937,13.8743807 19.0546209,13.8021712 18.6572397,14.1104775 C18.654352,14.112718 18.6514778,14.1149757 18.6486172,14.1172508 L12.9235044,18.6705218 C12.377022,19.1051477 11.6029199,19.1052208 11.0563554,18.6706981 Z" fill="#000000" opacity="0.3"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="menu-text">داشبورد</span>
|
||||
</a>
|
||||
</li>
|
||||
@if (HasAccess("ManageUser"))
|
||||
{
|
||||
<li class="menu-item menu-item-submenu" aria-haspopup="true" data-menu-toggle="hover" id="UserList">
|
||||
<a href="javascript:;" class="menu-link menu-toggle">
|
||||
<i class="menu-icon flaticon-users-1"></i>
|
||||
<span class="menu-text">کاربران و دسترسی ها</span>
|
||||
<i class="menu-arrow"></i>
|
||||
</a>
|
||||
<div class="menu-submenu">
|
||||
<i class="menu-arrow"></i>
|
||||
<ul class="menu-subnav">
|
||||
<li class="menu-item" aria-haspopup="true" id="UsersMenu">
|
||||
<a href="~/panel/Users" class="menu-link">
|
||||
<i class="menu-bullet menu-bullet-line"><span></span></i>
|
||||
<span class="menu-text">لیست کاربران</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item" aria-haspopup="true" id="AddUserMenu">
|
||||
<a href="~/panel/User" class="menu-link">
|
||||
<i class="menu-bullet menu-bullet-line"><span></span></i>
|
||||
<span class="menu-text">کاربر جدید</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
|
||||
@if (HasAccess("ManageSettings"))
|
||||
{
|
||||
<li class="menu-item" aria-haspopup="true" id="SettingMenu">
|
||||
<a href="~/panel/Setting" class="menu-link">
|
||||
<i class="menu-icon flaticon-settings"></i>
|
||||
<span class="menu-text">تنظیمات</span>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li class="menu-item" aria-haspopup="true">
|
||||
<a href="~/panel/Logout" class="menu-link">
|
||||
<i class="menu-icon flaticon-logout"></i>
|
||||
<span class="menu-text">خروج</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-row-fluid wrapper" id="kt_wrapper">
|
||||
<div id="kt_header" class="header header-fixed">
|
||||
<div class=" container-fluid d-flex align-items-stretch justify-content-between">
|
||||
<div class="header-menu-wrapper header-menu-wrapper-left" id="kt_header_menu_wrapper">
|
||||
<div id="kt_header_menu" class="header-menu header-menu-mobile header-menu-layout-default">
|
||||
<ul class="menu-nav">
|
||||
<li class="menu-item menu-item-submenu menu-item-rel" data-menu-toggle="click" aria-haspopup="true">
|
||||
<a class="menu-link " href="~/panel/Logout"><span class="menu-text">خروج</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="topbar">
|
||||
<div class="topbar-item">
|
||||
|
||||
<!-- Notification Icon with Counter -->
|
||||
<div class="notification-container" style="margin-left: 20px;">
|
||||
|
||||
<button id="notificationButton" class="position-relative notificationButton">
|
||||
<i class="fa fa-bell fa-2x"></i> <!-- Notification Icon -->
|
||||
<span style="color:aliceblue" id="notificationCounter" class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
||||
0 <!-- Unread Count -->
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<a href="~/Panel/User/@User.User_Id" class="btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2" id="kt_quick_user_toggle">
|
||||
<span class="text-muted font-weight-bold font-size-base d-none d-md-inline mr-1">@User.User_Name</span>
|
||||
<span class="text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3">@User.User_Family</span>
|
||||
<span class="symbol symbol-lg-35 symbol-25 symbol-light-success">
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
|
||||
<div class="subheader py-2 py-lg-6 subheader-solid" id="kt_subheader">
|
||||
<div class=" container-fluid d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap">
|
||||
<div class="d-flex align-items-center flex-wrap mr-1">
|
||||
<div class="d-flex align-items-baseline flex-wrap mr-5">
|
||||
<h5 class="text-dark font-weight-bold my-1 mr-5">@ViewBag.Title</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<a onclick="history.back()" class="flex-shrink-0 text-center cursor-pointer" style="width: 40px;" data-toggle="tooltip" title="" data-placement="right" data-original-title="بازگشت">
|
||||
<i class="icon-xl fas fa-arrow-alt-circle-left"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column-fluid">
|
||||
<div class="container-fluid">
|
||||
@RenderBody()
|
||||
<div class="scrolling-container alert alert-success d-none" id="alertbar">
|
||||
<div id="scrollContent" class="scrolling-content">
|
||||
<!-- Dynamic content will be appended here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notification Modal -->
|
||||
<div class="modal fade " id="notificationModal" tabindex="-1" aria-labelledby="notificationModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialogNotif">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="notificationModalLabel">اعلان ها</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul id="notificationList" class="list-group">
|
||||
<!-- Notifications will be dynamically appended here -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@section Script {
|
||||
<script>
|
||||
const UserId = "@User.User_Id";
|
||||
const Token = "@User.User_Token";
|
||||
|
||||
|
||||
function SetTitle(title) {
|
||||
if (title.length) {
|
||||
$(".titles").html(title);
|
||||
document.title = `${title}`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
if (!window.x) {
|
||||
window.x = undefined;
|
||||
window.deferredPrompt = undefined;
|
||||
window.splashScreen = document.querySelector('.splash');
|
||||
}
|
||||
|
||||
|
||||
window.onpopstate = function (event) {
|
||||
if (event.state) {
|
||||
var url = event.state.url.replaceAll("Index", "Main");
|
||||
if (url == "/") {
|
||||
url = '@Url.Action("Main", "Home")';
|
||||
}
|
||||
var page = url.substring(1);
|
||||
loadContent(url, page, event.state.title, false);
|
||||
}
|
||||
};
|
||||
|
||||
function loadContent(url, page, title, addToHistory = true) {
|
||||
if (window.reciever) {
|
||||
clearInterval(window.reciever);
|
||||
}
|
||||
$.get(url, function (data) {
|
||||
$("#navLeft, #navRight").empty();
|
||||
$("#navTitle").removeAttr('onclick');
|
||||
$(".script").remove();
|
||||
$('#kt_chat_content').html(data);
|
||||
SetTitle(title);
|
||||
|
||||
// Execute any scripts in the partial view after it's loaded
|
||||
$(data).filter("script").each(function () {
|
||||
$.globalEval(this.text || this.textContent || this.innerHTML);
|
||||
});
|
||||
|
||||
if (addToHistory && (history.state === null || history.state.page !== page)) {
|
||||
history.pushState({ url, page, title }, '', `/${page}`);
|
||||
}
|
||||
}).fail(function () {
|
||||
setTimeout(function () {
|
||||
loadContent(url, page, title, addToHistory);
|
||||
}, 2000);
|
||||
}).always(function () {
|
||||
ActiveMenu(page);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadPage(elem, url, title = null, addToHistory = true) {
|
||||
var page = url.replaceAll("Index", "Main").substring(1);
|
||||
loadContent(url, page, title ?? $(elem).text(), addToHistory);
|
||||
}
|
||||
|
||||
function SetTitle(title) {
|
||||
if (title.length) {
|
||||
$(".titles").html(title);
|
||||
document.title = `${title}`;
|
||||
}
|
||||
}
|
||||
|
||||
function ActiveMenu(page) {
|
||||
try {
|
||||
if ($(`#${page}-tab`).length) {
|
||||
$(`#${page}-tab a`).addClass("active");
|
||||
}
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
function BackHome() {
|
||||
$("#navLeft").empty();
|
||||
loadPage(null, '@Url.Action("Main", "Home")', 'صفحه اصلی');
|
||||
}
|
||||
|
||||
function _Get(param = 'Return') {
|
||||
return new URLSearchParams(window.location.search).get(param);
|
||||
}
|
||||
|
||||
function AddView(Id, Type) { $.post("../api/View/Add", { Id, Type }); }
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function Submit(CurrentId) {
|
||||
Swal.fire({
|
||||
title: "آیا از انجام این عملیات مطمئن هستید ؟",
|
||||
text: "این عملیات قابل برگشت نمی باشد !!!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
cancelButtonText: 'خیر',
|
||||
confirmButtonText: 'بله'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.post("../api/Entrance/Submit", { Id: CurrentId, UserId: UserId, Token: Token }).done(function (data) {
|
||||
if (data.Status == "Success") {
|
||||
$(".btns").remove();
|
||||
toastr.success("ثبت با موفقیت انجام شد");
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
toastr.warning("خطا هنگام برقراری ارتباط با سرور");
|
||||
}
|
||||
}).fail(function () {
|
||||
toastr.error("خطا هنگام برقراری ارتباط با سرور");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@RenderSection("Script", false)
|
||||
}
|
||||
3
Views/_ViewStart.cshtml
Normal file
3
Views/_ViewStart.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
Reference in New Issue
Block a user