796 lines
35 KiB
Plaintext
796 lines
35 KiB
Plaintext
@page
|
||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||
@using Microsoft.EntityFrameworkCore
|
||
@using _0_Framework.Application
|
||
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
|
||
@inject IAuthHelper _AuthHelper;
|
||
|
||
@{
|
||
|
||
var i = 1;
|
||
var j = 1;
|
||
var r = 1;
|
||
var permissionList = _AuthHelper.GetPermissions();
|
||
//string colaps = "in";
|
||
//string act = "active";
|
||
}
|
||
|
||
@{
|
||
Layout = "Shared/_AdminLayout";
|
||
ViewData["title"] = "مدیریت کاربران";
|
||
<style>
|
||
.faSize {
|
||
font-size: 22px !important;
|
||
}
|
||
.red {
|
||
border-radius: 8px !important;
|
||
/* padding: 10px; */
|
||
padding: 2px 5px 0px 5px;
|
||
}
|
||
.sizeSet {
|
||
padding: 2px !important;
|
||
text-align: center !important;
|
||
}
|
||
|
||
#createProcess {
|
||
background-color: #fdfdfd;
|
||
height: 100px;
|
||
border-radius: 15px;
|
||
margin: 0px 2px 10px 2px;
|
||
box-shadow: 0px 1px 15px 0 #1ebb5f;
|
||
}
|
||
.progress-bar {
|
||
color: #fff!important;
|
||
font-size: 17px !important;
|
||
line-height: 23px !important;
|
||
border-radius: 10px !important;
|
||
|
||
}
|
||
|
||
|
||
@@media (max-width:634px) {
|
||
.tabs li.tab .hideInMobile {
|
||
display: none
|
||
}
|
||
.textMenu {
|
||
font-size: 10px;
|
||
font-weight: 800;
|
||
}
|
||
}
|
||
|
||
|
||
</style>
|
||
}
|
||
|
||
<input type="hidden" id="userID" value="@Model.CurrntAccountId" asp-for="@Model.CurrntAccountId" />
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
|
||
<p class="pull-right" permission="30601">
|
||
<a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a>
|
||
|
||
</p>
|
||
<p class="pull-right" permission="30602">
|
||
<a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a>
|
||
|
||
</p>
|
||
<span id="errSend"></span>
|
||
</div>
|
||
</div>
|
||
<div id="createProcess" class="row progress-bar-striped progBar" style="display: none">
|
||
<div class="form-group" style="padding: 0px 10px;">
|
||
<span style="text-align: center">
|
||
<h3 style="font-size: 15px;
|
||
color: #767575;
|
||
margin-top: 20px;
|
||
margin-bottom: 15px;">درصد پیشرفت عملیات</h3>
|
||
</span>
|
||
|
||
|
||
<div class="progress" style="height: 20px">
|
||
<div id="progress-bar-w" style="background-color: rgb(16 170 18)" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="row">
|
||
|
||
|
||
<div class="col-lg-12" style="padding: 0px 8px;">
|
||
|
||
<ul class="nav nav-tabs tabs" id="myTab">
|
||
@* ============================================RolesTab=================*@
|
||
<li class="tab @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " permission="30605">
|
||
<a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||
<span class="visible-xs">
|
||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||
<span class="textMenu">نقش ها</span>
|
||
</span>
|
||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> نقش ها</h3>
|
||
</a>
|
||
</li>
|
||
@* ===============================================AdminTab=================*@
|
||
<li class="tab active" permission="30604">
|
||
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
|
||
<span class="visible-xs">
|
||
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
|
||
<span class="textMenu">لیست ادمین</span>
|
||
</span>
|
||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-user fa-2x" style="padding-left: 3px;"></i> لیست کاربران (ادمین) (@Model.AdminAccounts.Count) </h3>
|
||
</a>
|
||
</li>
|
||
@* ===============================================ClientTab=================*@
|
||
<li class="tab @(permissionList.All(x => x != 30604) ? "active" : "")" permission="30603">
|
||
<a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||
<span class="visible-xs" >
|
||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||
<span class="textMenu">لیست کلاینت</span>
|
||
</span>
|
||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( کلاینت) (@Model.ClientAccounts.Count) </h3>
|
||
</a>
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<div class="tab-content">
|
||
@*==================================================================Adminusers=====*@
|
||
<div class="tab-pane active" id="home-21" permission="30604">
|
||
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
<h3 class="panel-title" style="padding: 10px 12px !important"><i class="fa fa-search" style="padding-left: 3px; font-size: 14px"></i> جستجو در کاربران</h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<form class="form-inline" role="form" method="get">
|
||
<div class="form-group col-lg-12">
|
||
<div class="row">
|
||
<div class="col-lg-3 pull-right">
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Fullname"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Fullname" placeholder="نام ">
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Username"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Username" placeholder="نام کاربری ">
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Mobile"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Mobile" placeholder="شماره تماس">
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.RoleId"></label>
|
||
<select style="width: 100%" class="form-control" asp-for="SearchModel.RoleId" asp-items="Model.Roles">
|
||
<option value="0"> نقش</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="row" style="margin-top: 15px">
|
||
<div class="col-md-3">
|
||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px"> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
|
||
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
|
||
</div>
|
||
|
||
|
||
<div class="col-md-9">
|
||
<label class="sr-only" asp-for="SearchModel.IsActiveString"></label>
|
||
<select id="activing" class="form-control activer" asp-for="SearchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
|
||
<option value=""> فعال </option>
|
||
<option value="false"> غیرفعال</option>
|
||
<option value="both"> هردو</option>
|
||
</select>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" id="ProductCategoriesDiv">
|
||
<div class="col-md-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="row">
|
||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||
<div style="overflow-x: auto; padding: 0 10px;">
|
||
<table id="datatable" class="table table-striped table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th style="font-size: 14px !important" class="sizeSet">#</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">عکس</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">نام</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">نام کاربری</th>
|
||
@*<th> شماره تماس</th>*@
|
||
<th style="font-size: 14px !important" class="sizeSet"> نقش</th>
|
||
<th style="font-size: 14px !important" class="sizeSet"> تاریخ ثبت نام </th>
|
||
<th style="font-size: 14px !important; text-align: center; width: 20%">عملیات</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var item in @Model.AdminAccounts.OrderBy(x => x.Id))
|
||
{
|
||
|
||
<tr>
|
||
<td style="font-size: 14px !important; text-align: center">@i</td>
|
||
<td style="text-align: center">
|
||
@if (!string.IsNullOrWhiteSpace(@item.ProfilePhoto))
|
||
{
|
||
<img src="~/ProductPictures/@item.ProfilePhoto" style="width: 60px; height: 60px; border-radius: 30px">
|
||
}
|
||
|
||
</td>
|
||
<td style="font-family: 'Web_Yekan' !important; font-size: 14px; text-align: center">@item.Fullname</td>
|
||
<td style="font-family: 'Web_Yekan' !important; font-size: 14px; text-align: center">@item.Username</td>
|
||
@*<td style="font-family: 'IranText' !important; font-size: 16px !important">@item.Mobile</td>*@
|
||
<td style="font-family: 'Web_yekan' !important; font-size: 14px; text-align: center">@item.Role</td>
|
||
<td style="font-family: 'IranText' !important; font-size: 14px; text-align: center">@item.CreationDate</td>
|
||
@{
|
||
i++;
|
||
}
|
||
<td>
|
||
|
||
<a class="btn btn-info pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { Id = item.Id })">
|
||
<i class="fa fa-key faSize"></i> تغییر گذرواژه
|
||
</a>
|
||
<a class="btn btn-warning pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "Edit", new { Id = item.Id })">
|
||
<i class="fa fa-edit faSize"></i>
|
||
</a>
|
||
<a class="btn btn-success pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "AccountWorkshop", new { item.Id })">
|
||
<i class="fa fa-edit faSize"></i>
|
||
</a>
|
||
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
|
||
{
|
||
<a onclick="deActive(@item.Id,'@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red"> <i class="fa faSize fa-trash"></i></a>
|
||
}
|
||
else if (item.IsActiveString == "false")
|
||
{
|
||
<a onclick="Active(@item.Id,'@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red"> <i class="fa faSize fa-rotate-left"></i></a>
|
||
}
|
||
</td>
|
||
|
||
</tr>
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
@*==================================================================roles=====*@
|
||
<div class="tab-pane @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " id="profile-21" permission="30605">
|
||
|
||
|
||
|
||
|
||
|
||
<div class="row" id="ProductCategoriesDiv">
|
||
<div class="col-md-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
<h3 class="panel-title" style="padding: 10px 12px !important"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست نقش ها </h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="row">
|
||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||
<div style="overflow-x: auto; padding: 0 10px;">
|
||
<table id="datatable2" class="table table-striped table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th style="font-size: 14px !important" class="sizeSet">#</th>
|
||
|
||
<th style="font-size: 14px !important" class="sizeSet">نام</th>
|
||
|
||
|
||
<th style="font-size: 14px !important" class="sizeSet"> تاریخ ثبت </th>
|
||
<th style="font-size: 14px !important; text-align: center; width: 20%">عملیات</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var items in Model.Roless)
|
||
{
|
||
|
||
<tr>
|
||
<td style="font-size: 14px !important; text-align: center">@r</td>
|
||
|
||
<td style="font-family: 'Web_Yekan' !important; font-size: 14px; text-align: center">@items.Name</td>
|
||
|
||
<td style="font-family: 'IranText' !important; font-size: 14px; text-align: center">@items.CreationDate</td>
|
||
|
||
@{
|
||
r++;
|
||
}
|
||
<td>
|
||
<a class="btn btn-warning pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "EditRole", new { Id = items.Id })">
|
||
<i class="fa fa-edit faSize"></i>
|
||
</a>
|
||
|
||
</td>
|
||
|
||
</tr>
|
||
}
|
||
|
||
|
||
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
@*==================================================================Clientusers=====*@
|
||
<div class="tab-pane @(permissionList.All(x => x != 30604) ? "active" : "")" id="Client-21" permission="30603">
|
||
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
<h3 class="panel-title" style="padding: 10px 12px !important"><i class="fa fa-search" style="padding-left: 3px; font-size: 14px"></i> جستجو در کاربران</h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<form class="form-inline" role="form" method="get">
|
||
<div class="form-group col-lg-12">
|
||
<div class="row">
|
||
<div class="col-lg-3 pull-right">
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Fullname"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Fullname" placeholder="نام ">
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Username"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Username" placeholder="نام کاربری ">
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.Mobile"></label>
|
||
<input style="width: 100%" class="form-control" asp-for="SearchModel.Mobile" placeholder="شماره تماس">
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
|
||
<div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.RoleId"></label>
|
||
<select style="width: 100%" class="form-control" asp-for="SearchModel.RoleId" asp-items="Model.Roles">
|
||
<option value="0"> نقش</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="row" style="margin-top: 15px">
|
||
<div class="col-md-3">
|
||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px"> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
|
||
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
|
||
</div>
|
||
|
||
|
||
<div class="col-md-9">
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" id="ProductCategoriesDiv">
|
||
<div class="col-md-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
<h3 class="panel-title" style="padding: 10px 12px !important"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست کاربران </h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="row">
|
||
<div class="colc12 col-xs-12">
|
||
<div style="overflow-x: auto; padding: 0 10px;">
|
||
<table id="datatable" class="table table-striped table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th style="font-size: 14px !important" class="sizeSet">#</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">عکس</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">نام</th>
|
||
<th style="font-size: 14px !important" class="sizeSet">نام کاربری</th>
|
||
@*<th> شماره تماس</th>*@
|
||
<th style="font-size: 14px !important" class="sizeSet"> نقش</th>
|
||
<th style="font-size: 14px !important" class="sizeSet"> تاریخ ثبت نام </th>
|
||
<th style="font-size: 14px !important; text-align: center; width: 20%">عملیات</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var item in @Model.ClientAccounts.OrderBy(x => x.Id))
|
||
{
|
||
|
||
<tr>
|
||
<td style="font-size: 14px !important; text-align: center">@j</td>
|
||
<td style="text-align: center">
|
||
@if (!string.IsNullOrWhiteSpace(@item.ProfilePhoto))
|
||
{
|
||
<img src="~/ProductPictures/@item.ProfilePhoto" style="width: 60px; height: 60px; border-radius: 30px">
|
||
}
|
||
</td>
|
||
<td style="font-family: 'Web_Yekan' !important; font-size: 14px; text-align: center">@item.Fullname</td>
|
||
<td style="font-family: 'Web_Yekan' !important; font-size: 14px; text-align: center">@item.Username</td>
|
||
@*<td style="font-family: 'IranText' !important; font-size: 16px !important">@item.Mobile</td>*@
|
||
<td style="font-family: 'Web_yekan' !important; font-size: 14px; text-align: center">@item.Role</td>
|
||
<td style="font-family: 'IranText' !important; font-size: 14px; text-align: center">@item.CreationDate</td>
|
||
@{
|
||
j++;
|
||
}
|
||
<td>
|
||
<a permission="3060301" class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
|
||
<i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span>
|
||
</a>
|
||
<a permission="3060302" class="btn btn-info pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })">
|
||
<i class="fa fa-key faSize"></i>
|
||
</a>
|
||
<a permission="3060303" class="btn btn-warning pull-right m-rl-5 red"
|
||
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
|
||
<i class="fa fa-edit faSize"></i>
|
||
</a>
|
||
|
||
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
|
||
{
|
||
<a permission="3060304" onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
|
||
<i class="fa faSize fa-trash"></i>
|
||
</a>
|
||
}
|
||
else if (item.IsActiveString == "false")
|
||
{
|
||
<a permission="3060304" onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
|
||
<i class="fa faSize fa-rotate-left"></i>
|
||
</a>
|
||
}
|
||
|
||
</td>
|
||
|
||
</tr>
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
@section Script {
|
||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||
<script src="~/js/signalr/dist/browser/signalr.js"></script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
$('#datatable').dataTable({
|
||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||
});
|
||
|
||
});
|
||
function directLogin(id) {
|
||
|
||
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "LoginToClient")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function (response) {
|
||
if (response.isSuccess) {
|
||
window.location.href = "/Client";
|
||
} else {
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطا در ورود به اکانت");
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
</script>
|
||
|
||
<script>
|
||
$(document).ready(function() {
|
||
$('#datatable2').dataTable(
|
||
{
|
||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||
});
|
||
});
|
||
</script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
$('#datatable3').dataTable(
|
||
{
|
||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||
});
|
||
});
|
||
</script>
|
||
<script>
|
||
$("#myTab a").click(function(e) {
|
||
e.preventDefault();
|
||
$(this).tab('show');
|
||
|
||
});
|
||
|
||
$("#myTab2 a").click(function(e) {
|
||
e.preventDefault();
|
||
$(this).tab('show');
|
||
|
||
});
|
||
$("#myTab3 a").click(function(e) {
|
||
e.preventDefault();
|
||
$(this).tab('show');
|
||
|
||
|
||
});
|
||
// store the currently selected tab in the hash value
|
||
$("ul.nav-tabs > li > a").on("shown.bs.tab",
|
||
function(e) {
|
||
var id = $(e.target).attr("href").substr(1);
|
||
window.location.hash = id;
|
||
});
|
||
|
||
// on load of the page: switch to the currently selected tab
|
||
var hash = window.location.hash;
|
||
$('#myTab a[href="' + hash + '"]').tab('show', 'active');
|
||
var hash2 = window.location.hash;
|
||
$('#myTab2 a[href="' + hash2 + '"]').tab('show', 'active');
|
||
|
||
var hash2 = window.location.hash;
|
||
$('#myTab2 a[href="' + hash2 + '"]').tab('show', 'active');
|
||
$('.activer').on('change',
|
||
function(e) {
|
||
e.preventDefault();
|
||
$('.search').click();
|
||
|
||
});
|
||
|
||
function deActive(id, accountName) {
|
||
|
||
let alarm = 'آیا از غیرفعال کردن ' + accountName + ' اطمینان دارید؟ ' + ' ';
|
||
swal({
|
||
title: alarm,
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
closeOnCancel: true
|
||
},
|
||
function(isConfirm) {
|
||
if (isConfirm) {
|
||
deActiveAjax(id);
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
function deActiveAjax(id) {
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'GET',
|
||
url: '@Url.Page("./Index", "DeActive")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function(response) {
|
||
if (response.isSuccedded) {
|
||
window.location.reload();
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
function Active(id, accountName) {
|
||
|
||
let alarm = 'آیا از غیرفعال کردن ' + accountName + ' اطمینان دارید؟ ' + ' ';
|
||
swal({
|
||
title: alarm,
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
closeOnCancel: true
|
||
},
|
||
function(isConfirm) {
|
||
if (isConfirm) {
|
||
ActiveAjax(id);
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function ActiveAjax(id) {
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'GET',
|
||
url: '@Url.Page("./Index", "Active")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function(response) {
|
||
if (response.isSuccedded) {
|
||
window.location.reload();
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
</script>
|
||
|
||
<script>
|
||
$(document).ready(function() {
|
||
var currentUser = Number($('#userID').val());
|
||
console.log(currentUser);
|
||
setTimeout(function() {
|
||
connectToGroup(currentUser);
|
||
|
||
},
|
||
2000);
|
||
});
|
||
|
||
|
||
var connection = new signalR.HubConnectionBuilder().withUrl("/trackingSmsHub").build();
|
||
|
||
|
||
connection.start().then(function() {
|
||
console.log("connect.....!");
|
||
}).catch(function(err) {
|
||
return console.error(err.toString());
|
||
});
|
||
|
||
function connectToGroup(id) {
|
||
connection.invoke("send", id)
|
||
.catch(function(err) {
|
||
console.error(err.toString());
|
||
});
|
||
console.log("connected to group..." + id);
|
||
|
||
}
|
||
|
||
connection.on('showStatus',
|
||
function(percent) {
|
||
|
||
$('#progress-bar-w').css("width", percent + "%");
|
||
$('#progress-bar-w').text(percent + '%');
|
||
});
|
||
$("#sendSms").on("click",
|
||
function() {
|
||
|
||
$('#createProcess').show();
|
||
|
||
|
||
$.ajax({
|
||
// async: false,
|
||
dataType: 'json',
|
||
type: 'GET',
|
||
url: '@Url.Page("./Index", "SendAccountSms")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
success: function(response) {
|
||
if (response.isSuccess) {
|
||
$('#createProcess').hide();
|
||
} else {
|
||
let mess ="خطا" + " : " + "تعداد" + "("+ response.contractCount + ")" + "مورد انجام نشد";
|
||
$("#errSend").append(`<p class="text-danger">${mess}</p>`);
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
</script>
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
|