1160 lines
53 KiB
Plaintext
1160 lines
53 KiB
Plaintext
@using _0_Framework.Application
|
||
@model CompanyManagment.App.Contracts.Employee.CreateEmployee
|
||
|
||
@{
|
||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||
}
|
||
|
||
<link href="~/Admintheme/css/personelCreate.css?ver=@adminVersion" rel="stylesheet" />
|
||
|
||
<fieldset class=" content-fieldset">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<legend class="main-title">مشخصات پرسنل جدید</legend>
|
||
<div class="form-box">
|
||
<div class="steps">
|
||
<div class="progressBar"></div>
|
||
<div class="step">مشخصات سامانه ای</div>
|
||
<div class="step">مشخصات تکمیلی</div>
|
||
<div class="step">مشخصات اجباری</div>
|
||
<div class="step">احراز هویت</div>
|
||
</div>
|
||
<form asp-page="./Index" asp-page-handler="Create" id="employee" autocomplete="off"
|
||
method="post"
|
||
data-ajax="true"
|
||
data-callback=""
|
||
data-action="Refresh">
|
||
<div class="form formInit">
|
||
<div class="formSection">
|
||
<div class="row">
|
||
<input type="hidden" asp-for="IsAuthorized" id="IsAuthorized" value="false" />
|
||
<input type="hidden" asp-for="IdNumberSerial" id="IdNumberSerial" value="" />
|
||
<input type="hidden" asp-for="IdNumberSeri" id="IdNumberSeri" value="" />
|
||
<div class="inputs">
|
||
<label> کد ملی <span style="color: red;">*</span></label>
|
||
<input type="text" placeholder="" class="input text-center" id="iniCodeMelli" pattern="\d*" maxlength="10"/>
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="inputs">
|
||
<label>تاریخ تولد<span style="color: red;">*</span></label>
|
||
<input type="text" placeholder="" class="input persianDateInput ltr text-center" id="iniDateOfBirth" maxlength="10"/>
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-3"></div>
|
||
<div class="right col-md-3"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form form1">
|
||
<div class="row d-flex">
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-12">
|
||
<div id="divGender" class="form-group flexible-div oblig1">
|
||
<div class="radio-box disable">
|
||
<label class="radio-label">جنسیت <span style="color: red;">*</span></label>
|
||
<div class="radio-input">
|
||
<label>
|
||
آقا<input type="radio" value="مرد" asp-for="Gender" class="disable" id="GenderMale" name="Gender">
|
||
</label>
|
||
<label>
|
||
خانم<input type="radio" value="زن" asp-for="Gender" class="disable" id="GenderFemale" name="Gender">
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="right col-lg-4 col-md-6 col-sm-6 col-xs-12">
|
||
<div id="divMarried" class="form-group flexible-div oblig2">
|
||
<div class="radio-box">
|
||
<label class="radio-label">وضعیت تاهل <span style="color: red;">*</span></label>
|
||
<div class="radio-input">
|
||
<label>
|
||
متاهل<input type="radio" value="متاهل" asp-for="MaritalStatus" name="MaritalStatus">
|
||
</label>
|
||
<label>
|
||
مجرد<input type="radio" value="مجرد" asp-for="MaritalStatus" name="MaritalStatus">
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-12">
|
||
<div class="form-group flexible-div">
|
||
<div class="radio-box">
|
||
<label class="radio-label">ملیت </label>
|
||
<div class="radio-input nationality">
|
||
<label>
|
||
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
|
||
</label>
|
||
<label>
|
||
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="right col-lg-2 col-md-6 col-sm-6 col-xs-12 duty-condition">
|
||
<label>وضعیت نظام وظیفه </label>
|
||
<select name="dropdown1" class="input" asp-for="MilitaryService" name="MilitaryService" style="background: #ffffff6b;" id="soldier" disabled>
|
||
<option value="مشمول" class="input" selected>مشمول</option>
|
||
<option value="معاف" class="input">معاف</option>
|
||
<option value="پایان خدمت" class="input">پایان خدمت</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label>نام <span style="color: red;">*</span></label>
|
||
<input type="text" placeholder="" class="input not-empty disable" id="name" asp-for="FName" pattern="[\u0600-\u06FF\s]*">
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط حروف فارسی وارد شود.</p>
|
||
</div>
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label> نام خانوادگی <span style="color: red;">*</span></label>
|
||
<input type="text" placeholder="" class="input not-empty disable" id="family" asp-for="LName" pattern="[\u0600-\u06FF\s]*" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط حروف فارسی وارد شود.</p>
|
||
</div>
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label> نام پدر</label>
|
||
<input type="text" placeholder="" class="input disable" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط حروف فارسی وارد شود.</p>
|
||
</div>
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label>تاریخ تولد</label>
|
||
<input type="text" placeholder="" class="input persianDateInput ltr text-center disable" asp-for="DateOfBirth" maxlength="10" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label> کد ملی <span style="color: red;">*</span></label>
|
||
<input type="text" placeholder="" class="input text-center disable" id="code-melli" asp-for="NationalCode" pattern="\d*" maxlength="10" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label>شماره شناسنامه </label>
|
||
<input type="text" placeholder="" class="input text-center disable" pattern="\d*" asp-for="IdNumber" maxlength="10" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
<div id="divState" class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label>نام استان <span style="color: red;">*</span></label>
|
||
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
|
||
<option value="">استان</option>
|
||
<option value="تهران"> تهران </option>
|
||
<option value="گیلان"> گیلان </option>
|
||
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
|
||
<option value="خوزستان"> خوزستان </option>
|
||
<option value="فارس"> فارس</option>
|
||
<option value="اصفهان"> اصفهان</option>
|
||
<option value="خراسان رضوی">خراسان رضوی </option>
|
||
<option value="قزوین"> قزوین</option>
|
||
<option value="سمنان"> سمنان </option>
|
||
<option value="قم"> قم</option>
|
||
<option value="مرکزی"> مرکزی</option>
|
||
<option value="زنجان"> زنجان</option>
|
||
<option value="مازندران"> مازندران</option>
|
||
<option value="گلستان"> گلستان</option>
|
||
<option value="اردبیل"> اردبیل </option>
|
||
<option value="آذربایجان غربی"> آذربایجان غربی</option>
|
||
<option value="همدان"> همدان </option>
|
||
<option value="کردستان"> کردستان </option>
|
||
<option value="کرمانشاه"> کرمانشاه </option>
|
||
<option value="لرستان"> لرستان</option>
|
||
<option value="بوشهر"> بوشهر</option>
|
||
<option value="کرمان"> کرمان</option>
|
||
<option value="هرمزگان"> هرمزگان</option>
|
||
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
|
||
<option value="یزد"> یزد</option>
|
||
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
|
||
<option value="ایلام"> ایلام</option>
|
||
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
|
||
<option value="خراسان شمالی"> خراسان شمالی</option>
|
||
<option value="خراسان جنوبی"> خراسان جنوبی</option>
|
||
<option value="البرز"> البرز</option>
|
||
</select>
|
||
</div>
|
||
<div id="divCity" class="right col-lg-3 col-md-6 col-sm-6 col-xs-6 inputs">
|
||
<label>نام شهر <span style="color: red;">*</span></label>
|
||
|
||
<select class="input select-city" name="cityy" id="city" onchange="changecity(this)">
|
||
<option value="" placeholder=" شهرستان"> </option>
|
||
</select>
|
||
<input type="hidden" value="" id="hide2" asp-for="City">
|
||
|
||
</div>
|
||
</div>
|
||
<div class="row" style="display:flex;flex-direction: row-reverse;flex-wrap: wrap;">
|
||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 loc-box">
|
||
<textarea class="input loc-text" asp-for="Address" placeholder="آدرس"></textarea>
|
||
</div>
|
||
<div class="children-box col-lg-6 col-md-6 col-sm-6 col-xs-12 right">
|
||
<div class="right col-lg-12 col-md-12 col-sm-12 col-xs-12" id="children-container">
|
||
<table id="children">
|
||
<thead>
|
||
<tr>
|
||
<th>تاریخ تولد</th>
|
||
<th>نام فرزند</th>
|
||
<th> #</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr class="trcreate">
|
||
<td>
|
||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||
<input asp-for="CreateEmployeChildrenList[0].DateOfBirth" name="CreateEmployeChildrenList[0].DateOfBirth" class="items childInput persianDateInput ltr text-center childBirth col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" placeholder="" maxlength="10">
|
||
</div>
|
||
<div>
|
||
<a>
|
||
<i class="fa fa-trash trash" aria-hidden="true" style="color: #818181;">
|
||
</i>
|
||
</a>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||
<input asp-for="CreateEmployeChildrenList[0].FName" class="items childInput childName col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" placeholder="" pattern="[\u0600-\u06FF\s]*">
|
||
</div>
|
||
</td>
|
||
<td>1</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<a class="add col-lg-3 right" onclick="addChildren()"><i class="fa fa-user-plus" aria-hidden="true" style="margin: 0px 5px;"></i>افزودن فرزند</a>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-3"></div>
|
||
<div class="right col-md-3"></div>
|
||
</div>
|
||
</div>
|
||
<div class="form form2 mt-5">
|
||
<div class="col-xs-12">
|
||
<div class="row">
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-12 inputs">
|
||
<label>شماره بیمه</label>
|
||
<input type="text" placeholder="" asp-for="InsuranceCode" class="input insInput" style="background-color: #d4e9ff;" pattern="\d*" maxlength="8" />
|
||
</div>
|
||
<div class="right col-md-3 col-lg-3 col-sm-3 col-xs-6 inputs insInputDate">
|
||
<label> سابقه کلی در بیمه (سال)</label>
|
||
<input type="text" placeholder="" class="input insInput text-center" asp-for="InsuranceHistoryByYear" style="background-color: #d4e9ff;" />
|
||
</div>
|
||
<div class="right col-md-3 col-lg-3 col-sm-3 col-xs-6 inputs insInputDate">
|
||
<label> سابقه کلی در بیمه (ماه)</label>
|
||
<input type="text" placeholder="" class="input insInput text-center" asp-for="InsuranceHistoryByMonth" style="background-color: #d4e9ff;" />
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-6 inputs">
|
||
<label>تاریخ صدور شناسنامه </label>
|
||
<input type="text" placeholder="" class="input persianDateInput ltr text-center" maxlength="10" asp-for="DateOfIssue" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط عدد وارد شود.</p>
|
||
</div>
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-6 inputs">
|
||
<label>محل صدور شناسنامه </label>
|
||
<input type="text" placeholder="" class="input text-center" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*" />
|
||
<i class="fa fa-exclamation-circle error-icon"></i>
|
||
<p class="error-message">فقط حروف فارسی وارد شود.</p>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-6 inputs">
|
||
<label>سطح تحصیلات</label>
|
||
<select name="dropdown4" class="input education" asp-for="LevelOfEducation" name="LevelOfEducation">
|
||
<option value="" selected class="input"> </option>
|
||
<option value="بی سواد">بی سواد</option>
|
||
<option value="سیکل">سیکل</option>
|
||
<option value="دیپلم">دیپلم</option>
|
||
<option value="فوق دیپلم">فوق دیپلم</option>
|
||
<option value="لیسانس">لیسانس</option>
|
||
<option value="فوق لیسانس">فوق لیسانس</option>
|
||
<option value="دکتری">دکتری</option>
|
||
</select>
|
||
</div>
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-6 inputs">
|
||
<label>رشته تحصیلی </label>
|
||
<input type="text" placeholder="" asp-for="FieldOfStudy" class="input" />
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-12 inputs">
|
||
<label>شماره کارت بانکی </label>
|
||
<input type="text" placeholder="" asp-for="BankCardNumber" class="input text-center" />
|
||
</div>
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-12 inputs">
|
||
<label>شعبه بانک </label>
|
||
<input type="text" placeholder="" asp-for="BankBranch" class="input" />
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-12 inputs">
|
||
<label>شماره همراه </label>
|
||
<input type="text" placeholder="" asp-for="Phone" class="input text-center" />
|
||
</div>
|
||
<div class="right col-md-6 col-lg-6 col-sm-6 col-xs-12 inputs">
|
||
<label>شماره ثابت </label>
|
||
<input type="text" placeholder="" asp-for="OfficePhone" class="input text-center" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form form3">
|
||
<div class="flexible-wrap" style="padding: 0 10px;">
|
||
<fieldset>
|
||
<legend> اداره کار </legend>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend> تامین اجتماعی</legend>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend> قوه قضائیه </legend>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend> امور مالیاتی </legend>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
|
||
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="form-footer-btns">
|
||
<a class="btn btn-modal pre">مرحله قبل</a>
|
||
<a class="btn btn-modal next">مرحله بعد</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="form-footer">
|
||
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
|
||
<a href="#" class=" btn btn-success btn-rounded waves-effect waves-light" id="save">ذخیره</a>
|
||
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave">ذخیره</a>
|
||
</div>
|
||
</fieldset>
|
||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||
<script>
|
||
|
||
var loadUidInfo = `@Url.Page("./Index", "EmployeeDataFromApi")`;
|
||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||
|
||
$('#fakeSave').hide();
|
||
$('#save').show();
|
||
$(document).ready(function() {
|
||
handleScroll();
|
||
$('.error-message').hide();
|
||
$('.error-icon').hide();
|
||
|
||
$(".pre").css({
|
||
'background-color': "#c7c0c0ba",
|
||
'color': '#000000b8',
|
||
'box-shadow': 'none'
|
||
});
|
||
});
|
||
|
||
$(document).on("click", function (event) {
|
||
var target = $(event.target);
|
||
if (!target.is("#saveEmployee")
|
||
&& !target.is("#saveEmployee *")
|
||
) {
|
||
$(".datepicker-container").hide();
|
||
}
|
||
});
|
||
|
||
$("#close , .close").on('click', function () {
|
||
$(".datepicker-container").hide();
|
||
});
|
||
|
||
$('.input').on('keyup', function () {
|
||
const errorMessage = $(this).parent().find('.error-message');
|
||
const errorIcon = $(this).parent().find('.error-icon');
|
||
if (this.validity.patternMismatch) {
|
||
errorMessage.show();
|
||
errorIcon.show();
|
||
$(this).addClass('errored');
|
||
$(this).addClass('patternMisMatch');
|
||
|
||
} else {
|
||
errorMessage.hide();
|
||
errorIcon.hide();
|
||
$(this).removeClass('errored');
|
||
$(this).removeClass('patternMisMatch');
|
||
}
|
||
});
|
||
|
||
function checkValidity(element) {
|
||
if (element.validity.patternMismatch) {
|
||
element.addClass('errored');
|
||
element.addClass('patternMisMatch');
|
||
|
||
} else {
|
||
element.removeClass('errored');
|
||
element.removeClass('patternMisMatch');
|
||
}
|
||
}
|
||
function checkDate(element) {
|
||
let value = element.val();
|
||
let lengthValue = value.length;
|
||
if (lengthValue == 10) {
|
||
if (!dateValidCheck(element)) {
|
||
element.addClass("errored");
|
||
element.addClass("patternMisMatch");
|
||
}
|
||
else {
|
||
element.removeClass("errored");
|
||
element.removeClass("patternMisMatch");
|
||
}
|
||
}
|
||
}
|
||
|
||
$('.form1 input[name="Gender"]').on('change', function() {
|
||
let selectedGender = $('input[name="Gender"]:checked').val();
|
||
if (selectedGender === 'مرد') {
|
||
$('#soldier').prop('disabled', false);
|
||
} else {
|
||
$('#soldier').prop('disabled', true);
|
||
}
|
||
});
|
||
|
||
// تغییر مرحله به مرحله اون چی بود نوشتین :)
|
||
// new step to step
|
||
let currentStep = 0;
|
||
const steps = [".formInit", ".form1", ".form2", ".form3"];
|
||
|
||
function showStep(index) {
|
||
$(steps.join(',')).hide();
|
||
$(steps[index]).show();
|
||
updateProgressBar(index);
|
||
}
|
||
|
||
function validateStep(index) {
|
||
let valid = true;
|
||
|
||
if (index === 0) {
|
||
const input = $(".formInit input[type='text']");
|
||
if (input.val().trim() === "") {
|
||
$(".formInit .inputs").addClass('errored');
|
||
valid = false;
|
||
} else {
|
||
$(".formInit .inputs").removeClass('errored');
|
||
}
|
||
}
|
||
|
||
if (index === 1) {
|
||
if ($("#divGender input[type='radio']:checked").length === 0) {
|
||
$("#divGender").addClass('errored');
|
||
valid = false;
|
||
} else {
|
||
$("#divGender").removeClass('errored');
|
||
}
|
||
|
||
$(".form1 .not-empty").each(function () {
|
||
if ($(this).val().trim() === "") {
|
||
$(this).addClass('errored');
|
||
valid = false;
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
|
||
$(".form1 input.persianDateInput").each(function () {
|
||
const val = $(this).val();
|
||
if (val.length > 0 && val.length < 10) {
|
||
$(this).addClass('errored');
|
||
valid = false;
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
|
||
if (!childrenValid()) valid = false;
|
||
}
|
||
|
||
return valid;
|
||
}
|
||
|
||
function updateProgressBar(index) {
|
||
const widths = ['25%', '50%', '75%', '100%'];
|
||
$(".progressBar").css('width', widths[index]);
|
||
}
|
||
|
||
$(".next").click(async function () {
|
||
if (currentStep === 0) {
|
||
// اعتبارسنجی فرم اول
|
||
const input = $(".formInit input[type='text']");
|
||
if (input.val().trim() === "") {
|
||
$(".formInit .inputs").addClass('errored');
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
return;
|
||
} else {
|
||
$(".formInit .inputs").removeClass('errored');
|
||
}
|
||
|
||
var birthday = $('#iniDateOfBirth').val();
|
||
var codeMelli = $('#iniCodeMelli').val();
|
||
|
||
try {
|
||
const response = $.ajax({
|
||
url: loadUidInfo,
|
||
method: 'POST',
|
||
data: { nationalCode: codeMelli, birthDate: birthday },
|
||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||
success: function(response) {
|
||
debugger;
|
||
if (response.success) {
|
||
$('#IsAuthorized').val(true);
|
||
$('#name').val(response.data.fName);
|
||
$('#family').val(response.data.lName);
|
||
$('#FatherName').val(response.data.fatherName);
|
||
$('#DateOfBirth').val(response.data.birthDate);
|
||
$('#code-melli').val(response.data.nationalCode);
|
||
$('#IdNumber').val(response.data.idNumber);
|
||
$('#IdNumberSerial').val(response.data.idNumberSerial);
|
||
$('#IdNumberSeri').val(response.data.idNumberSeri);
|
||
if (response.data.gender === 0) {
|
||
$('#GenderMale').prop('checked', true);
|
||
$('#soldier').prop('disabled', false);
|
||
} else if (response.data.gender === 1) {
|
||
$('#GenderFemale').prop('checked', true);
|
||
$('#soldier').prop('disabled', true);
|
||
}
|
||
else{
|
||
$('#GenderMale').removeClass("disable");
|
||
$('#GenderFemale').removeClass("disable");
|
||
$('#divGender .radio-box').removeClass('disable');
|
||
|
||
}
|
||
currentStep++;
|
||
showStep(currentStep);
|
||
}
|
||
else if (response.data?.authorizedCanceled) {
|
||
|
||
$('#name').removeClass("disable");
|
||
$('#family').removeClass("disable");
|
||
$('#FatherName').removeClass("disable");
|
||
$('#DateOfBirth').removeClass("disable");
|
||
$('#code-melli').removeClass("disable");
|
||
$('#IdNumber').removeClass("disable");
|
||
$('#IdNumberSerial').removeClass("disable");
|
||
$('#IdNumberSeri').removeClass("disable");
|
||
$('#GenderMale').removeClass("disable");
|
||
$('#GenderFemale').removeClass("disable");
|
||
$('#divGender .radio-box').removeClass('disable');
|
||
currentStep++;
|
||
showStep(currentStep);
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||
return;
|
||
}
|
||
else {
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||
return;
|
||
}
|
||
},
|
||
error:function(error) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||
return;
|
||
}
|
||
});
|
||
// debugger;
|
||
// if (response.success) {
|
||
// $('#IsAuthorized').val(true);
|
||
// $('#name').val(response.data.fName);
|
||
// $('#family').val(response.data.lName);
|
||
// $('#FatherName').val(response.data.fatherName);
|
||
// $('#DateOfBirth').val(response.data.birthDate);
|
||
// $('#code-melli').val(response.data.nationalCode);
|
||
// $('#IdNumber').val(response.data.idNumber);
|
||
// $('#IdNumberSerial').val(response.data.idNumberSerial);
|
||
// $('#IdNumberSeri').val(response.data.idNumberSeri);
|
||
// if (response.data.gender === 0) {
|
||
// $('#GenderMale').prop('checked', true);
|
||
// $('#soldier').prop('disabled', false);
|
||
// } else if (response.data.gender === 1) {
|
||
// $('#GenderFemale').prop('checked', true);
|
||
// $('#soldier').prop('disabled', true);
|
||
// }
|
||
// }
|
||
// else if (response.data.authorizedCanceled) {
|
||
|
||
// $('#name').removeClass("disable");
|
||
// $('#family').removeClass("disable");
|
||
// $('#FatherName').removeClass("disable");
|
||
// $('#DateOfBirth').removeClass("disable");
|
||
// $('#code-melli').removeClass("disable");
|
||
// $('#IdNumber').removeClass("disable");
|
||
// $('#IdNumberSerial').removeClass("disable");
|
||
// $('#IdNumberSeri').removeClass("disable");
|
||
// $('#GenderMale').removeClass("disable");
|
||
// $('#GenderFemale').removeClass("disable");
|
||
// $('#divGender .radio-box').removeClass('disable');
|
||
// currentStep++;
|
||
// showStep(currentStep);
|
||
// $.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||
// return;
|
||
// }
|
||
// else {
|
||
// $.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||
// return;
|
||
// }
|
||
|
||
// currentStep++;
|
||
// showStep(currentStep);
|
||
} catch (error) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "ارسال اطلاعات با مشکل مواجه شد.");
|
||
return;
|
||
}
|
||
} else if (currentStep === 1) {
|
||
|
||
if ($(".form1 #divGender").find('input[type="radio"]:checked').length === 0) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
|
||
$(".form1 #divGender").addClass('errored');
|
||
|
||
setTimeout(function () {
|
||
$(".form1 #divGender").removeClass('errored');
|
||
}, 2500);
|
||
return;
|
||
}
|
||
|
||
if ($(".form1 #divMarried").find('input[type="radio"]:checked').length === 0) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
|
||
$(".form1 #divMarried").addClass('errored');
|
||
|
||
setTimeout(function () {
|
||
$(".form1 #divMarried").removeClass('errored');
|
||
}, 2500);
|
||
return;
|
||
}
|
||
|
||
currentStep++;
|
||
showStep(currentStep);
|
||
} else {
|
||
if (validateStep(currentStep)) {
|
||
if (currentStep < steps.length - 1) {
|
||
currentStep++;
|
||
showStep(currentStep);
|
||
}
|
||
} else {
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
}
|
||
}
|
||
});
|
||
|
||
$(".pre").click(function () {
|
||
if (currentStep > 1) {
|
||
currentStep--;
|
||
showStep(currentStep);
|
||
}
|
||
});
|
||
|
||
// شروع اولیه
|
||
$(document).ready(function () {
|
||
showStep(currentStep);
|
||
});
|
||
|
||
|
||
// $(".next").click(function() {
|
||
// if ($(".form1 #divGender").find('input[type="radio"]:checked').length === 0) {
|
||
// // allInputsFilled = false;
|
||
// $(".form1 #divGender").addClass('errored');
|
||
// }
|
||
|
||
// if ($(".form1 #divMarried").find('input[type="radio"]:checked').length === 0) {
|
||
// // allInputsFilled = false;
|
||
// // $(".form1 #divMarried").addClass('errored');
|
||
// }
|
||
|
||
// var option1 = document.getElementById("city").options.selectedIndex;
|
||
// if (option1 === 0) {
|
||
// // $("#divCity .select2-selection").addClass('errored');
|
||
// } else {
|
||
// $("#divCity .select2-selection").removeClass('errored');
|
||
// }
|
||
// var option2 = document.getElementById("State").options.selectedIndex;
|
||
// if (option2 === 0) {
|
||
// // $("#divState .select2-selection").addClass('errored');
|
||
// } else {
|
||
// $("#divState .select2-selection").removeClass('errored');
|
||
// }
|
||
// //if ($("#DateOfBirth").val() != '' && !checkLength($("#DateOfBirth").val(), 10)) {
|
||
// // if (!dateValidCheckByValue($("#DateOfBirth"))) {
|
||
// // $("#DateOfBirth").addClass("errored");
|
||
// // } else {
|
||
// // $("#DateOfBirth").removeClass("errored");
|
||
// // }
|
||
// //}
|
||
// //if ($("#DateOfIssue").val() != '' && !checkLength($("#DateOfIssue").val(), 10)) {
|
||
// // if (!dateValidCheckByValue($("#DateOfIssue"))) {
|
||
// // $("#DateOfIssue").addClass("errored");
|
||
// // } else {
|
||
// // $("#DateOfIssue").removeClass("errored");
|
||
// // }
|
||
// //}
|
||
|
||
// $(".form1").find('.not-empty').each(function() {
|
||
// if ($(this).val() === '') {
|
||
// // allInputsFilled = false;
|
||
// $(this).addClass('errored');
|
||
// } else {
|
||
// $(this).removeClass('errored');
|
||
// }
|
||
// });
|
||
// $(".form1").find('input.persianDateInput').each(function() {
|
||
// let value = $(this).val();
|
||
// let lengthValue = value.length;
|
||
// if (lengthValue < 10 && lengthValue !== 0) {
|
||
// $(this).addClass('errored');
|
||
// } else {
|
||
// $(this).removeClass('errored');
|
||
// }
|
||
// });
|
||
|
||
// if (childrenValid()) {
|
||
// debugger;
|
||
// // if ($('.form1 .errored').length > 0 || $('.form1 input.patternMisMatch').length > 0) {
|
||
// // $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
// // //$('#fakeSave').hide();
|
||
// // //$('#save').show();
|
||
// // }
|
||
// if ($('.formInit .errored').length > 0) {
|
||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
// //$('#fakeSave').hide();
|
||
// //$('#save').show();
|
||
// } else {
|
||
// if ($('.form3').css('right') === '0px') {
|
||
// $(".next").css({
|
||
// 'background-color': "#c7c0c0ba",
|
||
// 'color': '#000000b8',
|
||
// 'box-shadow': 'none'
|
||
// });
|
||
// } else if ($('.form2').css('left') === '1200px') {
|
||
// $(".pre").css({
|
||
// 'background-color': "white",
|
||
// 'color': '#0f9500',
|
||
// 'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||
// });
|
||
// $(".progressBar").css({
|
||
// 'width': '50%'
|
||
|
||
// });
|
||
// $(".form1").css({
|
||
// right: '1200px'
|
||
// });
|
||
// $(".form2").css({
|
||
// left: '0'
|
||
// });
|
||
// } else if ($('.form2').css('left') === '0px') {
|
||
// $(".next").css({
|
||
// 'background-color': "#c7c0c0ba",
|
||
// 'color': '#000000b8',
|
||
// 'box-shadow': 'none'
|
||
// });
|
||
// $(".pre").css({
|
||
// 'background-color': "white",
|
||
// 'color': '#0f9500',
|
||
// 'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||
// });
|
||
// $(".progressBar").css({
|
||
// 'width': '75%',
|
||
// 'border-top-right-radius': '7px'
|
||
// });
|
||
// $(".form2").css({
|
||
// left: '1200px'
|
||
// });
|
||
// $(".form3").css({
|
||
// right: '0'
|
||
// });
|
||
// }
|
||
// }
|
||
// }
|
||
// });
|
||
|
||
// $(".pre").click(function() {
|
||
// $(".next").css({
|
||
// 'background-color': "white",
|
||
// 'color': '#1763b1'
|
||
// });
|
||
|
||
// if ($('.form2').css('left') == '1200px' && $('#form3').css('right') == '1200px') {
|
||
// $(".pre").css({
|
||
// 'background-color': "#c7c0c0ba",
|
||
// 'color': '#000000b8',
|
||
// 'box-shadow': 'none'
|
||
// });
|
||
// } else if ($('.form2').css('left') == '0px') {
|
||
// $(".progressBar").css({
|
||
// 'width': '25%',
|
||
// 'border-top-right-radius': '0px'
|
||
// });
|
||
// $(".pre").css({
|
||
// 'background-color': "#c7c0c0ba",
|
||
// 'color': '#000000b8',
|
||
// 'box-shadow': 'none'
|
||
// });
|
||
// $(".form2").css({
|
||
// left: '1200px'
|
||
// });
|
||
// $(".form1").css({
|
||
// right: 'initial'
|
||
// });
|
||
// } else if ($('.form3').css('right') == '0px') {
|
||
// $(".progressBar").css({
|
||
// 'width': '50%',
|
||
// 'border-top-right-radius': '0px'
|
||
// });
|
||
// $(".pre").css({
|
||
// 'background-color': "white",
|
||
// 'color': '#0f9500',
|
||
// 'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||
// });
|
||
// $(".form2").css({
|
||
// left: '0'
|
||
// });
|
||
// $(".form3").css({
|
||
// right: '1200px'
|
||
// });
|
||
// }
|
||
// });
|
||
function handleScroll() {
|
||
let rows = $(".form1").find("#children-container tbody").find("tr");
|
||
$(".form1").find("#children-container tbody").find("tr");
|
||
let rowCount = rows.length;
|
||
if (rowCount > 3) {
|
||
$('#children-container').removeClass('hide-scrollbar');
|
||
} else {
|
||
$('#children-container').addClass('hide-scrollbar');
|
||
}
|
||
}
|
||
function updateRowNumbers() {
|
||
let tbody = $(".form1").find("#children tbody");
|
||
let rows = tbody.find("tr");
|
||
rows.each(function (index) {
|
||
$(this).find("td:last-child").text(index + 1);
|
||
});
|
||
}
|
||
function addChildren() {
|
||
$(".form1").find('.childBirth').each(function () {
|
||
if ($(this).val() === '' || $(this).val().length < 10) {
|
||
$(this).addClass('errored');
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
$(".form1").find('.childName').each(function () {
|
||
if ($(this).val() === '') {
|
||
$(this).addClass('errored');
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
|
||
if ($('.form1 #children-container').find('input.patternMisMatch').length > 0 || $('.form1 #children-container').find('input.errored').length > 0) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
}
|
||
else {
|
||
addRow();
|
||
updateRowNumbers();
|
||
handleScroll();
|
||
}
|
||
|
||
$(".form1").find(".trash-icon").on("mouseenter", function () {
|
||
$(this).animate({ left: "-10px" }, 50)
|
||
.animate({ left: "-4px" }, 50)
|
||
.animate({ left: "-7px" }, 50);
|
||
});
|
||
$(".form1").find(".trash-icon").on("mouseleave", function () {
|
||
$(this).stop(true).animate({ left: "-7px" }, 50);
|
||
});
|
||
$(".form1").find('.delete').click(function () {
|
||
$(this).closest('tr').fadeOut(200, function () {
|
||
$(this).remove();
|
||
updateRowNumbers();
|
||
handleScroll();
|
||
|
||
});
|
||
});
|
||
}
|
||
|
||
function addRow() {
|
||
let tbody = $(".form1 #children tbody");
|
||
let rowCount = tbody.find("tr").length;
|
||
var a = $(".trcreate").length;
|
||
let newRow = '';
|
||
newRow = '<tr class="trcreate">' +
|
||
'<td>' +
|
||
'<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">' +
|
||
'<input class="items childInput persianDateInput ltr text-center childBirth col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" placeholder="" name="CreateEmployeChildrenList[' + a + '].DateOfBirth" maxlength="10">' +
|
||
'</div>' +
|
||
'<div>' +
|
||
'<a class="delete">' +
|
||
'<i class="fa fa-trash trash trash-icon" aria-hidden="true"></i>' +
|
||
'</a>' +
|
||
'</div>' +
|
||
'</td>' +
|
||
'<td>' +
|
||
'<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">' +
|
||
'<input class="items childInput childName col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" name="CreateEmployeChildrenList[' + a + '].FName" placeholder="" pattern="[\u0600-\u06FF\s]*">' +
|
||
'</div>' +
|
||
'</td>' +
|
||
'<td>' + (rowCount + 1) + '</td>' +
|
||
'</tr>';
|
||
tbody.append(newRow);
|
||
var dynamicInput = $(".items.childInput.childName");
|
||
dynamicInput.attr("pattern", "[-ۿ\\s]*");
|
||
$('.items').on('keyup', function () {
|
||
if (this.validity.patternMismatch) {
|
||
$(this).addClass('errored');
|
||
$(this).addClass('patternMisMatch');
|
||
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
$(this).removeClass('patternMisMatch');
|
||
}
|
||
});
|
||
$(".persianDateInput").on('keyup', function () {
|
||
if (event.which !== 8 && event.which !== 46) {
|
||
let value = $(this).val();
|
||
let lengthValue = value.length;
|
||
if (lengthValue === 4) {
|
||
value += '/';
|
||
}
|
||
if (lengthValue === 7) {
|
||
value += '/';
|
||
}
|
||
$(this).val(value);
|
||
}
|
||
});
|
||
|
||
$(".persianDateInput").on('blur', function () {
|
||
let value = $(this).val();
|
||
let lengthValue = value.length;
|
||
if (!dateValidCheck(this)) {
|
||
$(this).addClass("errored");
|
||
}
|
||
else {
|
||
$(this).removeClass("errored");
|
||
}
|
||
});
|
||
}
|
||
$('.items').on('keyup', function () {
|
||
if (this.validity.patternMismatch) {
|
||
$(this).addClass('errored');
|
||
$(this).addClass('patternMisMatch');
|
||
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
$(this).removeClass('patternMisMatch');
|
||
}
|
||
});
|
||
$(".persianDateInput").on('keyup', function () {
|
||
if (event.which !== 8 && event.which !== 46) {
|
||
let value = $(this).val();
|
||
let lengthValue = value.length;
|
||
if (lengthValue === 4) {
|
||
value += '/';
|
||
}
|
||
if (lengthValue === 7) {
|
||
value += '/';
|
||
}
|
||
$(this).val(value);
|
||
}
|
||
});
|
||
$(".persianDateInput").on("keydown", function (event) {
|
||
var keyCode = event.which || event.keyCode;
|
||
var isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||
var isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||
if (!isDigit && !isControlKey) {
|
||
event.preventDefault();
|
||
}
|
||
});
|
||
$(".persianDateInput").on('blur', function () {
|
||
let value = $(this).val();
|
||
let lengthValue = value.length;
|
||
if (!dateValidCheck(this)) {
|
||
$(this).addClass("errored");
|
||
}
|
||
else {
|
||
$(this).removeClass("errored");
|
||
}
|
||
});
|
||
$('.form1 input[name=Gender]').on('change', function () {
|
||
$(".form1 #divGender").removeClass('errored');
|
||
});
|
||
$('.form1 input[name=MaritalStatus]').on('change', function () {
|
||
// $(".form1 #divMarried").removeClass('errored');
|
||
});
|
||
|
||
$("#save").click(function () {
|
||
//var allInputsFilled = true;
|
||
$('#save').hide();
|
||
$('#fakeSave').show();
|
||
|
||
if ($(".form1 #divGender").find('input[type="radio"]:checked').length === 0) {
|
||
// allInputsFilled = false;
|
||
$(".form1 #divGender").addClass('errored');
|
||
}
|
||
|
||
if ($(".form1 #divMarried").find('input[type="radio"]:checked').length === 0) {
|
||
// allInputsFilled = false;
|
||
// $(".form1 #divMarried").addClass('errored');
|
||
}
|
||
|
||
var option1 = document.getElementById("city").options.selectedIndex;
|
||
if (option1 == 0) {
|
||
// $("#divCity .select2-selection").addClass('errored');
|
||
} else {
|
||
$("#divCity .select2-selection").removeClass('errored');
|
||
}
|
||
var option2 = document.getElementById("State").options.selectedIndex;
|
||
if (option2 == 0) {
|
||
// $("#divState .select2-selection").addClass('errored');
|
||
} else {
|
||
$("#divState .select2-selection").removeClass('errored');
|
||
}
|
||
|
||
|
||
$(".form1").find('.not-empty').each(function () {
|
||
if ($(this).val() === '') {
|
||
// allInputsFilled = false;
|
||
$(this).addClass('errored');
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
|
||
$(".form1").find('input.persianDateInput').each(function () {
|
||
let value = $(this).val();
|
||
let lengthValue = value.length;
|
||
if (lengthValue < 10 && lengthValue !== 0) {
|
||
$(this).addClass('errored');
|
||
} else {
|
||
$(this).removeClass('errored');
|
||
}
|
||
});
|
||
|
||
if ($('.form1 .errored').length > 0 || $('.form1 input.patternMisMatch').length > 0) {
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||
$('#fakeSave').hide();
|
||
$('#save').show();
|
||
|
||
}
|
||
|
||
else {
|
||
if (childrenValid())
|
||
{
|
||
$("#employee").submit();
|
||
setTimeout(function () {
|
||
|
||
$('#save').show();
|
||
$('#fakeSave').hide();
|
||
}, 3000);
|
||
}
|
||
}
|
||
});
|
||
|
||
$('#employee').submit(function (e) {
|
||
e.preventDefault();
|
||
e.stopImmediatePropagation();
|
||
$.ajax({
|
||
type: "POST",
|
||
url: $(this).attr('action'),
|
||
data: $(this).serialize(),
|
||
success: function (response) {
|
||
if (response.isSuccedded === true) {
|
||
$.Notification.autoHideNotify('success', 'top right', response.message);
|
||
setTimeout(function () {
|
||
$("#MainModal").modal('hide');
|
||
$(".datepicker-container").hide();
|
||
}, 500);
|
||
}
|
||
else {
|
||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||
}
|
||
}
|
||
});
|
||
return false;
|
||
});
|
||
|
||
function changecity(element) {
|
||
var text = $(element).children("option").filter(":selected").text();
|
||
$("#hide2").val(text);
|
||
}
|
||
|
||
function childrenValid(){
|
||
var result = true;
|
||
$("#children tbody tr").each(function(index){
|
||
var childName = $(this).find('.childName').val();
|
||
var childBirth = $(this).find('.childBirth').val();
|
||
|
||
if (childName === '' && childBirth !== '' ) {
|
||
$(this).find('.childName').addClass('errored');
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', " لطفا نام فرزند را در ردیف " + (index+1) + " وارد نمایید.");
|
||
result=false;
|
||
return false;
|
||
}
|
||
if (childBirth === '' && childName !== '') {
|
||
$(this).find('.childBirth').addClass('errored');
|
||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', " لطفا تاریخ تولد فرزند را در ردیف " + (index + 1) + " وارد نمایید.");
|
||
result=false;
|
||
return false;
|
||
}
|
||
});
|
||
|
||
return result;
|
||
}
|
||
|
||
</script>
|