наш, сибирский выродок
This commit is contained in:
parent
d6d5f8f4cc
commit
eb41593cd8
@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDataModels", "
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplement", "TravelCompanyDatabaseImplement\TravelCompanyDatabaseImplement.csproj", "{7625604D-02E5-4833-86BC-5CC0731A7DFD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyGuarantorApp", "TravelCompanyGuarantorApp\TravelCompanyGuarantorApp.csproj", "{2E404520-3DDA-479A-B832-8E6F00B54D19}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyWebApp", "TravelCompanyWebApp\TravelCompanyWebApp.csproj", "{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -91,18 +91,18 @@ Global
|
||||
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Release|x64.Build.0 = Release|Any CPU
|
||||
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Release|x86.Build.0 = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|x64.Build.0 = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|x86.Build.0 = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{1EBA3F5C-2FB8-4C6A-997B-E1D18793D86F}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -0,0 +1,8 @@
|
||||
namespace TravelAgencyContracts.ViewModels
|
||||
{
|
||||
public class ReportPlaceTourViewModel
|
||||
{
|
||||
public string TourName { get; set; } = string.Empty;
|
||||
public List<string> Places { get; set; } = new();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace TravelAgencyContracts.ViewModels
|
||||
{
|
||||
public class ReportTourPeriodViewModel
|
||||
{
|
||||
public string TourName { get; set; } = string.Empty;
|
||||
public List<string> ExcursionGroups { get; set; } = new();
|
||||
public List<string> Guides { get; set; } = new();
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
|
||||
|
||||
namespace TravelCompanGuarantorApp.Controllers
|
||||
{
|
||||
public class APIUser
|
||||
{
|
||||
private static readonly HttpClient _user = new();
|
||||
|
||||
public static GuarantorViewModel? User { get; set; } = null;
|
||||
|
||||
public static void Connect(IConfiguration configuration)
|
||||
{
|
||||
_user.BaseAddress = new Uri(configuration["IPAddress"]);
|
||||
_user.DefaultRequestHeaders.Accept.Clear();
|
||||
_user.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||
}
|
||||
|
||||
public static T? GetRequest<T>(string requestUrl)
|
||||
{
|
||||
var response = _user.GetAsync(requestUrl);
|
||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||
if (response.Result.IsSuccessStatusCode)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(result);
|
||||
}
|
||||
}
|
||||
|
||||
public static void PostRequest<T>(string requestUrl, T model)
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(model);
|
||||
var data = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var response = _user.PostAsync(requestUrl, data);
|
||||
|
||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||
if (!response.Result.IsSuccessStatusCode)
|
||||
{
|
||||
throw new Exception(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
using TravelCompanGuarantorApp.Models;
|
||||
using TravelCompanyContracts.BindingModels;
|
||||
using TravelCompanyContracts.ViewModels;
|
||||
using TravelCompanGuarantorApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics;
|
||||
using TravelCompanyContracts.BindingModels.Guarantor;
|
||||
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
|
||||
|
||||
namespace TravelCompanGuarantorApp.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ILogger<HomeController> _logger;
|
||||
|
||||
public HomeController(ILogger<HomeController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
if (APIUser.User == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View(/*APIUser.GetRequest<List<OrderViewModel>>($"api/main/getorders?userId={APIUser.User.Id}")*/);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Privacy()
|
||||
{
|
||||
if (APIUser.User == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View(APIUser.User);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Privacy(string login, string password, string email)
|
||||
{
|
||||
if (APIUser.User == null)
|
||||
{
|
||||
throw new Exception("Вход только авторизованным");
|
||||
}
|
||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new Exception("Введите почту и пароль");
|
||||
}
|
||||
APIUser.PostRequest("api/user/updatedata", new GuarantorBindingModel
|
||||
{
|
||||
Id = APIUser.User.Id,
|
||||
Password = password,
|
||||
Email = email
|
||||
});
|
||||
|
||||
APIUser.User.Password = password;
|
||||
APIUser.User.Email = email;
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Enter()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Enter(string login, string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
||||
{
|
||||
throw new Exception("Введите логин и пароль");
|
||||
}
|
||||
APIUser.User = APIUser.GetRequest<GuarantorViewModel>($"api/user/loginimplementer?login={login}&password={password}");
|
||||
if (APIUser.User == null)
|
||||
{
|
||||
throw new Exception("Неверный логин/пароль");
|
||||
}
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Register()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Register(string login, string password, string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new Exception("Введите почту и пароль");
|
||||
}
|
||||
APIUser.PostRequest("api/user/registerimplementer", new GuarantorBindingModel
|
||||
{
|
||||
Password = password,
|
||||
Email = email
|
||||
});
|
||||
Response.Redirect("Enter");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace TravelCompanGuarantorApp.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
@ -1,53 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - GarmentFactoryClientApp</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">"Ты ж программист"</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Заказы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2024 - Сайт турфирмы "Иван Сусанин" для поручителя - <a asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,3 +0,0 @@
|
||||
@using TravelCompanyGuarantorApp
|
||||
@using TravelCompanyGuarantorApp.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
114
TravelCompany/TravelCompanyWebApp/Controllers/HomeController.cs
Normal file
114
TravelCompany/TravelCompanyWebApp/Controllers/HomeController.cs
Normal file
@ -0,0 +1,114 @@
|
||||
using TravelCompanyContracts.BindingModels;
|
||||
using TravelCompanyContracts.BindingModels.Guarantor;
|
||||
using TravelCompanyContracts.BindingModels.Contractor;
|
||||
using TravelCompanyContracts.ViewModels.Contractor;
|
||||
using TravelCompanyContracts.ViewModels.Guarantor;
|
||||
using TravelCompanyWebApp.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics;
|
||||
using TravelCompanyContracts.ViewModels.Contractor.ViewModels;
|
||||
using TravelAgencyContracts.ViewModels;
|
||||
|
||||
namespace TravelCompanyWebApp.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ILogger<HomeController> _logger;
|
||||
|
||||
public HomeController(ILogger<HomeController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Privacy()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Enter()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Register()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Excursions()
|
||||
{
|
||||
return View(new List<ExcursionViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult ExcursionGroups()
|
||||
{
|
||||
return View(new List<ExcursionGroupViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult Tours()
|
||||
{
|
||||
return View(new List<TourViewModel>());
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult CreateTour()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreateExcursion()
|
||||
{
|
||||
return View(new List<TourViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreateExcursionGroup()
|
||||
{
|
||||
return View(new List<TourViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult UpdateTour()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult UpdateExcursion()
|
||||
{
|
||||
return View(new List<TourViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult UpdateExcursionGroup()
|
||||
{
|
||||
return View(new List<TourViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult ReportMenu()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult ReportPlaceTour()
|
||||
{
|
||||
return View(new List<ReportPlaceTourViewModel>());
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult ReportTourPeriod()
|
||||
{
|
||||
return View(new List<ReportTourPeriodViewModel>());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace TravelCompanyWebApp.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
@ -1,14 +1,7 @@
|
||||
using TravelCompanGuarantorApp.Controllers;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
APIUser.Connect(builder.Configuration);
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
@ -16,17 +9,11 @@ if (!app.Environment.IsDevelopment())
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
app.Run();
|
||||
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
app.Run();
|
@ -3,16 +3,16 @@
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:34894",
|
||||
"sslPort": 44330
|
||||
"applicationUrl": "http://localhost:13126",
|
||||
"sslPort": 44334
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"ComputerShopImplementerApp": {
|
||||
"TravelAgencyWebApp": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7049;http://localhost:5024",
|
||||
"applicationUrl": "https://localhost:7180;http://localhost:5032",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
@ -0,0 +1,47 @@
|
||||
@using TravelCompanyContracts.ViewModels.Contractor.ViewModels
|
||||
|
||||
@model List<TourViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Create excursion";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Создание экскурсии</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="excursionname" id="excursionname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Описание:</div>
|
||||
<div class="col-8"><input type="text" name="description" id="description" /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div>Туры</div>
|
||||
<div class="table-responsive-lg">
|
||||
<table id="tourstable" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Выбор</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<input type="checkbox" name="tourcheckbox" value="@tour.Id" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,53 @@
|
||||
@using TravelCompanyContracts.ViewModels.Contractor.ViewModels
|
||||
|
||||
@model List<TourViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Create excursion group";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Создание экскурсионной группы</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="excursionname" id="excursionname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Количество участников:</div>
|
||||
<div class="col-8"><input type="text" name="participants" id="participants" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Гид:</div>
|
||||
<div class="col-8">
|
||||
<select id="guide" name="guide" class="form-control" asp-items="@(new SelectList(@ViewBag.Guides,"Id", "GuideFIO"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div>Туры</div>
|
||||
<div class="table-responsive-lg">
|
||||
<table id="tourstable" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Выбор</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<input type="checkbox" name="tourcheckbox" value="@tour.Id" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,20 @@
|
||||
@{
|
||||
ViewData["Title"] = "Create tour";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Создание тура</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="tourname" id="tourname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Дата тура:</div>
|
||||
<div class="col-8"><input type="date" name="tourdate" id="tourdate" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -18,4 +18,4 @@
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Вход" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
@ -0,0 +1,74 @@
|
||||
@using TravelAgencyContracts.ViewModels
|
||||
|
||||
@model List<ExcursionGroupViewModel>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Excursion groups";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Экскурсионные группы</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
@{
|
||||
if (Model == null)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
|
||||
<p>
|
||||
<a asp-action="CreateExcursionGroup">Создать экскурсионную группу</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Номер
|
||||
</th>
|
||||
<th>
|
||||
Название
|
||||
</th>
|
||||
<th>
|
||||
Описание
|
||||
</th>
|
||||
<th>
|
||||
Цена
|
||||
</th>
|
||||
<th>
|
||||
Гид
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ExcursionGroupName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ParticipantsAmount)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.GuideFIO)
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Изменить</button>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Удалить</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
@ -0,0 +1,68 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<ExcursionViewModel>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Excursions";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Экскурсии</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
@{
|
||||
if (Model == null)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
|
||||
<p>
|
||||
<a asp-action="CreateExcursion">Создать экскурсию</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Номер
|
||||
</th>
|
||||
<th>
|
||||
Название
|
||||
</th>
|
||||
<th>
|
||||
Описание
|
||||
</th>
|
||||
<th>
|
||||
Цена
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ExcursionName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ExcursionPrice)
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Изменить</button>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Удалить</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
@ -0,0 +1,7 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Турфирма «Иван Сусанин»</h1>
|
||||
</div>
|
@ -1,4 +1,4 @@
|
||||
@using TravelCompanyContracts.ViewModels.Guarantor
|
||||
@using TravelAgencyContracts.ViewModels
|
||||
|
||||
@model UserViewModel
|
||||
|
||||
@ -10,21 +10,23 @@
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Логин:</div>
|
||||
<div class="col-8"><input type="text" name="login" value="@Model.Login" /></div>
|
||||
<div class="col-4">Логин(почта):</div>
|
||||
<div class="col-8"><input type="text" name="login" value="@Model.Email" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Пароль:</div>
|
||||
<div class="col-8"><input type="password" name="password" value="@Model.Password" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Почта:</div>
|
||||
<div class="col-8"><input type="text" name="email" value="@Model.Email" /></div>
|
||||
<div class="col-4">Номер телефона:</div>
|
||||
<div class="col-8"><input type="text" name="phone" value="@Model.PhoneNumber" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">ФИО:</div>
|
||||
<div class="col-8"><input type="text" name="fio" value="@Model.UserFIO" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -7,19 +7,31 @@
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Логин:</div>
|
||||
<div class="col-8"><input type="text" name="login" /></div>
|
||||
<div class="col-4">Имя:</div>
|
||||
<div class="col-8"><input type="text" name="name" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Фамилия:</div>
|
||||
<div class="col-8"><input type="text" name="surname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Отчество:</div>
|
||||
<div class="col-8"><input type="text" name="patronymic" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Email:</div>
|
||||
<div class="col-8"><input type="text" name="email" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Пароль:</div>
|
||||
<div class="col-8"><input type="password" name="password" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Почта:</div>
|
||||
<div class="col-8"><input type="text" name="email" /></div>
|
||||
<div class="col-4">Номер телефона:</div>
|
||||
<div class="col-8"><input type="text" name="mobilephone" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Регистрация" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
@ -0,0 +1,18 @@
|
||||
@{
|
||||
ViewData["Title"] = "Report Menu";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Меню создания отчетов</h1>
|
||||
<div class="list-group">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ReportPlaceTour">
|
||||
Отчет мест для
|
||||
посещения по выбранным турам
|
||||
</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ReportTourPeriod">
|
||||
Отчет по турам с
|
||||
расшифровкой по экскурсионным группам и гидам за
|
||||
период
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<ReportPlaceTourViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Places per tour report";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Список мест для посещения по выбранным турам</h1>
|
||||
</div>
|
||||
|
||||
<form asp-controller="Report" method="post">
|
||||
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Word</button>
|
||||
</form>
|
||||
<form asp-controller="Report" method="post">
|
||||
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Excel</button>
|
||||
</form>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">Выберите тур:</div>
|
||||
<div class="col-8">
|
||||
<select id="tour" name="tour" class="form-control" asp-items="@(new SelectList(@ViewBag.Tours,"Id", "TourName"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Тур</th>
|
||||
<th>Место</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var place in tour.Places)
|
||||
{
|
||||
<li>@place</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,65 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<ReportTourPeriodViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Tours time period report";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">
|
||||
Отчет по турам с
|
||||
расшифровкой по экскурсионным группам и гидам за
|
||||
период
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<form asp-controller="Report" method="post">
|
||||
<button type="submit" class="btn btn-primary">Отправить отчет на почту</button>
|
||||
</form>
|
||||
|
||||
<div class="row mb-5">
|
||||
<div class="col-4">Начальная дата:</div>
|
||||
<div class="col-8">
|
||||
<input type="date" id="startDate" name="startDate" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-4">Конечная дата:</div>
|
||||
<div class="col-8">
|
||||
<input type="date" id="endDate" name="endDate" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Тур</th>
|
||||
<th>Экскурсионная группа</th>
|
||||
<th>Гид</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var excursionGroup in tour.ExcursionGroups)
|
||||
{
|
||||
<li>@excursionGroup</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var guide in tour.Guides)
|
||||
{
|
||||
<li>@guide</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
72
TravelCompany/TravelCompanyWebApp/Views/Home/Tours.cshtml
Normal file
72
TravelCompany/TravelCompanyWebApp/Views/Home/Tours.cshtml
Normal file
@ -0,0 +1,72 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<TourViewModel>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Туры</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
@{
|
||||
if (Model == null)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
|
||||
<p>
|
||||
<a asp-action="CreateTour">Создать тур</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Номер
|
||||
</th>
|
||||
<th>
|
||||
Название
|
||||
</th>
|
||||
<th>
|
||||
Описание
|
||||
</th>
|
||||
<th>
|
||||
Цена
|
||||
</th>
|
||||
<th>
|
||||
Дата тура
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.TourName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.TourDate)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Изменить</button>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary">Удалить</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
@ -0,0 +1,51 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<TourViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Update excursion";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Редактирование экскурсии</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="excursionname" id="excursionname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Описание:</div>
|
||||
<div class="col-8"><input type="text" name="description" id="description" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Цена:</div>
|
||||
<div class="col-8"><input type="text" id="price" name="price" /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div>Туры</div>
|
||||
<div class="table-responsive-lg">
|
||||
<table id="tourstable" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Выбор</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<input type="checkbox" name="tourcheckbox" value="@tour.Id" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,53 @@
|
||||
@using TravelCompanyContracts.ViewModels
|
||||
|
||||
@model List<TourViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Update excursion group";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Редактирование экскурсионной группы</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="excursionname" id="excursionname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Количество участников:</div>
|
||||
<div class="col-8"><input type="text" name="participants" id="participants" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Гид:</div>
|
||||
<div class="col-8">
|
||||
<select id="guide" name="guide" class="form-control" asp-items="@(new SelectList(@ViewBag.Guides,"Id", "GuideFIO"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div>Туры</div>
|
||||
<div class="table-responsive-lg">
|
||||
<table id="tourstable" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Выбор</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var tour in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@tour.TourName</td>
|
||||
<td>
|
||||
<input type="checkbox" name="tourcheckbox" value="@tour.Id" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,20 @@
|
||||
@{
|
||||
ViewData["Title"] = "Update tour";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Редактирование тура</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="tourname" id="tourname" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Дата тура:</div>
|
||||
<div class="col-8"><input type="date" name="tourdate" id="tourdate" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - TravelAgencyWebApp</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" aspaction="Index">Турфирма «Иван Сусанин»</a>
|
||||
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Вход</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Tours">Туры</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Excursions">Экскурсии</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ExcursionGroups">Экскурсионные группы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ReportMenu">Отчеты</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2024 - Иван Сусанин - <a asp-area="" aspcontroller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,3 @@
|
||||
@using TravelCompanyWebApp
|
||||
@using TravelCompanyWebApp.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@ -5,6 +5,5 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"IPAddress": "http://localhost:5055/"
|
||||
"AllowedHosts": "*"
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
html {
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
html {
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@ -1,9 +1,9 @@
|
||||
/*!
|
||||
* jQuery Validation Plugin v1.17.0
|
||||
* jQuery Validation Plugin v1.19.5
|
||||
*
|
||||
* https://jqueryvalidation.org/
|
||||
*
|
||||
* Copyright (c) 2017 Jörn Zaefferer
|
||||
* Copyright (c) 2022 Jörn Zaefferer
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function( factory ) {
|
||||
@ -43,6 +43,38 @@
|
||||
|
||||
}() );
|
||||
|
||||
/**
|
||||
* This is used in the United States to process payments, deposits,
|
||||
* or transfers using the Automated Clearing House (ACH) or Fedwire
|
||||
* systems. A very common use case would be to validate a form for
|
||||
* an ACH bill payment.
|
||||
*/
|
||||
$.validator.addMethod( "abaRoutingNumber", function( value ) {
|
||||
var checksum = 0;
|
||||
var tokens = value.split( "" );
|
||||
var length = tokens.length;
|
||||
|
||||
// Length Check
|
||||
if ( length !== 9 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calc the checksum
|
||||
// https://en.wikipedia.org/wiki/ABA_routing_transit_number
|
||||
for ( var i = 0; i < length; i += 3 ) {
|
||||
checksum += parseInt( tokens[ i ], 10 ) * 3 +
|
||||
parseInt( tokens[ i + 1 ], 10 ) * 7 +
|
||||
parseInt( tokens[ i + 2 ], 10 );
|
||||
}
|
||||
|
||||
// If not zero and divisible by 10 then valid
|
||||
if ( checksum !== 0 && checksum % 10 === 0 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}, "Please enter a valid routing number." );
|
||||
|
||||
// Accept a value from a file input based on a required mimetype
|
||||
$.validator.addMethod( "accept", function( value, element, param ) {
|
||||
|
||||
@ -87,7 +119,7 @@ $.validator.addMethod( "accept", function( value, element, param ) {
|
||||
|
||||
$.validator.addMethod( "alphanumeric", function( value, element ) {
|
||||
return this.optional( element ) || /^\w+$/i.test( value );
|
||||
}, "Letters, numbers, and underscores only please" );
|
||||
}, "Letters, numbers, and underscores only please." );
|
||||
|
||||
/*
|
||||
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
|
||||
@ -114,13 +146,13 @@ $.validator.addMethod( "bankaccountNL", function( value, element ) {
|
||||
sum = sum + factor * digit;
|
||||
}
|
||||
return sum % 11 === 0;
|
||||
}, "Please specify a valid bank account number" );
|
||||
}, "Please specify a valid bank account number." );
|
||||
|
||||
$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
|
||||
return this.optional( element ) ||
|
||||
( $.validator.methods.bankaccountNL.call( this, value, element ) ) ||
|
||||
( $.validator.methods.giroaccountNL.call( this, value, element ) );
|
||||
}, "Please specify a valid bank or giro account number" );
|
||||
}, "Please specify a valid bank or giro account number." );
|
||||
|
||||
/**
|
||||
* BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
|
||||
@ -139,7 +171,7 @@ $.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
|
||||
*/
|
||||
$.validator.addMethod( "bic", function( value, element ) {
|
||||
return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() );
|
||||
}, "Please specify a valid BIC code" );
|
||||
}, "Please specify a valid BIC code." );
|
||||
|
||||
/*
|
||||
* Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
|
||||
@ -256,11 +288,141 @@ $.validator.addMethod( "cifES", function( value, element ) {
|
||||
|
||||
}, "Please specify a valid CIF number." );
|
||||
|
||||
/*
|
||||
* Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number.
|
||||
* CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
|
||||
*/
|
||||
$.validator.addMethod( "cnhBR", function( value ) {
|
||||
|
||||
// Removing special characters from value
|
||||
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
|
||||
|
||||
// Checking value to have 11 digits only
|
||||
if ( value.length !== 11 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var sum = 0, dsc = 0, firstChar,
|
||||
firstCN, secondCN, i, j, v;
|
||||
|
||||
firstChar = value.charAt( 0 );
|
||||
|
||||
if ( new Array( 12 ).join( firstChar ) === value ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Step 1 - using first Check Number:
|
||||
for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) {
|
||||
sum += +( value.charAt( i ) * j );
|
||||
}
|
||||
|
||||
firstCN = sum % 11;
|
||||
if ( firstCN >= 10 ) {
|
||||
firstCN = 0;
|
||||
dsc = 2;
|
||||
}
|
||||
|
||||
sum = 0;
|
||||
for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) {
|
||||
sum += +( value.charAt( i ) * j );
|
||||
}
|
||||
|
||||
secondCN = sum % 11;
|
||||
if ( secondCN >= 10 ) {
|
||||
secondCN = 0;
|
||||
} else {
|
||||
secondCN = secondCN - dsc;
|
||||
}
|
||||
|
||||
return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) );
|
||||
|
||||
}, "Please specify a valid CNH number." );
|
||||
|
||||
/*
|
||||
* Brazillian value number (Cadastrado de Pessoas Juridica).
|
||||
* value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation.
|
||||
*/
|
||||
$.validator.addMethod( "cnpjBR", function( value, element ) {
|
||||
"use strict";
|
||||
|
||||
if ( this.optional( element ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Removing no number
|
||||
value = value.replace( /[^\d]+/g, "" );
|
||||
|
||||
// Checking value to have 14 digits only
|
||||
if ( value.length !== 14 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Elimina values invalidos conhecidos
|
||||
if ( value === "00000000000000" ||
|
||||
value === "11111111111111" ||
|
||||
value === "22222222222222" ||
|
||||
value === "33333333333333" ||
|
||||
value === "44444444444444" ||
|
||||
value === "55555555555555" ||
|
||||
value === "66666666666666" ||
|
||||
value === "77777777777777" ||
|
||||
value === "88888888888888" ||
|
||||
value === "99999999999999" ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Valida DVs
|
||||
var tamanho = ( value.length - 2 );
|
||||
var numeros = value.substring( 0, tamanho );
|
||||
var digitos = value.substring( tamanho );
|
||||
var soma = 0;
|
||||
var pos = tamanho - 7;
|
||||
|
||||
for ( var i = tamanho; i >= 1; i-- ) {
|
||||
soma += numeros.charAt( tamanho - i ) * pos--;
|
||||
if ( pos < 2 ) {
|
||||
pos = 9;
|
||||
}
|
||||
}
|
||||
|
||||
var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
||||
|
||||
if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
tamanho = tamanho + 1;
|
||||
numeros = value.substring( 0, tamanho );
|
||||
soma = 0;
|
||||
pos = tamanho - 7;
|
||||
|
||||
for ( var il = tamanho; il >= 1; il-- ) {
|
||||
soma += numeros.charAt( tamanho - il ) * pos--;
|
||||
if ( pos < 2 ) {
|
||||
pos = 9;
|
||||
}
|
||||
}
|
||||
|
||||
resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
||||
|
||||
if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}, "Please specify a CNPJ value number." );
|
||||
|
||||
/*
|
||||
* Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number.
|
||||
* CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
|
||||
*/
|
||||
$.validator.addMethod( "cpfBR", function( value ) {
|
||||
$.validator.addMethod( "cpfBR", function( value, element ) {
|
||||
"use strict";
|
||||
|
||||
if ( this.optional( element ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Removing special characters from value
|
||||
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
|
||||
@ -315,7 +477,7 @@ $.validator.addMethod( "cpfBR", function( value ) {
|
||||
}
|
||||
return false;
|
||||
|
||||
}, "Please specify a valid CPF number" );
|
||||
}, "Please specify a valid CPF number." );
|
||||
|
||||
// https://jqueryvalidation.org/creditcard-method/
|
||||
// based on https://en.wikipedia.org/wiki/Luhn_algorithm
|
||||
@ -337,7 +499,7 @@ $.validator.addMethod( "creditcard", function( value, element ) {
|
||||
value = value.replace( /\D/g, "" );
|
||||
|
||||
// Basing min and max length on
|
||||
// https://developer.ean.com/general_info/Valid_Credit_Card_Types
|
||||
// https://dev.ean.com/general-info/valid-card-types/
|
||||
if ( value.length < 13 || value.length > 19 ) {
|
||||
return false;
|
||||
}
|
||||
@ -359,7 +521,7 @@ $.validator.addMethod( "creditcard", function( value, element ) {
|
||||
}, "Please enter a valid credit card number." );
|
||||
|
||||
/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
|
||||
* Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
|
||||
*/
|
||||
$.validator.addMethod( "creditcardtypes", function( value, element, param ) {
|
||||
@ -398,7 +560,7 @@ $.validator.addMethod( "creditcardtypes", function( value, element, param ) {
|
||||
if ( param.all ) {
|
||||
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
|
||||
}
|
||||
if ( validTypes & 0x0001 && /^(5[12345])/.test( value ) ) { // Mastercard
|
||||
if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard
|
||||
return value.length === 16;
|
||||
}
|
||||
if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa
|
||||
@ -468,7 +630,7 @@ $.validator.addMethod( "currency", function( value, element, param ) {
|
||||
regex = new RegExp( regex );
|
||||
return this.optional( element ) || regex.test( value );
|
||||
|
||||
}, "Please specify a valid currency" );
|
||||
}, "Please specify a valid currency." );
|
||||
|
||||
$.validator.addMethod( "dateFA", function( value, element ) {
|
||||
return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value );
|
||||
@ -529,7 +691,31 @@ $.validator.addMethod( "extension", function( value, element, param ) {
|
||||
*/
|
||||
$.validator.addMethod( "giroaccountNL", function( value, element ) {
|
||||
return this.optional( element ) || /^[0-9]{1,7}$/.test( value );
|
||||
}, "Please specify a valid giro account number" );
|
||||
}, "Please specify a valid giro account number." );
|
||||
|
||||
$.validator.addMethod( "greaterThan", function( value, element, param ) {
|
||||
var target = $( param );
|
||||
|
||||
if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) {
|
||||
target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() {
|
||||
$( element ).valid();
|
||||
} );
|
||||
}
|
||||
|
||||
return value > target.val();
|
||||
}, "Please enter a greater value." );
|
||||
|
||||
$.validator.addMethod( "greaterThanEqual", function( value, element, param ) {
|
||||
var target = $( param );
|
||||
|
||||
if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) {
|
||||
target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() {
|
||||
$( element ).valid();
|
||||
} );
|
||||
}
|
||||
|
||||
return value >= target.val();
|
||||
}, "Please enter a greater value." );
|
||||
|
||||
/**
|
||||
* IBAN is the international bank account number.
|
||||
@ -666,11 +852,11 @@ $.validator.addMethod( "iban", function( value, element ) {
|
||||
cRest = cOperator % 97;
|
||||
}
|
||||
return cRest === 1;
|
||||
}, "Please specify a valid IBAN" );
|
||||
}, "Please specify a valid IBAN." );
|
||||
|
||||
$.validator.addMethod( "integer", function( value, element ) {
|
||||
return this.optional( element ) || /^-?\d+$/.test( value );
|
||||
}, "A positive or negative non-decimal number please" );
|
||||
}, "A positive or negative non-decimal number please." );
|
||||
|
||||
$.validator.addMethod( "ipv4", function( value, element ) {
|
||||
return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value );
|
||||
@ -680,17 +866,103 @@ $.validator.addMethod( "ipv6", function( value, element ) {
|
||||
return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value );
|
||||
}, "Please enter a valid IP v6 address." );
|
||||
|
||||
$.validator.addMethod( "lessThan", function( value, element, param ) {
|
||||
var target = $( param );
|
||||
|
||||
if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) {
|
||||
target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() {
|
||||
$( element ).valid();
|
||||
} );
|
||||
}
|
||||
|
||||
return value < target.val();
|
||||
}, "Please enter a lesser value." );
|
||||
|
||||
$.validator.addMethod( "lessThanEqual", function( value, element, param ) {
|
||||
var target = $( param );
|
||||
|
||||
if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) {
|
||||
target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() {
|
||||
$( element ).valid();
|
||||
} );
|
||||
}
|
||||
|
||||
return value <= target.val();
|
||||
}, "Please enter a lesser value." );
|
||||
|
||||
$.validator.addMethod( "lettersonly", function( value, element ) {
|
||||
return this.optional( element ) || /^[a-z]+$/i.test( value );
|
||||
}, "Letters only please" );
|
||||
}, "Letters only please." );
|
||||
|
||||
$.validator.addMethod( "letterswithbasicpunc", function( value, element ) {
|
||||
return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value );
|
||||
}, "Letters or punctuation only please" );
|
||||
}, "Letters or punctuation only please." );
|
||||
|
||||
// Limit the number of files in a FileList.
|
||||
$.validator.addMethod( "maxfiles", function( value, element, param ) {
|
||||
if ( this.optional( element ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( $( element ).attr( "type" ) === "file" ) {
|
||||
if ( element.files && element.files.length > param ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}, $.validator.format( "Please select no more than {0} files." ) );
|
||||
|
||||
// Limit the size of each individual file in a FileList.
|
||||
$.validator.addMethod( "maxsize", function( value, element, param ) {
|
||||
if ( this.optional( element ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( $( element ).attr( "type" ) === "file" ) {
|
||||
if ( element.files && element.files.length ) {
|
||||
for ( var i = 0; i < element.files.length; i++ ) {
|
||||
if ( element.files[ i ].size > param ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}, $.validator.format( "File size must not exceed {0} bytes each." ) );
|
||||
|
||||
// Limit the size of all files in a FileList.
|
||||
$.validator.addMethod( "maxsizetotal", function( value, element, param ) {
|
||||
if ( this.optional( element ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( $( element ).attr( "type" ) === "file" ) {
|
||||
if ( element.files && element.files.length ) {
|
||||
var totalSize = 0;
|
||||
|
||||
for ( var i = 0; i < element.files.length; i++ ) {
|
||||
totalSize += element.files[ i ].size;
|
||||
if ( totalSize > param ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}, $.validator.format( "Total size of all files must not exceed {0} bytes." ) );
|
||||
|
||||
|
||||
$.validator.addMethod( "mobileNL", function( value, element ) {
|
||||
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
|
||||
}, "Please specify a valid mobile number" );
|
||||
}, "Please specify a valid mobile number." );
|
||||
|
||||
$.validator.addMethod( "mobileRU", function( phone_number, element ) {
|
||||
var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
|
||||
return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number );
|
||||
}, "Please specify a valid mobile number." );
|
||||
|
||||
/* For UK phone functions, do the following server side processing:
|
||||
* Compare original input with this RegEx pattern:
|
||||
@ -704,7 +976,7 @@ $.validator.addMethod( "mobileUK", function( phone_number, element ) {
|
||||
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
|
||||
return this.optional( element ) || phone_number.length > 9 &&
|
||||
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ );
|
||||
}, "Please specify a valid mobile number" );
|
||||
}, "Please specify a valid mobile number." );
|
||||
|
||||
$.validator.addMethod( "netmask", function( value, element ) {
|
||||
return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value );
|
||||
@ -804,13 +1076,71 @@ $.validator.addMethod( "nipPL", function( value ) {
|
||||
return ( intControlNr === parseInt( value[ 9 ], 10 ) );
|
||||
}, "Please specify a valid NIP number." );
|
||||
|
||||
/**
|
||||
* Created for project jquery-validation.
|
||||
* @Description Brazillian PIS or NIS number (Número de Identificação Social Pis ou Pasep) is the equivalent of a
|
||||
* Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers
|
||||
* that are being used for validation.
|
||||
* @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendonça
|
||||
* @author Cleiton da Silva Mendonça <cleiton.mendonca@gmail.com>
|
||||
* @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendonça
|
||||
* @link http://github.com/csmendonca Github of Cleiton da Silva Mendonça
|
||||
*/
|
||||
$.validator.addMethod( "nisBR", function( value ) {
|
||||
var number;
|
||||
var cn;
|
||||
var sum = 0;
|
||||
var dv;
|
||||
var count;
|
||||
var multiplier;
|
||||
|
||||
// Removing special characters from value
|
||||
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
|
||||
|
||||
// Checking value to have 11 digits only
|
||||
if ( value.length !== 11 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Get check number of value
|
||||
cn = parseInt( value.substring( 10, 11 ), 10 );
|
||||
|
||||
//Get number with 10 digits of the value
|
||||
number = parseInt( value.substring( 0, 10 ), 10 );
|
||||
|
||||
for ( count = 2; count < 12; count++ ) {
|
||||
multiplier = count;
|
||||
if ( count === 10 ) {
|
||||
multiplier = 2;
|
||||
}
|
||||
if ( count === 11 ) {
|
||||
multiplier = 3;
|
||||
}
|
||||
sum += ( ( number % 10 ) * multiplier );
|
||||
number = parseInt( number / 10, 10 );
|
||||
}
|
||||
dv = ( sum % 11 );
|
||||
|
||||
if ( dv > 1 ) {
|
||||
dv = ( 11 - dv );
|
||||
} else {
|
||||
dv = 0;
|
||||
}
|
||||
|
||||
if ( cn === dv ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}, "Please specify a valid NIS/PIS number." );
|
||||
|
||||
$.validator.addMethod( "notEqualTo", function( value, element, param ) {
|
||||
return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param );
|
||||
}, "Please enter a different value, values must not be the same." );
|
||||
|
||||
$.validator.addMethod( "nowhitespace", function( value, element ) {
|
||||
return this.optional( element ) || /^\S+$/i.test( value );
|
||||
}, "No white space please" );
|
||||
}, "No white space please." );
|
||||
|
||||
/**
|
||||
* Return true if the field value matches the given format RegExp
|
||||
@ -842,6 +1172,30 @@ $.validator.addMethod( "phoneNL", function( value, element ) {
|
||||
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
|
||||
}, "Please specify a valid phone number." );
|
||||
|
||||
/**
|
||||
* Polish telephone numbers have 9 digits.
|
||||
*
|
||||
* Mobile phone numbers starts with following digits:
|
||||
* 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88.
|
||||
*
|
||||
* Fixed-line numbers starts with area codes:
|
||||
* 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33,
|
||||
* 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61,
|
||||
* 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84,
|
||||
* 85, 86, 87, 89, 91, 94, 95.
|
||||
*
|
||||
* Ministry of National Defence numbers and VoIP numbers starts with 26 and 39.
|
||||
*
|
||||
* Excludes intelligent networks (premium rate, shared cost, free phone numbers).
|
||||
*
|
||||
* Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en
|
||||
*/
|
||||
$.validator.addMethod( "phonePL", function( phone_number, element ) {
|
||||
phone_number = phone_number.replace( /\s+/g, "" );
|
||||
var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
|
||||
return this.optional( element ) || regexp.test( phone_number );
|
||||
}, "Please specify a valid phone number." );
|
||||
|
||||
/* For UK phone functions, do the following server side processing:
|
||||
* Compare original input with this RegEx pattern:
|
||||
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
|
||||
@ -856,7 +1210,7 @@ $.validator.addMethod( "phonesUK", function( phone_number, element ) {
|
||||
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
|
||||
return this.optional( element ) || phone_number.length > 9 &&
|
||||
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ );
|
||||
}, "Please specify a valid uk phone number" );
|
||||
}, "Please specify a valid uk phone number." );
|
||||
|
||||
/* For UK phone functions, do the following server side processing:
|
||||
* Compare original input with this RegEx pattern:
|
||||
@ -870,7 +1224,7 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) {
|
||||
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
|
||||
return this.optional( element ) || phone_number.length > 9 &&
|
||||
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ );
|
||||
}, "Please specify a valid phone number" );
|
||||
}, "Please specify a valid phone number." );
|
||||
|
||||
/**
|
||||
* Matches US phone number format
|
||||
@ -891,8 +1245,8 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) {
|
||||
$.validator.addMethod( "phoneUS", function( phone_number, element ) {
|
||||
phone_number = phone_number.replace( /\s+/g, "" );
|
||||
return this.optional( element ) || phone_number.length > 9 &&
|
||||
phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/ );
|
||||
}, "Please specify a valid phone number" );
|
||||
phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ );
|
||||
}, "Please specify a valid phone number." );
|
||||
|
||||
/*
|
||||
* Valida CEPs do brasileiros:
|
||||
@ -921,21 +1275,21 @@ $.validator.addMethod( "postalcodeBR", function( cep_value, element ) {
|
||||
*/
|
||||
$.validator.addMethod( "postalCodeCA", function( value, element ) {
|
||||
return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value );
|
||||
}, "Please specify a valid postal code" );
|
||||
}, "Please specify a valid postal code." );
|
||||
|
||||
/* Matches Italian postcode (CAP) */
|
||||
$.validator.addMethod( "postalcodeIT", function( value, element ) {
|
||||
return this.optional( element ) || /^\d{5}$/.test( value );
|
||||
}, "Please specify a valid postal code" );
|
||||
}, "Please specify a valid postal code." );
|
||||
|
||||
$.validator.addMethod( "postalcodeNL", function( value, element ) {
|
||||
return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value );
|
||||
}, "Please specify a valid postal code" );
|
||||
}, "Please specify a valid postal code." );
|
||||
|
||||
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
|
||||
$.validator.addMethod( "postcodeUK", function( value, element ) {
|
||||
return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
|
||||
}, "Please specify a valid UK postcode" );
|
||||
}, "Please specify a valid UK postcode." );
|
||||
|
||||
/*
|
||||
* Lets you say "at least X inputs that match selector Y must be filled."
|
||||
@ -1072,24 +1426,24 @@ $.validator.addMethod( "stateUS", function( value, element, options ) {
|
||||
|
||||
regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" );
|
||||
return this.optional( element ) || regex.test( value );
|
||||
}, "Please specify a valid state" );
|
||||
}, "Please specify a valid state." );
|
||||
|
||||
// TODO check if value starts with <, otherwise don't try stripping anything
|
||||
$.validator.addMethod( "strippedminlength", function( value, element, param ) {
|
||||
return $( value ).text().length >= param;
|
||||
}, $.validator.format( "Please enter at least {0} characters" ) );
|
||||
}, $.validator.format( "Please enter at least {0} characters." ) );
|
||||
|
||||
$.validator.addMethod( "time", function( value, element ) {
|
||||
return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value );
|
||||
}, "Please enter a valid time, between 00:00 and 23:59" );
|
||||
}, "Please enter a valid time, between 00:00 and 23:59." );
|
||||
|
||||
$.validator.addMethod( "time12h", function( value, element ) {
|
||||
return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
|
||||
}, "Please enter a valid time in 12-hour am/pm format" );
|
||||
}, "Please enter a valid time in 12-hour am/pm format." );
|
||||
|
||||
// Same as url, but TLD is optional
|
||||
$.validator.addMethod( "url2", function( value, element ) {
|
||||
return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value );
|
||||
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
|
||||
}, $.validator.messages.url );
|
||||
|
||||
/**
|
||||
@ -1149,10 +1503,10 @@ $.validator.addMethod( "vinUS", function( v ) {
|
||||
|
||||
$.validator.addMethod( "zipcodeUS", function( value, element ) {
|
||||
return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value );
|
||||
}, "The specified US ZIP Code is invalid" );
|
||||
}, "The specified US ZIP Code is invalid." );
|
||||
|
||||
$.validator.addMethod( "ziprange", function( value, element ) {
|
||||
return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value );
|
||||
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" );
|
||||
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx." );
|
||||
return $;
|
||||
}));
|
File diff suppressed because one or more lines are too long
@ -1,9 +1,9 @@
|
||||
/*!
|
||||
* jQuery Validation Plugin v1.17.0
|
||||
* jQuery Validation Plugin v1.19.5
|
||||
*
|
||||
* https://jqueryvalidation.org/
|
||||
*
|
||||
* Copyright (c) 2017 Jörn Zaefferer
|
||||
* Copyright (c) 2022 Jörn Zaefferer
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function( factory ) {
|
||||
@ -67,6 +67,7 @@ $.extend( $.fn, {
|
||||
// Prevent form submit to be able to see console output
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
function handle() {
|
||||
var hidden, result;
|
||||
|
||||
@ -82,7 +83,7 @@ $.extend( $.fn, {
|
||||
.appendTo( validator.currentForm );
|
||||
}
|
||||
|
||||
if ( validator.settings.submitHandler ) {
|
||||
if ( validator.settings.submitHandler && !validator.settings.debug ) {
|
||||
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
|
||||
if ( hidden ) {
|
||||
|
||||
@ -142,6 +143,7 @@ $.extend( $.fn, {
|
||||
// https://jqueryvalidation.org/rules/
|
||||
rules: function( command, argument ) {
|
||||
var element = this[ 0 ],
|
||||
isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false",
|
||||
settings, staticRules, existingRules, data, param, filtered;
|
||||
|
||||
// If nothing is selected, return empty object; can't chain anyway
|
||||
@ -149,7 +151,7 @@ $.extend( $.fn, {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !element.form && element.hasAttribute( "contenteditable" ) ) {
|
||||
if ( !element.form && isContentEditable ) {
|
||||
element.form = this.closest( "form" )[ 0 ];
|
||||
element.name = this.attr( "name" );
|
||||
}
|
||||
@ -214,18 +216,25 @@ $.extend( $.fn, {
|
||||
}
|
||||
} );
|
||||
|
||||
// JQuery trim is deprecated, provide a trim method based on String.prototype.trim
|
||||
var trim = function( str ) {
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill
|
||||
return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" );
|
||||
};
|
||||
|
||||
// Custom selectors
|
||||
$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
|
||||
|
||||
// https://jqueryvalidation.org/blank-selector/
|
||||
blank: function( a ) {
|
||||
return !$.trim( "" + $( a ).val() );
|
||||
return !trim( "" + $( a ).val() );
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/filled-selector/
|
||||
filled: function( a ) {
|
||||
var val = $( a ).val();
|
||||
return val !== null && !!$.trim( "" + val );
|
||||
return val !== null && !!trim( "" + val );
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/unchecked-selector/
|
||||
@ -393,7 +402,8 @@ $.extend( $.validator, {
|
||||
this.invalid = {};
|
||||
this.reset();
|
||||
|
||||
var groups = ( this.groups = {} ),
|
||||
var currentForm = this.currentForm,
|
||||
groups = ( this.groups = {} ),
|
||||
rules;
|
||||
$.each( this.settings.groups, function( key, value ) {
|
||||
if ( typeof value === "string" ) {
|
||||
@ -409,13 +419,20 @@ $.extend( $.validator, {
|
||||
} );
|
||||
|
||||
function delegate( event ) {
|
||||
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
|
||||
|
||||
// Set form expando on contenteditable
|
||||
if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
|
||||
if ( !this.form && isContentEditable ) {
|
||||
this.form = $( this ).closest( "form" )[ 0 ];
|
||||
this.name = $( this ).attr( "name" );
|
||||
}
|
||||
|
||||
// Ignore the element if it belongs to another form. This will happen mainly
|
||||
// when setting the `form` attribute of an input to the id of another form.
|
||||
if ( currentForm !== this.form ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var validator = $.data( this.form, "validator" ),
|
||||
eventType = "on" + event.type.replace( /^validate/, "" ),
|
||||
settings = validator.settings;
|
||||
@ -610,7 +627,7 @@ $.extend( $.validator, {
|
||||
try {
|
||||
$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )
|
||||
.filter( ":visible" )
|
||||
.focus()
|
||||
.trigger( "focus" )
|
||||
|
||||
// Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
|
||||
.trigger( "focusin" );
|
||||
@ -639,16 +656,23 @@ $.extend( $.validator, {
|
||||
.not( this.settings.ignore )
|
||||
.filter( function() {
|
||||
var name = this.name || $( this ).attr( "name" ); // For contenteditable
|
||||
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
|
||||
|
||||
if ( !name && validator.settings.debug && window.console ) {
|
||||
console.error( "%o has no name assigned", this );
|
||||
}
|
||||
|
||||
// Set form expando on contenteditable
|
||||
if ( this.hasAttribute( "contenteditable" ) ) {
|
||||
if ( isContentEditable ) {
|
||||
this.form = $( this ).closest( "form" )[ 0 ];
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// Ignore elements that belong to other/nested forms
|
||||
if ( this.form !== validator.currentForm ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Select only the first element for each name, and only those with rules specified
|
||||
if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
|
||||
return false;
|
||||
@ -694,6 +718,7 @@ $.extend( $.validator, {
|
||||
elementValue: function( element ) {
|
||||
var $element = $( element ),
|
||||
type = element.type,
|
||||
isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false",
|
||||
val, idx;
|
||||
|
||||
if ( type === "radio" || type === "checkbox" ) {
|
||||
@ -702,7 +727,7 @@ $.extend( $.validator, {
|
||||
return element.validity.badInput ? "NaN" : $element.val();
|
||||
}
|
||||
|
||||
if ( element.hasAttribute( "contenteditable" ) ) {
|
||||
if ( isContentEditable ) {
|
||||
val = $element.text();
|
||||
} else {
|
||||
val = $element.val();
|
||||
@ -763,10 +788,6 @@ $.extend( $.validator, {
|
||||
if ( normalizer ) {
|
||||
val = normalizer.call( element, val );
|
||||
|
||||
if ( typeof val !== "string" ) {
|
||||
throw new TypeError( "The normalizer should return a string value." );
|
||||
}
|
||||
|
||||
// Delete the normalizer from rules to avoid treating it as a pre-defined method.
|
||||
delete rules.normalizer;
|
||||
}
|
||||
@ -1029,6 +1050,10 @@ $.extend( $.validator, {
|
||||
// meta-characters that should be escaped in order to be used with JQuery
|
||||
// as a literal part of a name/id or any selector.
|
||||
escapeCssMeta: function( string ) {
|
||||
if ( string === undefined ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" );
|
||||
},
|
||||
|
||||
@ -1105,8 +1130,8 @@ $.extend( $.validator, {
|
||||
}
|
||||
delete this.pending[ element.name ];
|
||||
$( element ).removeClass( this.settings.pendingClass );
|
||||
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
|
||||
$( this.currentForm ).submit();
|
||||
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0 ) {
|
||||
$( this.currentForm ).trigger( "submit" );
|
||||
|
||||
// Remove the hidden input that was used as a replacement for the
|
||||
// missing submit button. The hidden input is added by `handle()`
|
||||
@ -1142,7 +1167,19 @@ $.extend( $.validator, {
|
||||
.removeData( "validator" )
|
||||
.find( ".validate-equalTo-blur" )
|
||||
.off( ".validate-equalTo" )
|
||||
.removeClass( "validate-equalTo-blur" );
|
||||
.removeClass( "validate-equalTo-blur" )
|
||||
.find( ".validate-lessThan-blur" )
|
||||
.off( ".validate-lessThan" )
|
||||
.removeClass( "validate-lessThan-blur" )
|
||||
.find( ".validate-lessThanEqual-blur" )
|
||||
.off( ".validate-lessThanEqual" )
|
||||
.removeClass( "validate-lessThanEqual-blur" )
|
||||
.find( ".validate-greaterThanEqual-blur" )
|
||||
.off( ".validate-greaterThanEqual" )
|
||||
.removeClass( "validate-greaterThanEqual-blur" )
|
||||
.find( ".validate-greaterThan-blur" )
|
||||
.off( ".validate-greaterThan" )
|
||||
.removeClass( "validate-greaterThan-blur" );
|
||||
}
|
||||
|
||||
},
|
||||
@ -1199,7 +1236,7 @@ $.extend( $.validator, {
|
||||
|
||||
// Exception: the jquery validate 'range' method
|
||||
// does not test for the html5 'range' type
|
||||
rules[ method ] = true;
|
||||
rules[ type === "date" ? "dateISO" : method ] = true;
|
||||
}
|
||||
},
|
||||
|
||||
@ -1246,6 +1283,12 @@ $.extend( $.validator, {
|
||||
|
||||
for ( method in $.validator.methods ) {
|
||||
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
|
||||
|
||||
// Cast empty attributes like `data-rule-required` to `true`
|
||||
if ( value === "" ) {
|
||||
value = true;
|
||||
}
|
||||
|
||||
this.normalizeAttributeRule( rules, type, method, value );
|
||||
}
|
||||
return rules;
|
||||
@ -1292,7 +1335,7 @@ $.extend( $.validator, {
|
||||
|
||||
// Evaluate parameters
|
||||
$.each( rules, function( rule, parameter ) {
|
||||
rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter;
|
||||
rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter;
|
||||
} );
|
||||
|
||||
// Clean number parameters
|
||||
@ -1304,7 +1347,7 @@ $.extend( $.validator, {
|
||||
$.each( [ "rangelength", "range" ], function() {
|
||||
var parts;
|
||||
if ( rules[ this ] ) {
|
||||
if ( $.isArray( rules[ this ] ) ) {
|
||||
if ( Array.isArray( rules[ this ] ) ) {
|
||||
rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];
|
||||
} else if ( typeof rules[ this ] === "string" ) {
|
||||
parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ );
|
||||
@ -1371,7 +1414,7 @@ $.extend( $.validator, {
|
||||
if ( this.checkable( element ) ) {
|
||||
return this.getLength( value, element ) > 0;
|
||||
}
|
||||
return value.length > 0;
|
||||
return value !== undefined && value !== null && value.length > 0;
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/email-method/
|
||||
@ -1391,13 +1434,30 @@ $.extend( $.validator, {
|
||||
// https://gist.github.com/dperini/729294
|
||||
// see also https://mathiasbynens.be/demo/url-regex
|
||||
// modified to allow protocol-relative URLs
|
||||
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
|
||||
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/date-method/
|
||||
date: function( value, element ) {
|
||||
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
|
||||
},
|
||||
date: ( function() {
|
||||
var called = false;
|
||||
|
||||
return function( value, element ) {
|
||||
if ( !called ) {
|
||||
called = true;
|
||||
if ( this.settings.debug && window.console ) {
|
||||
console.warn(
|
||||
"The `date` method is deprecated and will be removed in version '2.0.0'.\n" +
|
||||
"Please don't use it, since it relies on the Date constructor, which\n" +
|
||||
"behaves very differently across browsers and locales. Use `dateISO`\n" +
|
||||
"instead or one of the locale specific methods in `localizations/`\n" +
|
||||
"and `additional-methods.js`."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
|
||||
};
|
||||
}() ),
|
||||
|
||||
// https://jqueryvalidation.org/dateISO-method/
|
||||
dateISO: function( value, element ) {
|
||||
@ -1416,19 +1476,19 @@ $.extend( $.validator, {
|
||||
|
||||
// https://jqueryvalidation.org/minlength-method/
|
||||
minlength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || length >= param;
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/maxlength-method/
|
||||
maxlength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || length <= param;
|
||||
},
|
||||
|
||||
// https://jqueryvalidation.org/rangelength-method/
|
||||
rangelength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
|
||||
},
|
||||
|
4
TravelCompany/TravelCompanyWebApp/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
vendored
Normal file
4
TravelCompany/TravelCompanyWebApp/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user