Add project files.

This commit is contained in:
2025-07-23 18:54:59 +03:30
parent 429fe73799
commit a0852dd7d8
3356 changed files with 1632271 additions and 0 deletions

View File

@ -0,0 +1,93 @@
"use strict";
// Class definition
var KTAppChat = function () {
var _chatAsideEl;
var _chatAsideOffcanvasObj;
var _chatContentEl;
// Private functions
var _initAside = function () {
// Mobile offcanvas for mobile mode
_chatAsideOffcanvasObj = new KTOffcanvas(_chatAsideEl, {
overlay: true,
baseClass: 'offcanvas-mobile',
//closeBy: 'kt_chat_aside_close',
toggleBy: 'kt_app_chat_toggle'
});
// User listing
var cardScrollEl = KTUtil.find(_chatAsideEl, '.scroll');
var cardBodyEl = KTUtil.find(_chatAsideEl, '.card-body');
var searchEl = KTUtil.find(_chatAsideEl, '.input-group');
if (cardScrollEl) {
// Initialize perfect scrollbar(see: https://github.com/utatti/perfect-scrollbar)
KTUtil.scrollInit(cardScrollEl, {
mobileNativeScroll: true, // Enable native scroll for mobile
desktopNativeScroll: false, // Disable native scroll and use custom scroll for desktop
resetHeightOnDestroy: true, // Reset css height on scroll feature destroyed
handleWindowResize: true, // Recalculate hight on window resize
rememberPosition: true, // Remember scroll position in cookie
height: function() { // Calculate height
var height;
if (KTUtil.isBreakpointUp('lg')) {
height = KTLayoutContent.getHeight();
} else {
height = KTUtil.getViewPort().height;
}
if (_chatAsideEl) {
height = height - parseInt(KTUtil.css(_chatAsideEl, 'margin-top')) - parseInt(KTUtil.css(_chatAsideEl, 'margin-bottom'));
height = height - parseInt(KTUtil.css(_chatAsideEl, 'padding-top')) - parseInt(KTUtil.css(_chatAsideEl, 'padding-bottom'));
}
if (cardScrollEl) {
height = height - parseInt(KTUtil.css(cardScrollEl, 'margin-top')) - parseInt(KTUtil.css(cardScrollEl, 'margin-bottom'));
}
if (cardBodyEl) {
height = height - parseInt(KTUtil.css(cardBodyEl, 'padding-top')) - parseInt(KTUtil.css(cardBodyEl, 'padding-bottom'));
}
if (searchEl) {
height = height - parseInt(KTUtil.css(searchEl, 'height'));
height = height - parseInt(KTUtil.css(searchEl, 'margin-top')) - parseInt(KTUtil.css(searchEl, 'margin-bottom'));
}
// Remove additional space
height = height - 2;
return height;
}
});
}
}
return {
// Public functions
init: function() {
// Elements
_chatAsideEl = KTUtil.getById('kt_chat_aside');
_chatContentEl = KTUtil.getById('kt_chat_content');
// Init aside and user list
_initAside();
// Init inline chat example
KTLayoutChat.setup(KTUtil.getById('kt_chat_content'));
// Trigger click to show popup modal chat on page load
if (KTUtil.getById('kt_app_chat_toggle')) {
setTimeout(function() {
KTUtil.getById('kt_app_chat_toggle').click();
}, 1000);
}
}
};
}();
jQuery(document).ready(function() {
KTAppChat.init();
});

View File

@ -0,0 +1,222 @@
"use strict";
// Class definition
var KTContactsAdd = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _avatar;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "متأسفیم ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفاً دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "متوجه شدم",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change Event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
firstname: {
validators: {
notEmpty: {
message: 'وارد کردن نام اجباری است'
}
}
},
lastname: {
validators: {
notEmpty: {
message: 'وارد کردن نام خانوادگی اجباری است'
}
}
},
companyname: {
validators: {
notEmpty: {
message: 'وارد کردن نام شرکت اجباری است'
}
}
},
phone: {
validators: {
notEmpty: {
message: 'وارد کردن تلفن اجباری است'
},
phone: {
country: 'US',
message: 'این شماره تلفن معتبر ایالات متحده نیست. (e.g 5554443333)'
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: 'ایمیل وارد شده معتبر نمی باشد'
}
}
},
companywebsite: {
validators: {
notEmpty: {
message: 'وب سایت وارد شده معتبر نمی باشد'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
// Step 2
communication: {
validators: {
choice: {
min: 1,
message: 'لطفا یک گزینه را انتخاب کنید'
}
}
},
language: {
validators: {
notEmpty: {
message: 'لطفا زبان را انتخاب کنید'
}
}
},
timezone: {
validators: {
notEmpty: {
message: 'لطفا وقت محلی را انتخاب کنید'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: 'وارد کردن آدرس اجباری است'
}
}
},
postcode: {
validators: {
notEmpty: {
message: 'وارد کردن کد پستی اجباری است'
}
}
},
city: {
validators: {
notEmpty: {
message: 'وارد کردن شهر اجباری است'
}
}
},
state: {
validators: {
notEmpty: {
message: 'وارد کردن استان اجباری است'
}
}
},
country: {
validators: {
notEmpty: {
message: 'وارد کردن کشور اجباری است'
}
}
},
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
var initAvatar = function () {
_avatar = new KTImageInput('kt_contact_add_avatar');
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_contact_add');
_formEl = KTUtil.getById('kt_contact_add_form');
initWizard();
initValidation();
initAvatar();
}
};
}();
jQuery(document).ready(function () {
KTContactsAdd.init();
});

View File

@ -0,0 +1,22 @@
"use strict";
// Class definition
var KTContactsEdit = function () {
// Base elements
var avatar;
var initAvatar = function() {
avatar = new KTImageInput('kt_contacts_edit_avatar');
}
return {
// public functions
init: function() {
initAvatar();
}
};
}();
jQuery(document).ready(function() {
KTContactsEdit.init();
});

View File

@ -0,0 +1,27 @@
"use strict";
// Class definition
var KTContactsListColumns = function () {
// Private functions
var initAside = function () {
// Mobile offcanvas for mobile mode
var offcanvas = new KTOffcanvas('kt_contact_aside', {
overlay: true,
baseClass: 'kt-app__aside',
closeBy: 'kt_contact_aside_close',
toggleBy: 'kt_subheader_mobile_toggle'
});
}
return {
// public functions
init: function() {
initAside();
}
};
}();
KTUtil.ready(function() {
KTContactsListColumns.init();
});

View File

@ -0,0 +1,282 @@
"use strict";
// Class definition
var KTAppsContactsListDatatable = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
pagination: true,
search: {
input: $('#kt_subheader_search_form'),
delay: 400,
key: 'generalSearch'
},
// columns definition
columns: [{
field: 'RecordID',
title: '#',
sortable: 'asc',
width: 40,
type: 'number',
selector: false,
textAlign: 'left',
template: function(data) {
return '<span class="font-weight-bolder">' + data.RecordID + '</span>';
}
}, {
field: 'OrderID',
title: 'مشتری',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 10);
var avatarsGirl = {
1: {'file': '002-girl.svg'},
2: {'file': '003-girl-1.svg'},
3: {'file': '006-girl-3.svg'},
4: {'file': '012-girl-5.svg'},
5: {'file': '013-girl-6.svg'},
6: {'file': '019-girl-10.svg'},
7: {'file': '020-girl-11.svg'},
8: {'file': '030-girl-17.svg'},
9: {'file': '037-girl-20.svg'},
10: {'file': '039-girl-21.svg'}
};
var avatarsBoy = {
1: {'file': '001-boy.svg'},
2: {'file': '004-boy-1.svg'},
3: {'file': '011-boy-5.svg'},
4: {'file': '021-boy-8.svg'},
5: {'file': '032-boy-13.svg'},
6: {'file': '035-boy-15.svg'},
7: {'file': '040-boy-17.svg'},
8: {'file': '045-boy-20.svg'},
9: {'file': '049-boy-22.svg'},
10: {'file': '048-boy-21.svg'}
};
var user_img = '';
if (data.Gender == 'F') {
user_img = avatarsGirl[number].file;
} else {
user_img = avatarsBoy[number].file;
}
var output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-50 symbol-sm flex-shrink-0">\
<div class="symbol-label">\
<img class="h-75 align-self-end" src="assets/media/svg/avatars/' + user_img + '" alt="photo"/>\
</div>\
</div>\
<div class="ml-4">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' + data.CompanyEmail + '</a>\
</div>\
</div>';
return output;
}
}, {
field: 'Country',
title: 'کشور',
template: function(row) {
var output = '';
output += '<div class="font-weight-bolder font-size-lg mb-0">' + row.Country + '</div>';
output += '<div class="font-weight-bold text-muted">Code: ' + row.ShipCountry + '</div>';
return output;
}
}, {
field: 'ShipDate',
title: 'تاریخ حمل',
type: 'date',
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
var status = {
1: {'title': 'Paid', 'class': ' label-light-primary'},
2: {'title': 'Approved', 'class': ' label-light-danger'},
3: {'title': 'در حال انجام', 'class': ' label-light-primary'},
4: {'title': 'Rejected', 'class': ' label-light-success'}
};
var index = KTUtil.getRandomInt(1, 4);
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
output += '<div class="text-muted">' + status[index].title + '</div>';
return output;
},
}, {
field: 'CompanyName',
title: 'نام شرکت',
template: function(row) {
var output = '';
output += '<div class="font-weight-bold text-muted">' + row.CompanyName + '</div>';
return output;
}
}, {
field: 'Status',
title: 'وضعیت',
// callback function support for column rendering
template: function(row) {
var status = {
1: {
'title': 'در حال انجام',
'class': ' label-light-primary'
},
2: {
'title': 'تحویل داده شده',
'class': ' label-light-danger'
},
3: {
'title': 'لغو شده',
'class': ' label-light-primary'
},
4: {
'title': 'موفق',
'class': ' label-light-success'
},
5: {
'title': 'اطلاعات',
'class': ' label-light-info'
},
6: {
'title': 'خطار',
'class': ' label-light-danger'
},
7: {
'title': 'هشدار',
'class': ' label-light-warning'
},
};
return '<span class="label label-lg font-weight-bold ' + status[row.Status].class + ' label-inline">' + status[row.Status].title + '</span>';
},
}, {
field: 'Actions',
title: 'عنوان',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}]
});
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsContactsListDatatable.init();
});

View File

@ -0,0 +1,169 @@
"use strict";
var KTAppsEducationSchoolCalendar = function() {
return {
//main function to initiate the module
init: function() {
var todayDate = moment().startOf('day');
var YM = todayDate.format('YYYY-MM');
var YESTERDAY = todayDate.clone().subtract(1, 'day').format('YYYY-MM-DD');
var TODAY = todayDate.format('YYYY-MM-DD');
var TOMORROW = todayDate.clone().add(1, 'day').format('YYYY-MM-DD');
var calendarEl = document.getElementById('kt_calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'bootstrap', 'interaction', 'dayGrid', 'timeGrid', 'list' ],
themeSystem: 'bootstrap',
isRTL: KTUtil.isRTL(),
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
height: 800,
contentHeight: 780,
aspectRatio: 3, // see: https://fullcalendar.io/docs/aspectRatio
nowIndicator: true,
now: TODAY + 'T09:25:00', // just for demo
views: {
dayGridMonth: { buttonText: 'ماه' },
timeGridWeek: { buttonText: 'هفته' },
timeGridDay: { buttonText: 'روز' }
},
defaultView: 'dayGridMonth',
defaultDate: TODAY,
editable: true,
eventLimit: true, // allow "more" link when too many events
navLinks: true,
events: [
{
title: 'رویداد یک روز کامل',
start: YM + '-01',
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-danger fc-event-solid-warning"
},
{
title: 'گزارش نویسی',
start: YM + '-14T13:30:00',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-14',
className: "fc-event-success"
},
{
title: 'سفر کاری',
start: YM + '-02',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-03',
className: "fc-event-primary"
},
{
title: 'انتشار محصول',
start: YM + '-03',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-05',
className: "fc-event-light fc-event-solid-primary"
},
{
title: 'شام',
start: YM + '-12',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-10'
},
{
id: 999,
title: 'تکرار رویداد',
start: YM + '-09T16:00:00',
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-danger"
},
{
id: 1000,
title: 'تکرار رویداد',
description: 'این یک متن تستی است برای توضیحات',
start: YM + '-16T16:00:00'
},
{
title: 'کنفرانس',
start: YESTERDAY,
end: TOMORROW,
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-primary"
},
{
title: 'ملاقات',
start: TODAY + 'T10:30:00',
end: TODAY + 'T12:30:00',
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ناهار',
start: TODAY + 'T12:00:00',
className: "fc-event-info",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ملاقات',
start: TODAY + 'T14:30:00',
className: "fc-event-warning",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ساعت تولد',
start: TODAY + 'T17:30:00',
className: "fc-event-info",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'شام',
start: TOMORROW + 'T05:00:00',
className: "fc-event-solid-danger fc-event-light",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'جشن تولد',
start: TOMORROW + 'T07:00:00',
className: "fc-event-primary",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'کلیک روی گوگل',
url: 'http://google.com/',
start: YM + '-28',
className: "fc-event-solid-info fc-event-light",
description: 'این یک متن تستی است برای توضیحات',
}
],
eventRender: function(info) {
var element = $(info.el);
if (info.event.extendedProps && info.event.extendedProps.description) {
if (element.hasClass('fc-day-grid-event')) {
element.data('content', info.event.extendedProps.description);
element.data('placement', 'top');
KTApp.initPopover(element);
} else if (element.hasClass('fc-time-grid-event')) {
element.find('.fc-title').append('<div class="fc-description">' + info.event.extendedProps.description + '</div>');
} else if (element.find('.fc-list-item-title').lenght !== 0) {
element.find('.fc-list-item-title').append('<div class="fc-description">' + info.event.extendedProps.description + '</div>');
}
}
}
});
calendar.render();
}
};
}();
jQuery(document).ready(function() {
KTAppsEducationSchoolCalendar.init();
});

View File

@ -0,0 +1,225 @@
"use strict";
// Class definition
var KTAppsEducationSchoolLibrary = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
// enable pagination
pagination: true,
// columns definition
columns: [
{
field: 'CompanyName',
title: 'کتاب',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 13);
var img = number + '.png';
var output = '';
var genreIndex = KTUtil.getRandomInt(1, 4);
var genre = {
1: {'title': 'داستان'},
2: {'title': 'نمایش'},
3: {'title': 'کلاسیک'},
4: {'title': 'دلهره آور'}
};
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-sm flex-shrink-0">\
<img class="" src="assets/media/books/' + img + '" alt="photo">\
</div>\
<div class="ml-4">\
<a href="#" class="text-dark-75 text-hover-primary font-weight-bolder font-size-lg mb-0">' + data.CompanyName + '</a>\
<div class="text-muted font-weight-bold">' + genre[genreIndex].title + '</div>\
</div>\
</div>';
return output;
}
}, {
field: 'CompanyAgent',
title: 'نویسنده',
template: function(row) {
var output = '';
output += '<a href="#" class="text-dark-50 text-hover-primary font-weight-bold">' + row.CompanyAgent + '</a>';
return output;
}
}, {
field: 'IssueDate',
title: 'صادر شده',
type: 'date',
width: 100,
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
var status = {
1: {'title': 'جدید', 'class': ' label-light-primary'},
2: {'title': 'خوب', 'class': ' label-light-danger'},
3: {'title': 'آسیب دیده', 'class': ' label-light-primary'}
};
var index = KTUtil.getRandomInt(1, 3);
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
output += '<div class="text-muted">' + status[index].title + '</div>';
return output;
},
}, {
field: 'Status',
title: 'وضعیت',
autoHide: false,
width: 100,
// callback function support for column rendering
template: function(row) {
var index = KTUtil.getRandomInt(1, 4);
var status = {
1: {'title': 'در دسترس', 'class': ' label-light-primary'},
2: {'title': 'در حال استفاده', 'class': ' label-light-danger'},
3: {'title': 'عدم موجودی', 'class': ' label-light-info'},
4: {'title': 'رسیدن', 'class': ' label-light-success'}
};
return '<span class="label label-lg font-weight-bold ' + status[index].class + ' label-inline">' + status[index].title + '</span>';
},
}, {
field: 'Actions',
title: 'عملیات',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}],
});
$('#kt_datatable_search_status').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Status');
});
$('#kt_datatable_search_type').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Type');
});
//$('#kt_datatable_search_status, #kt_datatable_search_type').selectpicker();
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsEducationSchoolLibrary.init();
});

View File

@ -0,0 +1,249 @@
"use strict";
// Class definition
var KTAppsEducationSchoolTeacher = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
// enable pagination
pagination: true,
// columns definition
columns: [
{
field: 'CompanyName',
title: 'دانشجو',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 10);
var avatarsGirl = {
1: {'file': '002-girl.svg'},
2: {'file': '003-girl-1.svg'},
3: {'file': '006-girl-3.svg'},
4: {'file': '012-girl-5.svg'},
5: {'file': '013-girl-6.svg'},
6: {'file': '019-girl-10.svg'},
7: {'file': '020-girl-11.svg'},
8: {'file': '030-girl-17.svg'},
9: {'file': '037-girl-20.svg'},
10: {'file': '039-girl-21.svg'}
};
var avatarsBoy = {
1: {'file': '001-boy.svg'},
2: {'file': '004-boy-1.svg'},
3: {'file': '011-boy-5.svg'},
4: {'file': '021-boy-8.svg'},
5: {'file': '032-boy-13.svg'},
6: {'file': '035-boy-15.svg'},
7: {'file': '040-boy-17.svg'},
8: {'file': '045-boy-20.svg'},
9: {'file': '049-boy-22.svg'},
10: {'file': '048-boy-21.svg'}
};
var user_img = '';
if (data.Gender == 'F') {
user_img = avatarsGirl[number].file;
} else {
user_img = avatarsBoy[number].file;
}
var output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-50 symbol-sm flex-shrink-0">\
<div class="symbol-label">\
<img class="h-75 align-self-end" src="assets/media/svg/avatars/' + user_img + '" alt="photo"/>\
</div>\
</div>\
<div class="ml-4">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' + data.CompanyEmail + '</a>\
</div>\
</div>';
return output;
}
}, {
field: 'FacultyAgent',
title: 'دانشکده',
template: function(row) {
var output = '';
var genreIndex1 = KTUtil.getRandomInt(1, 5);
var genre = {
1: {'title': ', BA'},
2: {'title': ', BSc'},
3: {'title': ', PhD'},
4: {'title': ', MS'},
5: {'title': ', MA'},
};
output += '<a href="#" class="text-dark-50 text-hover-primary font-weight-bold">' + row.CompanyName + genre[genreIndex1].title + '</a>';
return output;
}
}, {
field: 'JoinedDate',
title: "پیوست",
type: 'date',
width: 100,
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
return output;
},
}, {
field: 'Status',
title: 'وضعیت',
autoHide: false,
width: 100,
// callback function support for column rendering
template: function(row) {
var index = KTUtil.getRandomInt(1, 3);
var status = {
1: {'title': 'جدید', 'class': ' label-light-primary'},
2: {'title': 'فعال', 'class': ' label-light-danger'},
3: {'title': 'غیر فعال', 'class': ' label-light-info'},
};
return '<span class="label label-lg font-weight-bold ' + status[index].class + ' label-inline">' + status[index].title + '</span>';
},
}, {
field: 'Actions',
title: 'عملیات',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}],
});
$('#kt_datatable_search_status').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Status');
});
$('#kt_datatable_search_type').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Type');
});
//$('#kt_datatable_search_status, #kt_datatable_search_type').selectpicker();
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsEducationSchoolTeacher.init();
});

View File

@ -0,0 +1,216 @@
"use strict";
// Class definition
var KTAppsEducationSchoolTeacher = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
// enable pagination
pagination: true,
// columns definition
columns: [
{
field: 'CompanyName',
title: 'معلمان',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 20);
var img = '300_' + number + '.jpg';
var output = '';
var genreIndex = KTUtil.getRandomInt(1, 5);
var genre = {
1: {'title': 'Mathematics, BA'},
2: {'title': 'Geography, BSc'},
3: {'title': 'History, PhD'},
4: {'title': 'Physics, MS'},
5: {'title': 'astronomy, MA'},
};
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-sm flex-shrink-0">\
<img class="" src="assets/media/users/' + img + '" alt="photo">\
</div>\
<div class="ml-4">\
<a href="#" class="text-dark-75 text-hover-primary font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</a>\
<div class="text-muted font-weight-bold">' + genre[genreIndex].title + '</div>\
</div>\
</div>';
return output;
}
}, {
field: 'CompanyAgent',
title: 'دپارتمان',
template: function(row) {
var output = '';
output += '<a href="#" class="text-dark-50 text-hover-primary font-weight-bold">' + row.CompanyName + '</a>';
return output;
}
}, {
field: 'JoinedDate',
title: "پیوست",
type: 'date',
width: 100,
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
return output;
},
}, {
field: 'Status',
title: 'وضعیت',
autoHide: false,
width: 100,
// callback function support for column rendering
template: function(row) {
var index = KTUtil.getRandomInt(1, 3);
var status = {
1: {'title': 'جدید', 'class': ' label-light-primary'},
2: {'title': 'فعال', 'class': ' label-light-danger'},
3: {'title': 'غیر فعال', 'class': ' label-light-info'},
};
return '<span class="label label-lg font-weight-bold ' + status[index].class + ' label-inline">' + status[index].title + '</span>';
},
}, {
field: 'Actions',
title: 'عملیات',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}],
});
$('#kt_datatable_search_status').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Status');
});
$('#kt_datatable_search_type').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Type');
});
//$('#kt_datatable_search_status, #kt_datatable_search_type').selectpicker();
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsEducationSchoolTeacher.init();
});

View File

@ -0,0 +1,169 @@
"use strict";
var KTAppsEducationStudentCalendar = function() {
return {
//main function to initiate the module
init: function() {
var todayDate = moment().startOf('day');
var YM = todayDate.format('YYYY-MM');
var YESTERDAY = todayDate.clone().subtract(1, 'day').format('YYYY-MM-DD');
var TODAY = todayDate.format('YYYY-MM-DD');
var TOMORROW = todayDate.clone().add(1, 'day').format('YYYY-MM-DD');
var calendarEl = document.getElementById('kt_calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'bootstrap', 'interaction', 'dayGrid', 'timeGrid', 'list' ],
themeSystem: 'bootstrap',
isRTL: KTUtil.isRTL(),
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
height: 800,
contentHeight: 780,
aspectRatio: 3, // see: https://fullcalendar.io/docs/aspectRatio
nowIndicator: true,
now: TODAY + 'T09:25:00', // just for demo
views: {
dayGridMonth: { buttonText: 'month' },
timeGridWeek: { buttonText: 'week' },
timeGridDay: { buttonText: 'day' }
},
defaultView: 'dayGridMonth',
defaultDate: TODAY,
editable: true,
eventLimit: true, // allow "more" link when too many events
navLinks: true,
events: [
{
title: 'رویداد یک روز کامل',
start: YM + '-01',
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-danger fc-event-solid-warning"
},
{
title: 'گزارش نویسی',
start: YM + '-14T13:30:00',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-14',
className: "fc-event-success"
},
{
title: 'سفر کاری',
start: YM + '-02',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-03',
className: "fc-event-primary"
},
{
title: 'انتشار محصول',
start: YM + '-03',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-05',
className: "fc-event-light fc-event-solid-primary"
},
{
title: 'شام',
start: YM + '-12',
description: 'این یک متن تستی است برای توضیحات',
end: YM + '-10'
},
{
id: 999,
title: 'تکرار رویداد',
start: YM + '-09T16:00:00',
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-danger"
},
{
id: 1000,
title: 'تکرار رویداد',
description: 'این یک متن تستی است برای توضیحات',
start: YM + '-16T16:00:00'
},
{
title: 'کنفرانس',
start: YESTERDAY,
end: TOMORROW,
description: 'این یک متن تستی است برای توضیحات',
className: "fc-event-primary"
},
{
title: 'ملاقات',
start: TODAY + 'T10:30:00',
end: TODAY + 'T12:30:00',
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ناهار',
start: TODAY + 'T12:00:00',
className: "fc-event-info",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ملاقات',
start: TODAY + 'T14:30:00',
className: "fc-event-warning",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'ساعت تولد',
start: TODAY + 'T17:30:00',
className: "fc-event-info",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'شام',
start: TOMORROW + 'T05:00:00',
className: "fc-event-solid-danger fc-event-light",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'جشن تولد',
start: TOMORROW + 'T07:00:00',
className: "fc-event-primary",
description: 'این یک متن تستی است برای توضیحات',
},
{
title: 'کلیک روی گوگل',
url: 'http://google.com/',
start: YM + '-28',
className: "fc-event-solid-info fc-event-light",
description: 'این یک متن تستی است برای توضیحات',
}
],
eventRender: function(info) {
var element = $(info.el);
if (info.event.extendedProps && info.event.extendedProps.description) {
if (element.hasClass('fc-day-grid-event')) {
element.data('content', info.event.extendedProps.description);
element.data('placement', 'top');
KTApp.initPopover(element);
} else if (element.hasClass('fc-time-grid-event')) {
element.find('.fc-title').append('<div class="fc-description">' + info.event.extendedProps.description + '</div>');
} else if (element.find('.fc-list-item-title').lenght !== 0) {
element.find('.fc-list-item-title').append('<div class="fc-description">' + info.event.extendedProps.description + '</div>');
}
}
}
});
calendar.render();
}
};
}();
jQuery(document).ready(function() {
KTAppsEducationStudentCalendar.init();
});

View File

@ -0,0 +1,22 @@
"use strict";
// Class definition
var KTAppsEducationStudentProfile = function () {
// Base elements
var avatar;
var initAvatar = function() {
avatar = new KTImageInput('kt_user_avatar');
}
return {
// public functions
init: function() {
initAvatar();
}
};
}();
jQuery(document).ready(function() {
KTAppsEducationStudentProfile.init();
});

View File

@ -0,0 +1,574 @@
"use strict";
// Class definition
var KTAppInbox = function() {
// Private properties
var _asideEl;
var _listEl;
var _viewEl;
var _composeEl;
var _replyEl;
var _asideOffcanvas;
// Private methods
var _initEditor = function(form, editor) {
// init editor
var options = {
modules: {
toolbar: {}
},
placeholder: 'پیام را تایپ کنید ...',
theme: 'snow'
};
// Init editor
var editor = new Quill('#' + editor, options);
// Customize editor
var toolbar = KTUtil.find(form, '.ql-toolbar');
var editor = KTUtil.find(form, '.ql-editor');
if (toolbar) {
KTUtil.addClass(toolbar, 'px-5 border-top-0 border-left-0 border-right-0');
}
if (editor) {
KTUtil.addClass(editor, 'px-8');
}
}
var _initForm = function(formEl) {
var formEl = KTUtil.getById(formEl);
// Init autocompletes
var toEl = KTUtil.find(formEl, '[name=compose_to]');
var tagifyTo = new Tagify(toEl, {
delimiters: ", ", // add new tags when a comma or a space character is entered
maxTags: 10,
blacklist: ["fuck", "shit", "pussy"],
keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)
whitelist: [{
value: 'Chris Muller',
email: 'chris.muller@wix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_11.jpg',
class: 'tagify__tag--primary'
}, {
value: 'Nick Bold',
email: 'nick.seo@gmail.com',
initials: 'SS',
initialsState: 'warning',
pic: ''
}, {
value: 'Alon Silko',
email: 'alon@keenthemes.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_6.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_8.jpg'
}, {
value: 'Sara Loran',
email: 'sara.loran@tilda.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_9.jpg'
}, {
value: 'Eric Davok',
email: 'davok@mix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Lina Nilson',
email: 'lina.nilson@loop.com',
initials: 'LN',
initialsState: 'danger',
pic: './assets/media/users/100_15.jpg'
}],
templates: {
dropdownItem: function(tagData) {
try {
var html = '';
html += '<div class="tagify__dropdown__item">';
html += ' <div class="d-flex align-items-center">';
html += ' <span class="symbol sumbol-' + (tagData.initialsState ? tagData.initialsState : '') + ' mr-2">';
html += ' <span class="symbol-label" style="background-image: url(\''+ (tagData.pic ? tagData.pic : '') + '\')">' + (tagData.initials ? tagData.initials : '') + '</span>';
html += ' </span>';
html += ' <div class="d-flex flex-column">';
html += ' <a href="#" class="text-dark-75 text-hover-primary font-weight-bold">'+ (tagData.value ? tagData.value : '') + '</a>';
html += ' <span class="text-muted font-weight-bold">' + (tagData.email ? tagData.email : '') + '</span>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
} catch (err) {}
}
},
transformTag: function(tagData) {
tagData.class = 'tagify__tag tagify__tag--primary';
},
dropdown: {
classname: "color-blue",
enabled: 1,
maxItems: 5
}
});
var ccEl = KTUtil.find(formEl, '[name=compose_cc]');
var tagifyCc = new Tagify(ccEl, {
delimiters: ", ", // add new tags when a comma or a space character is entered
maxTags: 10,
blacklist: ["fuck", "shit", "pussy"],
keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)
whitelist: [{
value: 'Chris Muller',
email: 'chris.muller@wix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_11.jpg',
class: 'tagify__tag--primary'
}, {
value: 'Nick Bold',
email: 'nick.seo@gmail.com',
initials: 'SS',
initialsState: 'warning',
pic: ''
}, {
value: 'Alon Silko',
email: 'alon@keenthemes.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_6.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_8.jpg'
}, {
value: 'Sara Loran',
email: 'sara.loran@tilda.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_9.jpg'
}, {
value: 'Eric Davok',
email: 'davok@mix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Lina Nilson',
email: 'lina.nilson@loop.com',
initials: 'LN',
initialsState: 'danger',
pic: './assets/media/users/100_15.jpg'
}],
templates: {
dropdownItem: function(tagData) {
try {
var html = '';
html += '<div class="tagify__dropdown__item">';
html += ' <div class="d-flex align-items-center">';
html += ' <span class="symbol sumbol-' + (tagData.initialsState ? tagData.initialsState : '') + ' mr-2" style="background-image: url(\''+ (tagData.pic ? tagData.pic : '') + '\')">';
html += ' <span class="symbol-label">' + (tagData.initials ? tagData.initials : '') + '</span>';
html += ' </span>';
html += ' <div class="d-flex flex-column">';
html += ' <a href="#" class="text-dark-75 text-hover-primary font-weight-bold">'+ (tagData.value ? tagData.value : '') + '</a>';
html += ' <span class="text-muted font-weight-bold">' + (tagData.email ? tagData.email : '') + '</span>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
} catch (err) {}
}
},
transformTag: function(tagData) {
tagData.class = 'tagify__tag tagify__tag--primary';
},
dropdown: {
classname: "color-blue",
enabled: 1,
maxItems: 5
}
});
var bccEl = KTUtil.find(formEl, '[name=compose_bcc]');
var tagifyBcc = new Tagify(bccEl, {
delimiters: ", ", // add new tags when a comma or a space character is entered
maxTags: 10,
blacklist: ["fuck", "shit", "pussy"],
keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)
whitelist: [{
value: 'Chris Muller',
email: 'chris.muller@wix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_11.jpg',
class: 'tagify__tag--primary'
}, {
value: 'Nick Bold',
email: 'nick.seo@gmail.com',
initials: 'SS',
initialsState: 'warning',
pic: ''
}, {
value: 'Alon Silko',
email: 'alon@keenthemes.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_6.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_8.jpg'
}, {
value: 'Sara Loran',
email: 'sara.loran@tilda.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_9.jpg'
}, {
value: 'Eric Davok',
email: 'davok@mix.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Sam Seanic',
email: 'sam.senic@loop.com',
initials: '',
initialsState: '',
pic: './assets/media/users/100_13.jpg'
}, {
value: 'Lina Nilson',
email: 'lina.nilson@loop.com',
initials: 'LN',
initialsState: 'danger',
pic: './assets/media/users/100_15.jpg'
}],
templates: {
dropdownItem: function(tagData) {
try {
var html = '';
html += '<div class="tagify__dropdown__item">';
html += ' <div class="d-flex align-items-center">';
html += ' <span class="symbol sumbol-' + (tagData.initialsState ? tagData.initialsState : '') + ' mr-2" style="background-image: url(\''+ (tagData.pic ? tagData.pic : '') + '\')">';
html += ' <span class="symbol-label">' + (tagData.initials ? tagData.initials : '') + '</span>';
html += ' </span>';
html += ' <div class="d-flex flex-column">';
html += ' <a href="#" class="text-dark-75 text-hover-primary font-weight-bold">'+ (tagData.value ? tagData.value : '') + '</a>';
html += ' <span class="text-muted font-weight-bold">' + (tagData.email ? tagData.email : '') + '</span>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
} catch (err) {}
}
},
transformTag: function(tagData) {
tagData.class = 'tagify__tag tagify__tag--primary';
},
dropdown: {
classname: "color-blue",
enabled: 1,
maxItems: 5
}
});
// CC input show
KTUtil.on(formEl, '[data-inbox="cc-show"]', 'click', function(e) {
var inputEl = KTUtil.find(formEl, '.inbox-to-cc');
KTUtil.removeClass(inputEl, 'd-none');
KTUtil.addClass(inputEl, 'd-flex');
KTUtil.find(formEl, "[name=compose_cc]").focus();
});
// CC input hide
KTUtil.on(formEl, '[data-inbox="cc-hide"]', 'click', function(e) {
var inputEl = KTUtil.find(formEl, '.inbox-to-cc');
KTUtil.removeClass(inputEl, 'd-flex');
KTUtil.addClass(inputEl, 'd-none');
});
// BCC input show
KTUtil.on(formEl, '[data-inbox="bcc-show"]', 'click', function(e) {
var inputEl = KTUtil.find(formEl, '.inbox-to-bcc');
KTUtil.removeClass(inputEl, 'd-none');
KTUtil.addClass(inputEl, 'd-flex');
KTUtil.find(formEl, "[name=compose_bcc]").focus();
});
// BCC input hide
KTUtil.on(formEl, '[data-inbox="bcc-hide"]', 'click', function(e) {
var inputEl = KTUtil.find(formEl, '.inbox-to-bcc');
KTUtil.removeClass(inputEl, 'd-flex');
KTUtil.addClass(inputEl, 'd-none');
});
}
var _initAttachments = function(elemId) {
var id = "#" + elemId;
var previewNode = $(id + " .dropzone-item");
previewNode.id = "";
var previewTemplate = previewNode.parent('.dropzone-items').html();
previewNode.remove();
var myDropzone = new Dropzone(id, { // Make the whole body a dropzone
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
parallelUploads: 20,
maxFilesize: 1, // Max filesize in MB
previewTemplate: previewTemplate,
previewsContainer: id + " .dropzone-items", // Define the container to display the previews
clickable: id + "_select" // Define the element that should be used as click trigger to select files.
});
myDropzone.on("addedfile", function(file) {
// Hookup the start button
$(document).find(id + ' .dropzone-item').css('display', '');
});
// Update the total progress bar
myDropzone.on("totaluploadprogress", function(progress) {
document.querySelector(id + " .progress-bar").style.width = progress + "%";
});
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts
document.querySelector(id + " .progress-bar").style.opacity = "1";
});
// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("complete", function(progress) {
var thisProgressBar = id + " .dz-complete";
setTimeout(function() {
$(thisProgressBar + " .progress-bar, " + thisProgressBar + " .progress").css('opacity', '0');
}, 300)
});
}
// Public methods
return {
// Public functions
init: function() {
// Init variables
_asideEl = KTUtil.getById('kt_inbox_aside');
_listEl = KTUtil.getById('kt_inbox_list');
_viewEl = KTUtil.getById('kt_inbox_view');
_composeEl = KTUtil.getById('kt_inbox_compose');
_replyEl = KTUtil.getById('kt_inbox_reply');
// Init handlers
KTAppInbox.initAside();
KTAppInbox.initList();
KTAppInbox.initView();
KTAppInbox.initReply();
KTAppInbox.initCompose();
},
initAside: function() {
// Mobile offcanvas for mobile mode
_asideOffcanvas = new KTOffcanvas(_asideEl, {
overlay: true,
baseClass: 'offcanvas-mobile',
//closeBy: 'kt_inbox_aside_close',
toggleBy: 'kt_subheader_mobile_toggle'
});
// View list
KTUtil.on(_asideEl, '.list-item[data-action="list"]', 'click', function(e) {
var type = KTUtil.attr(this, 'data-type');
var listItemsEl = KTUtil.find(_listEl, '.kt-inbox__items');
var navItemEl = this.closest('.kt-nav__item');
var navItemActiveEl = KTUtil.find(_asideEl, '.kt-nav__item.kt-nav__item--active');
// demo loading
var loading = new KTDialog({
'type': 'loader',
'placement': 'top center',
'message': 'Loading ...'
});
loading.show();
setTimeout(function() {
loading.hide();
KTUtil.css(_listEl, 'display', 'flex'); // show list
KTUtil.css(_viewEl, 'display', 'none'); // hide view
KTUtil.addClass(navItemEl, 'kt-nav__item--active');
KTUtil.removeClass(navItemActiveEl, 'kt-nav__item--active');
KTUtil.attr(listItemsEl, 'data-type', type);
}, 600);
});
},
initList: function() {
// View message
KTUtil.on(_listEl, '[data-inbox="message"]', 'click', function(e) {
var actionsEl = KTUtil.find(this, '[data-inbox="actions"]');
// skip actions click
if (e.target === actionsEl || (actionsEl && actionsEl.contains(e.target) === true)) {
return false;
}
// Demo loading
var loading = new KTDialog({
'type': 'loader',
'placement': 'top center',
'message': 'Loading ...'
});
loading.show();
setTimeout(function() {
loading.hide();
KTUtil.addClass(_listEl, 'd-none');
KTUtil.removeClass(_listEl, 'd-block');
KTUtil.addClass(_viewEl, 'd-block');
KTUtil.removeClass(_viewEl, 'd-none');
}, 700);
});
// Group selection
KTUtil.on(_listEl, '[data-inbox="group-select"] input', 'click', function() {
var messages = KTUtil.findAll(_listEl, '[data-inbox="message"]');
for (var i = 0, j = messages.length; i < j; i++) {
var message = messages[i];
var checkbox = KTUtil.find(message, '.checkbox input');
checkbox.checked = this.checked;
if (this.checked) {
KTUtil.addClass(message, 'active');
} else {
KTUtil.removeClass(message, 'active');
}
}
});
// Individual selection
KTUtil.on(_listEl, '[data-inbox="message"] [data-inbox="actions"] .checkbox input', 'click', function() {
var item = this.closest('[data-inbox="message"]');
if (item && this.checked) {
KTUtil.addClass(item, 'active');
} else {
KTUtil.removeClass(item, 'active');
}
});
},
initView: function() {
// Back to listing
KTUtil.on(_viewEl, '[data-inbox="back"]', 'click', function() {
// demo loading
var loading = new KTDialog({
'type': 'loader',
'placement': 'top center',
'message': 'Loading ...'
});
loading.show();
setTimeout(function() {
loading.hide();
KTUtil.addClass(_listEl, 'd-block');
KTUtil.removeClass(_listEl, 'd-none');
KTUtil.addClass(_viewEl, 'd-none');
KTUtil.removeClass(_viewEl, 'd-block');
}, 700);
});
// Expand/Collapse reply
KTUtil.on(_viewEl, '[data-inbox="message"]', 'click', function(e) {
var message = this.closest('[data-inbox="message"]');
var dropdownToggleEl = KTUtil.find(this, '[data-toggle="dropdown"]');
var toolbarEl = KTUtil.find(this, '[data-inbox="toolbar"]');
// skip dropdown toggle click
if (e.target === dropdownToggleEl || (dropdownToggleEl && dropdownToggleEl.contains(e.target) === true)) {
return false;
}
// skip group actions click
if (e.target === toolbarEl || (toolbarEl && toolbarEl.contains(e.target) === true)) {
return false;
}
if (KTUtil.hasClass(message, 'toggle-on')) {
KTUtil.addClass(message, 'toggle-off');
KTUtil.removeClass(message, 'toggle-on');
} else {
KTUtil.removeClass(message, 'toggle-off');
KTUtil.addClass(message, 'toggle-on');
}
});
},
initReply: function() {
_initEditor(_replyEl, 'kt_inbox_reply_editor');
_initAttachments('kt_inbox_reply_attachments');
_initForm('kt_inbox_reply_form');
},
initCompose: function() {
_initEditor(_composeEl, 'kt_inbox_compose_editor');
_initAttachments('kt_inbox_compose_attachments');
_initForm('kt_inbox_compose_form');
// Remove reply form
KTUtil.on(_composeEl, '[data-inbox="dismiss"]', 'click', function(e) {
swal.fire({
text: "Are you sure to discard this message ?",
type: "danger",
buttonsStyling: false,
confirmButtonText: "Discard draft",
confirmButtonClass: "btn btn-danger",
showCancelButton: true,
cancelButtonText: "Cancel",
cancelButtonClass: "btn btn-light-primary"
}).then(function(result) {
$(_composeEl).modal('hide');
});
});
}
};
}();
// Class Initialization
jQuery(document).ready(function() {
KTAppInbox.init();
});

View File

@ -0,0 +1,413 @@
"use strict";
// Class Definition
var KTLogin = function() {
var _buttonSpinnerClasses = 'spinner spinner-right spinner-white pr-15';
var _handleFormSignin = function() {
var form = KTUtil.getById('kt_login_singin_form');
var formSubmitUrl = KTUtil.attr(form, 'action');
var formSubmitButton = KTUtil.getById('kt_login_singin_form_submit_button');
if (!form) {
return;
}
FormValidation
.formValidation(
form,
{
fields: {
username: {
validators: {
notEmpty: {
message: 'وارد کردن نام کاربری اجباری است'
}
}
},
password: {
validators: {
notEmpty: {
message: 'وارد کردن کلمه عبور اجباری است'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
//defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation
bootstrap: new FormValidation.plugins.Bootstrap({
// eleInvalidClass: '', // Repace with uncomment to hide bootstrap validation icons
// eleValidClass: '', // Repace with uncomment to hide bootstrap validation icons
})
}
}
)
.on('core.form.valid', function() {
// Show loading state on button
KTUtil.btnWait(formSubmitButton, _buttonSpinnerClasses, "لطفا صبر کنید");
// Simulate Ajax request
setTimeout(function() {
KTUtil.btnRelease(formSubmitButton);
}, 2000);
// Form Validation & Ajax Submission: https://formvalidation.io/guide/examples/using-ajax-to-submit-the-form
/**
FormValidation.utils.fetch(formSubmitUrl, {
method: 'POST',
dataType: 'json',
params: {
name: form.querySelector('[name="username"]').value,
email: form.querySelector('[name="password"]').value,
},
}).then(function(response) { // Return valid JSON
// Release button
KTUtil.btnRelease(formSubmitButton);
if (response && typeof response === 'object' && response.status && response.status == 'success') {
Swal.fire({
text: "همه چیز جالب است! اکنون این فرم را ارسال می کنید",
icon: "success",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
} else {
Swal.fire({
text: "ببخشید ، مشکلی پیش آمد ، لطفاً دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
**/
})
.on('core.form.invalid', function() {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
});
}
var _handleFormForgot = function() {
var form = KTUtil.getById('kt_login_forgot_form');
var formSubmitUrl = KTUtil.attr(form, 'action');
var formSubmitButton = KTUtil.getById('kt_login_forgot_form_submit_button');
if (!form) {
return;
}
FormValidation
.formValidation(
form,
{
fields: {
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
//defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation
bootstrap: new FormValidation.plugins.Bootstrap({
// eleInvalidClass: '', // Repace with uncomment to hide bootstrap validation icons
// eleValidClass: '', // Repace with uncomment to hide bootstrap validation icons
})
}
}
)
.on('core.form.valid', function() {
// Show loading state on button
KTUtil.btnWait(formSubmitButton, _buttonSpinnerClasses, "لطفا صبر کنید");
// Simulate Ajax request
setTimeout(function() {
KTUtil.btnRelease(formSubmitButton);
}, 2000);
})
.on('core.form.invalid', function() {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
});
}
var _handleFormSignup = function() {
// Base elements
var wizardEl = KTUtil.getById('kt_login');
var form = KTUtil.getById('kt_login_signup_form');
var wizardObj;
var validations = [];
if (!form) {
return;
}
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
validations.push(FormValidation.formValidation(
form,
{
fields: {
fname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lname: {
validators: {
notEmpty: {
message: "نام خانوادگی لازم است"
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
validations.push(FormValidation.formValidation(
form,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
validations.push(FormValidation.formValidation(
form,
{
fields: {
delivery: {
validators: {
notEmpty: {
message: "نوع تحویل الزامی است"
}
}
},
packaging: {
validators: {
notEmpty: {
message: 'نوع بسته بندی لازم است'
}
}
},
preferreddelivery: {
validators: {
notEmpty: {
message: "نحوه ی تحویل لازم است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 4
validations.push(FormValidation.formValidation(
form,
{
fields: {
ccname: {
validators: {
notEmpty: {
message: 'نام کارت اعتباری الزامی است'
}
}
},
ccnumber: {
validators: {
notEmpty: {
message: "شماره کارت اعتباری لازم است"
},
creditCard: {
message: "شماره کارت اعتباری معتبر نیست"
}
}
},
ccmonth: {
validators: {
notEmpty: {
message: "ماه کارت اعتباری لازم است"
}
}
},
ccyear: {
validators: {
notEmpty: {
message: "سال کارت اعتباری لازم است"
}
}
},
cccvv: {
validators: {
notEmpty: {
message: "CVV کارت اعتباری لازم است"
},
digits: {
message: "مقدار CVV معتبر نیست. فقط شماره مجاز است "
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Initialize form wizard
wizardObj = new KTWizard(wizardEl, {
startStep: 1, // initial active step number
clickableSteps: false // to make steps clickable this set value true and add data-wizard-clickable="true" in HTML for class="wizard" element
});
// Validation before going to next page
wizardObj.on('beforeNext', function (wizard) {
validations[wizard.getStep() - 1].validate().then(function (status) {
if (status == 'Valid') {
wizardObj.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
wizardObj.stop(); // Don't go to the next step
});
// Change event
wizardObj.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
// Public Functions
return {
init: function() {
_handleFormSignin();
_handleFormForgot();
_handleFormSignup();
}
};
}();
// Class Initialization
jQuery(document).ready(function() {
KTLogin.init();
});

View File

@ -0,0 +1,326 @@
"use strict";
// Class Definition
var KTLogin = function() {
var _buttonSpinnerClasses = 'spinner spinner-right spinner-white pr-15';
var _handleFormSignin = function() {
var form = KTUtil.getById('kt_login_singin_form');
var formSubmitUrl = KTUtil.attr(form, 'action');
var formSubmitButton = KTUtil.getById('kt_login_singin_form_submit_button');
if (!form) {
return;
}
FormValidation
.formValidation(
form,
{
fields: {
username: {
validators: {
notEmpty: {
message: 'وارد کردن نام کاربری اجباری است'
}
}
},
password: {
validators: {
notEmpty: {
message: 'وارد کردن کلمه عبور اجباری است'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
//defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation
bootstrap: new FormValidation.plugins.Bootstrap({
// eleInvalidClass: '', // Repace with uncomment to hide bootstrap validation icons
// eleValidClass: '', // Repace with uncomment to hide bootstrap validation icons
})
}
}
)
.on('core.form.valid', function() {
// Show loading state on button
KTUtil.btnWait(formSubmitButton, _buttonSpinnerClasses, "لطفا صبر کنید");
// Simulate Ajax request
setTimeout(function() {
KTUtil.btnRelease(formSubmitButton);
}, 2000);
// Form Validation & Ajax Submission: https://formvalidation.io/guide/examples/using-ajax-to-submit-the-form
/**
FormValidation.utils.fetch(formSubmitUrl, {
method: 'POST',
dataType: 'json',
params: {
name: form.querySelector('[name="username"]').value,
email: form.querySelector('[name="password"]').value,
},
}).then(function(response) { // Return valid JSON
// Release button
KTUtil.btnRelease(formSubmitButton);
if (response && typeof response === 'object' && response.status && response.status == 'success') {
Swal.fire({
text: "همه چیز جالب است! اکنون این فرم را ارسال می کنید",
icon: "success",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
} else {
Swal.fire({
text: "ببخشید ، مشکلی پیش آمد ، لطفاً دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
**/
})
.on('core.form.invalid', function() {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
});
}
var _handleFormForgot = function() {
var form = KTUtil.getById('kt_login_forgot_form');
var formSubmitUrl = KTUtil.attr(form, 'action');
var formSubmitButton = KTUtil.getById('kt_login_forgot_form_submit_button');
if (!form) {
return;
}
FormValidation
.formValidation(
form,
{
fields: {
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
//defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation
bootstrap: new FormValidation.plugins.Bootstrap({
// eleInvalidClass: '', // Repace with uncomment to hide bootstrap validation icons
// eleValidClass: '', // Repace with uncomment to hide bootstrap validation icons
})
}
}
)
.on('core.form.valid', function() {
// Show loading state on button
KTUtil.btnWait(formSubmitButton, _buttonSpinnerClasses, "لطفا صبر کنید");
// Simulate Ajax request
setTimeout(function() {
KTUtil.btnRelease(formSubmitButton);
}, 2000);
})
.on('core.form.invalid', function() {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
});
}
var _handleFormSignup = function() {
// Base elements
var wizardEl = KTUtil.getById('kt_login');
var form = KTUtil.getById('kt_login_signup_form');
var wizardObj;
var validations = [];
if (!form) {
return;
}
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
validations.push(FormValidation.formValidation(
form,
{
fields: {
fname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lname: {
validators: {
notEmpty: {
message: "نام خانوادگی لازم است"
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
validations.push(FormValidation.formValidation(
form,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Initialize form wizard
wizardObj = new KTWizard(wizardEl, {
startStep: 1, // initial active step number
clickableSteps: false // to make steps clickable this set value true and add data-wizard-clickable="true" in HTML for class="wizard" element
});
// Validation before going to next page
wizardObj.on('beforeNext', function (wizard) {
validations[wizard.getStep() - 1].validate().then(function (status) {
if (status == 'Valid') {
wizardObj.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
wizardObj.stop(); // Don't go to the next step
});
// Change event
wizardObj.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
// Public Functions
return {
init: function() {
_handleFormSignin();
_handleFormForgot();
_handleFormSignup();
}
};
}();
// Class Initialization
jQuery(document).ready(function() {
KTLogin.init();
});

View File

@ -0,0 +1,272 @@
"use strict";
// Class Definition
var KTLogin = function() {
var _login;
var _showForm = function(form) {
var cls = 'login-' + form + '-on';
var form = 'kt_login_' + form + '_form';
_login.removeClass('login-forgot-on');
_login.removeClass('login-signin-on');
_login.removeClass('login-signup-on');
_login.addClass(cls);
KTUtil.animateClass(KTUtil.getById(form), 'animate__animated animate__backInUp');
}
var _handleSignInForm = function() {
var validation;
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
validation = FormValidation.formValidation(
KTUtil.getById('kt_login_signin_form'),
{
fields: {
username: {
validators: {
notEmpty: {
message: 'وارد کردن نام کاربری اجباری است'
}
}
},
password: {
validators: {
notEmpty: {
message: 'وارد کردن کلمه عبور اجباری است'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
//defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
);
$('#kt_login_signin_submit').on('click', function (e) {
e.preventDefault();
validation.validate().then(function(status) {
if (status == 'Valid') {
swal.fire({
text: "همه چیز جالب است! اکنون این فرم را ارسال می کنید",
icon: "success",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
} else {
swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
});
// Handle forgot button
$('#kt_login_forgot').on('click', function (e) {
e.preventDefault();
_showForm('forgot');
});
// Handle signup
$('#kt_login_signup').on('click', function (e) {
e.preventDefault();
_showForm('signup');
});
}
var _handleSignUpForm = function(e) {
var validation;
var form = KTUtil.getById('kt_login_signup_form');
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
validation = FormValidation.formValidation(
form,
{
fields: {
fullname: {
validators: {
notEmpty: {
message: 'وارد کردن نام کاربری اجباری است'
}
}
},
email: {
validators: {
notEmpty: {
message: 'آدرس ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
},
password: {
validators: {
notEmpty: {
message: 'The password is required'
}
}
},
cpassword: {
validators: {
notEmpty: {
message: "تأیید رمز عبور لازم است"
},
identical: {
compare: function() {
return form.querySelector('[name="password"]').value;
},
message: "رمز عبور و تأیید آن یکسان نیستند"
}
}
},
agree: {
validators: {
notEmpty: {
message: 'شما باید قوانین و ضوابط را بپذیرید'
}
}
},
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
);
$('#kt_login_signup_submit').on('click', function (e) {
e.preventDefault();
validation.validate().then(function(status) {
if (status == 'Valid') {
swal.fire({
text: "همه چیز جالب است! اکنون این فرم را ارسال می کنید",
icon: "success",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
} else {
swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
});
// Handle cancel button
$('#kt_login_signup_cancel').on('click', function (e) {
e.preventDefault();
_showForm('signin');
});
}
var _handleForgotForm = function(e) {
var validation;
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
validation = FormValidation.formValidation(
KTUtil.getById('kt_login_forgot_form'),
{
fields: {
email: {
validators: {
notEmpty: {
message: 'آدرس ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
);
// Handle submit button
$('#kt_login_forgot_submit').on('click', function (e) {
e.preventDefault();
validation.validate().then(function(status) {
if (status == 'Valid') {
// Submit form
KTUtil.scrollTop();
} else {
swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light-primary"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
});
// Handle cancel button
$('#kt_login_forgot_cancel').on('click', function (e) {
e.preventDefault();
_showForm('signin');
});
}
// Public Functions
return {
// public functions
init: function() {
_login = $('#kt_login');
_handleSignInForm();
_handleSignUpForm();
_handleForgotForm();
}
};
}();
// Class Initialization
jQuery(document).ready(function() {
KTLogin.init();
});

View File

@ -0,0 +1,35 @@
"use strict";
// Class definition
var KTProfile = function () {
// Elements
var avatar;
var offcanvas;
// Private functions
var _initAside = function () {
// Mobile offcanvas for mobile mode
offcanvas = new KTOffcanvas('kt_profile_aside', {
overlay: true,
baseClass: 'offcanvas-mobile',
//closeBy: 'kt_user_profile_aside_close',
toggleBy: 'kt_subheader_mobile_toggle'
});
}
var _initForm = function() {
avatar = new KTImageInput('kt_profile_avatar');
}
return {
// public functions
init: function() {
_initAside();
_initForm();
}
};
}();
jQuery(document).ready(function() {
KTProfile.init();
});

View File

@ -0,0 +1,222 @@
"use strict";
// Class definition
var KTProjectsAdd = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _avatar;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change Event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
// Form Validation
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
projectname: {
validators: {
notEmpty: {
message: 'نام پروژه ضروری است'
}
}
},
projectowner: {
validators: {
notEmpty: {
message: "مالک پروژه لازم است"
}
}
},
customername: {
validators: {
notEmpty: {
message: "نام مشتری لازم است"
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
},
phone: {
country: 'US',
message: "این تعداد شماره تلفن معتبر ایالات متحده نیست. (به عنوان مثال 5554443333) "
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
},
companywebsite: {
validators: {
notEmpty: {
message: 'آدرس وب سایت لازم است'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
// Step 2
communication: {
validators: {
choice: {
min: 1,
message: "لطفا حداقل 1 گزینه را انتخاب کنید"
}
}
},
language: {
validators: {
notEmpty: {
message: "لطفا یک زبان را انتخاب کنید"
}
}
},
timezone: {
validators: {
notEmpty: {
message: "لطفا منطقه زمانی را انتخاب کنید"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
},
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
var initAvatar = function () {
_avatar = new KTImageInput('kt_projects_add_avatar');
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_projects_add');
_formEl = KTUtil.getById('kt_projects_add_form');
initWizard();
initValidation();
initAvatar();
}
};
}();
jQuery(document).ready(function () {
KTProjectsAdd.init();
});

View File

@ -0,0 +1,288 @@
"use strict";
// Class definition
var KTAppsProjectsListDatatable = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
pagination: true,
search: {
input: $('#kt_subheader_search_form'),
delay: 400,
key: 'generalSearch'
},
// columns definition
columns: [{
field: 'RecordID',
title: '#',
sortable: 'asc',
width: 40,
type: 'number',
selector: false,
textAlign: 'left',
template: function(data) {
return '<span class="font-weight-bolder">' + data.RecordID + '</span>';
}
}, {
field: 'OrderID',
title: 'مشتری',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 10);
var img = number + '.png';
var skills = [
'Angular, React',
'Vue, Kendo',
'.NET, Oracle, MySQL',
'Node, SASS, Webpack',
'MangoDB, Java',
'HTML5, jQuery, CSS3',
'React, Vue',
'MangoDB, Node.js'
];
var output = '';
if (number < 7) {
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-circle symbol-sm">\
<img class="" src="assets/media/project-logos/' + img + '" alt="photo"/>\
</div>\
<div class="ml-3">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' +
skills[number -1] + '</a>\
</div>\
</div>';
} else {
var stateNo = KTUtil.getRandomInt(0, 7);
var states = [
'success',
'primary',
'danger',
'success',
'warning',
'dark',
'primary',
'info'
];
var state = states[stateNo];
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-circle symbol-light-' + state + '">\
<span class="symbol-label font-size-h4">' + data.CompanyAgent.substring(0, 1) + '</span>\
</div>\
<div class="ml-3">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' +
skills[number - 4] + '</a>\
</div>\
</div>';
}
return output;
},
}, {
field: 'Country',
title: 'کشور',
template: function(row) {
var output = '';
output += '<div class="font-weight-bolder font-size-lg mb-0">' + row.Country + '</div>';
output += '<div class="font-weight-bold text-muted">Code: ' + row.ShipCountry + '</div>';
return output;
}
}, {
field: 'ShipDate',
title: 'تاریخ حمل',
type: 'date',
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
var status = {
1: {'title': 'Paid', 'class': ' label-light-primary'},
2: {'title': 'Approved', 'class': ' label-light-danger'},
3: {'title': 'در حال انجام', 'class': ' label-light-primary'},
4: {'title': 'Rejected', 'class': ' label-light-success'}
};
var index = KTUtil.getRandomInt(1, 4);
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
output += '<div class="text-muted">' + status[index].title + '</div>';
return output;
},
}, {
field: 'CompanyName',
title: 'نام شرکت',
template: function(row) {
var output = '';
output += '<div class="font-weight-bold text-muted">' + row.CompanyName + '</div>';
return output;
}
}, {
field: 'Status',
title: 'وضعیت',
// callback function support for column rendering
template: function(row) {
var status = {
1: {
'title': 'در حال انجام',
'class': ' label-light-primary'
},
2: {
'title': 'تحویل داده شده',
'class': ' label-light-danger'
},
3: {
'title': 'لغو شده',
'class': ' label-light-primary'
},
4: {
'title': 'موفق',
'class': ' label-light-success'
},
5: {
'title': 'اطلاعات',
'class': ' label-light-info'
},
6: {
'title': 'خطار',
'class': ' label-light-danger'
},
7: {
'title': 'هشدار',
'class': ' label-light-warning'
},
};
return '<span class="label label-lg font-weight-bold ' + status[row.Status].class + ' label-inline">' + status[row.Status].title + '</span>';
},
}, {
field: 'Actions',
title: 'عملیات',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}]
});
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsProjectsListDatatable.init();
});

View File

@ -0,0 +1,232 @@
"use strict";
// Class definition
var KTAppTodo = function() {
// Private properties
var _asideEl;
var _listEl;
var _viewEl;
var _replyEl;
var _asideOffcanvas;
// Private methods
var _initEditor = function(form, editor) {
// init editor
var options = {
modules: {
toolbar: {}
},
placeholder: 'پیام را تایپ کنید ...',
theme: 'snow'
};
if (!KTUtil.getById(editor)) {
return;
}
// Init editor
var editor = new Quill('#' + editor, options);
// Customize editor
var toolbar = KTUtil.find(form, '.ql-toolbar');
var editor = KTUtil.find(form, '.ql-editor');
if (toolbar) {
KTUtil.addClass(toolbar, 'px-5 border-top-0 border-left-0 border-right-0');
}
if (editor) {
KTUtil.addClass(editor, 'px-8');
}
}
var _initAttachments = function(elemId) {
if (!KTUtil.getById(elemId)) {
return;
}
var id = "#" + elemId;
var previewNode = $(id + " .dropzone-item");
previewNode.id = "";
var previewTemplate = previewNode.parent('.dropzone-items').html();
previewNode.remove();
var myDropzone = new Dropzone(id, { // Make the whole body a dropzone
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
parallelUploads: 20,
maxFilesize: 1, // Max filesize in MB
previewTemplate: previewTemplate,
previewsContainer: id + " .dropzone-items", // Define the container to display the previews
clickable: id + "_select" // Define the element that should be used as click trigger to select files.
});
myDropzone.on("addedfile", function(file) {
// Hookup the start button
$(document).find(id + ' .dropzone-item').css('display', '');
});
// Update the total progress bar
myDropzone.on("totaluploadprogress", function(progress) {
document.querySelector(id + " .progress-bar").style.width = progress + "%";
});
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts
document.querySelector(id + " .progress-bar").style.opacity = "1";
});
// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("complete", function(progress) {
var thisProgressBar = id + " .dz-complete";
setTimeout(function() {
$(thisProgressBar + " .progress-bar, " + thisProgressBar + " .progress").css('opacity', '0');
}, 300)
});
}
// Public methods
return {
// Public functions
init: function() {
// Init variables
_asideEl = KTUtil.getById('kt_todo_aside');
_listEl = KTUtil.getById('kt_todo_list');
_viewEl = KTUtil.getById('kt_todo_view');
_replyEl = KTUtil.getById('kt_todo_reply');
// Init handlers
KTAppTodo.initAside();
KTAppTodo.initList();
KTAppTodo.initView();
KTAppTodo.initReply();
},
initAside: function() {
// Mobile offcanvas for mobile mode
_asideOffcanvas = new KTOffcanvas(_asideEl, {
overlay: true,
baseClass: 'offcanvas-mobile',
//closeBy: 'kt_todo_aside_close',
toggleBy: 'kt_subheader_mobile_toggle'
});
// View list
KTUtil.on(_asideEl, '.list-item[data-action="list"]', 'click', function(e) {
var type = KTUtil.attr(this, 'data-type');
var listItemsEl = KTUtil.find(_listEl, '.kt-inbox__items');
var navItemEl = this.closest('.kt-nav__item');
var navItemActiveEl = KTUtil.find(_asideEl, '.kt-nav__item.kt-nav__item--active');
// demo loading
var loading = new KTDialog({
'type': 'loader',
'placement': 'top center',
'message': 'Loading ...'
});
loading.show();
setTimeout(function() {
loading.hide();
KTUtil.css(_listEl, 'display', 'flex'); // show list
KTUtil.css(_viewEl, 'display', 'none'); // hide view
KTUtil.addClass(navItemEl, 'kt-nav__item--active');
KTUtil.removeClass(navItemActiveEl, 'kt-nav__item--active');
KTUtil.attr(listItemsEl, 'data-type', type);
}, 600);
});
},
initList: function() {
// Group selection
KTUtil.on(_listEl, '[data-inbox="group-select"] input', 'click', function() {
var messages = KTUtil.findAll(_listEl, '[data-inbox="message"]');
for (var i = 0, j = messages.length; i < j; i++) {
var message = messages[i];
var checkbox = KTUtil.find(message, '.checkbox input');
checkbox.checked = this.checked;
if (this.checked) {
KTUtil.addClass(message, 'active');
} else {
KTUtil.removeClass(message, 'active');
}
}
});
// Individual selection
KTUtil.on(_listEl, '[data-inbox="message"] [data-inbox="actions"] .checkbox input', 'click', function() {
var item = this.closest('[data-inbox="message"]');
if (item && this.checked) {
KTUtil.addClass(item, 'active');
} else {
KTUtil.removeClass(item, 'active');
}
});
},
initView: function() {
// Back to listing
KTUtil.on(_viewEl, '[data-inbox="back"]', 'click', function() {
// demo loading
var loading = new KTDialog({
'type': 'loader',
'placement': 'top center',
'message': 'Loading ...'
});
loading.show();
setTimeout(function() {
loading.hide();
KTUtil.addClass(_listEl, 'd-block');
KTUtil.removeClass(_listEl, 'd-none');
KTUtil.addClass(_viewEl, 'd-none');
KTUtil.removeClass(_viewEl, 'd-block');
}, 700);
});
// Expand/Collapse reply
KTUtil.on(_viewEl, '[data-inbox="message"]', 'click', function(e) {
var message = this.closest('[data-inbox="message"]');
var dropdownToggleEl = KTUtil.find(this, '[data-toggle="dropdown"]');
var toolbarEl = KTUtil.find(this, '[data-inbox="toolbar"]');
// skip dropdown toggle click
if (e.target === dropdownToggleEl || (dropdownToggleEl && dropdownToggleEl.contains(e.target) === true)) {
return false;
}
// skip group actions click
if (e.target === toolbarEl || (toolbarEl && toolbarEl.contains(e.target) === true)) {
return false;
}
if (KTUtil.hasClass(message, 'toggle-on')) {
KTUtil.addClass(message, 'toggle-off');
KTUtil.removeClass(message, 'toggle-on');
} else {
KTUtil.removeClass(message, 'toggle-off');
KTUtil.addClass(message, 'toggle-on');
}
});
},
initReply: function() {
_initEditor(_replyEl, 'kt_todo_reply_editor');
_initAttachments('kt_todo_reply_attachments');
}
};
}();
// Class Initialization
jQuery(document).ready(function() {
KTAppTodo.init();
});

View File

@ -0,0 +1,220 @@
"use strict";
// Class Definition
var KTAddUser = function () {
// Private Variables
var _wizardEl;
var _formEl;
var _wizard;
var _avatar;
var _validations = [];
// Private Functions
var _initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "متأسفیم ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفاً دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "متوجه شدم",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function() {
KTUtil.scrollTop();
});
}
});
});
// Change Event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var _initValidations = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Validation Rules For Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
firstname: {
validators: {
notEmpty: {
message: 'پر کردن نام اجباری است'
}
}
},
lastname: {
validators: {
notEmpty: {
message: 'پر کردن نام خانوادگی اجباری است'
}
}
},
companyname: {
validators: {
notEmpty: {
message: ' پر کردن نام شرکت اجباری است'
}
}
},
phone: {
validators: {
notEmpty: {
message: 'پر کردن شماره تلفن اجباری است'
},
phone: {
country: 'US',
message: 'این شماره تلفن معتبر ایالات متحده نیست. (e.g 5554443333)'
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل اجباری است'
},
emailAddress: {
message: 'ایمیل وارد شده معتبر شده'
}
}
},
companywebsite: {
validators: {
notEmpty: {
message: 'وب سایت وارد شده معتبر نیست'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
// Step 2
communication: {
validators: {
choice: {
min: 1,
message: 'لطفا یک مورد را انتخاب کنید'
}
}
},
language: {
validators: {
notEmpty: {
message: 'لطفا زبان را انتخاب کنید'
}
}
},
timezone: {
validators: {
notEmpty: {
message: 'لطفا وقت محلی را انتخاب کنید'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: 'انتخاب ادرس اجباری است'
}
}
},
postcode: {
validators: {
notEmpty: {
message: 'انتخاب کد پستی اجباری است'
}
}
},
city: {
validators: {
notEmpty: {
message: 'انتخاب شهر اجباری است'
}
}
},
state: {
validators: {
notEmpty: {
message: 'انتخاب استان اجباری است'
}
}
},
country: {
validators: {
notEmpty: {
message: 'انتخاب کشور اجباری است'
}
}
},
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
var _initAvatar = function () {
_avatar = new KTImageInput('kt_user_add_avatar');
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard');
_formEl = KTUtil.getById('kt_form');
_initWizard();
_initValidations();
_initAvatar();
}
};
}();
jQuery(document).ready(function () {
KTAddUser.init();
});

View File

@ -0,0 +1,22 @@
"use strict";
// Class definition
var KTUserEdit = function () {
// Base elements
var avatar;
var initUserForm = function() {
avatar = new KTImageInput('kt_user_edit_avatar');
}
return {
// public functions
init: function() {
initUserForm();
}
};
}();
jQuery(document).ready(function() {
KTUserEdit.init();
});

View File

@ -0,0 +1,265 @@
"use strict";
// Class definition
var KTAppsUsersListDatatable = function() {
// Private functions
// basic demo
var _demo = function() {
var datatable = $('#kt_datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: HOST_URL + '/api/datatables/demos/default.php',
},
},
pageSize: 10, // display 20 records per page
serverPaging: true,
serverFiltering: true,
serverSorting: true,
},
// layout definition
layout: {
scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed.
footer: false, // display/hide footer
},
// column sorting
sortable: true,
pagination: true,
search: {
input: $('#kt_subheader_search_form'),
delay: 400,
key: 'generalSearch'
},
// columns definition
columns: [
{
field: 'RecordID',
title: '#',
sortable: 'asc',
width: 40,
type: 'number',
selector: false,
textAlign: 'left',
template: function(data) {
return '<span class="font-weight-bolder">' + data.RecordID + '</span>';
}
}, {
field: 'OrderID',
title: 'مشتری',
width: 250,
template: function(data) {
var number = KTUtil.getRandomInt(1, 14);
var user_img = '100_' + number + '.jpg';
var output = '';
if (number > 8) {
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-sm flex-shrink-0">\
<img class="" src="assets/media/users/' + user_img + '" alt="photo">\
</div>\
<div class="ml-4">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' + data.CompanyEmail + '</a>\
</div>\
</div>';
}
else {
var stateNo = KTUtil.getRandomInt(0, 7);
var states = [
'success',
'primary',
'danger',
'success',
'warning',
'dark',
'primary',
'info'];
var state = states[stateNo];
output = '<div class="d-flex align-items-center">\
<div class="symbol symbol-40 symbol-light-'+state+' flex-shrink-0">\
<span class="symbol-label font-size-h4 font-weight-bold">' + data.CompanyAgent.substring(0, 1) + '</span>\
</div>\
<div class="ml-4">\
<div class="text-dark-75 font-weight-bolder font-size-lg mb-0">' + data.CompanyAgent + '</div>\
<a href="#" class="text-muted font-weight-bold text-hover-primary">' + data.CompanyEmail + '</a>\
</div>\
</div>';
}
return output;
}
}, {
field: 'Country',
title: 'کشور',
template: function(row) {
var output = '';
output += '<div class="font-weight-bolder font-size-lg mb-0">' + row.Country + '</div>';
output += '<div class="font-weight-bold text-muted">Code: ' + row.ShipCountry + '</div>';
return output;
}
}, {
field: 'ShipDate',
title: 'تاریخ حمل و نقل',
type: 'date',
format: 'MM/DD/YYYY',
template: function(row) {
var output = '';
var status = {
1: {'title': 'Paid', 'class': ' label-light-primary'},
2: {'title': 'Approved', 'class': ' label-light-danger'},
3: {'title': 'در حال انجام', 'class': ' label-light-primary'},
4: {'title': 'Rejected', 'class': ' label-light-success'}
};
var index = KTUtil.getRandomInt(1, 4);
output += '<div class="font-weight-bolder text-primary mb-0">' + row.ShipDate + '</div>';
output += '<div class="text-muted">' + status[index].title + '</div>';
return output;
},
}, {
field: 'CompanyName',
title: 'نام شرکت',
template: function(row) {
var output = '';
output += '<div class="font-weight-bold text-muted">' + row.CompanyName + '</div>';
return output;
}
}, {
field: 'Status',
title: 'وضعیت',
// callback function support for column rendering
template: function(row) {
var status = {
1: {'title': 'در حال انجام', 'class': ' label-light-primary'},
2: {'title': 'تحویل داده شده', 'class': ' label-light-danger'},
3: {'title': 'لغو شده', 'class': ' label-light-primary'},
4: {'title': 'موفق', 'class': ' label-light-success'},
5: {'title': 'اطلاعات', 'class': ' label-light-info'},
6: {'title': 'خطار', 'class': ' label-light-danger'},
7: {'title': 'هشدار', 'class': ' label-light-warning'},
};
return '<span class="label label-lg font-weight-bold ' + status[row.Status].class + ' label-inline">' + status[row.Status].title + '</span>';
},
}, {
field: 'Actions',
title: 'عملیات',
sortable: false,
width: 130,
overflow: 'visible',
autoHide: false,
template: function() {
return '\
<div class="dropdown dropdown-inline">\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" data-toggle="dropdown">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" class="svg-icon">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z" fill="#000000"/>\
<path d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-right">\
<ul class="navi flex-column navi-hover py-2">\
<li class="navi-header font-weight-bolder text-uppercase font-size-xs text-primary pb-2">\
انتخاب عملیات:\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-print"></i></span>\
<span class="navi-text">پرینت</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-copy"></i></span>\
<span class="navi-text">کپی</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-excel-o"></i></span>\
<span class="navi-text">اکسل</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-text-o"></i></span>\
<span class="navi-text">CSV</span>\
</a>\
</li>\
<li class="navi-item">\
<a href="#" class="navi-link">\
<span class="navi-icon"><i class="la la-file-pdf-o"></i></span>\
<span class="navi-text">PDF</span>\
</a>\
</li>\
</ul>\
</div>\
</div>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon mr-2" title="Edit details">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z" fill="#000000" fill-rule="nonzero" transform="translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953) "/>\
<path d="M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
<a href="javascript:;" class="btn btn-sm btn-default btn-text-primary btn-hover-primary btn-icon" title="Delete">\
<span class="svg-icon svg-icon-md">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
<rect x="0" y="0" width="24" height="24"/>\
<path d="M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z" fill="#000000" fill-rule="nonzero"/>\
<path d="M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z" fill="#000000" opacity="0.3"/>\
</g>\
</svg>\
</span>\
</a>\
';
},
}],
});
$('#kt_datatable_search_status').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Status');
});
$('#kt_datatable_search_type').on('change', function() {
datatable.search($(this).val().toLowerCase(), 'Type');
});
$('#kt_datatable_search_status, #kt_datatable_search_type').selectpicker();
};
return {
// public functions
init: function() {
_demo();
},
};
}();
jQuery(document).ready(function() {
KTAppsUsersListDatatable.init();
});

View File

@ -0,0 +1,259 @@
"use strict";
// Class definition
var KTWizard1 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
package: {
validators: {
notEmpty: {
message: 'Package details is required'
}
}
},
weight: {
validators: {
notEmpty: {
message: 'Package weight is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
width: {
validators: {
notEmpty: {
message: 'Package width is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
height: {
validators: {
notEmpty: {
message: 'Package height is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
packagelength: {
validators: {
notEmpty: {
message: 'Package length is required'
},
digits: {
message: 'The value added is not valid'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
delivery: {
validators: {
notEmpty: {
message: "نوع تحویل الزامی است"
}
}
},
packaging: {
validators: {
notEmpty: {
message: 'نوع بسته بندی لازم است'
}
}
},
preferreddelivery: {
validators: {
notEmpty: {
message: "نحوه ی تحویل لازم است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 4
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
locaddress1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
locpostcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
loccity: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
locstate: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
loccountry: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard_v1');
_formEl = KTUtil.getById('kt_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard1.init();
});

View File

@ -0,0 +1,297 @@
"use strict";
// Class definition
var KTWizard2 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: false // to make steps clickable this set value true and add data-wizard-clickable="true" in HTML for class="wizard" element
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
fname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lname: {
validators: {
notEmpty: {
message: "نام خانوادگی لازم است"
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
delivery: {
validators: {
notEmpty: {
message: "نوع تحویل الزامی است"
}
}
},
packaging: {
validators: {
notEmpty: {
message: 'نوع بسته بندی لازم است'
}
}
},
preferreddelivery: {
validators: {
notEmpty: {
message: "نحوه ی تحویل لازم است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 4
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
locaddress1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
locpostcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
loccity: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
locstate: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
loccountry: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 5
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
ccname: {
validators: {
notEmpty: {
message: 'نام کارت اعتباری الزامی است'
}
}
},
ccnumber: {
validators: {
notEmpty: {
message: "شماره کارت اعتباری لازم است"
},
creditCard: {
message: "شماره کارت اعتباری معتبر نیست"
}
}
},
ccmonth: {
validators: {
notEmpty: {
message: "ماه کارت اعتباری لازم است"
}
}
},
ccyear: {
validators: {
notEmpty: {
message: "سال کارت اعتباری لازم است"
}
}
},
cccvv: {
validators: {
notEmpty: {
message: "CVV کارت اعتباری لازم است"
},
digits: {
message: "مقدار CVV معتبر نیست. فقط شماره مجاز است "
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard_v2');
_formEl = KTUtil.getById('kt_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard2.init();
});

View File

@ -0,0 +1,259 @@
"use strict";
// Class definition
var KTWizard3 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
package: {
validators: {
notEmpty: {
message: 'Package details is required'
}
}
},
weight: {
validators: {
notEmpty: {
message: 'Package weight is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
width: {
validators: {
notEmpty: {
message: 'Package width is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
height: {
validators: {
notEmpty: {
message: 'Package height is required'
},
digits: {
message: 'The value added is not valid'
}
}
},
packagelength: {
validators: {
notEmpty: {
message: 'Package length is required'
},
digits: {
message: 'The value added is not valid'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
delivery: {
validators: {
notEmpty: {
message: "نوع تحویل الزامی است"
}
}
},
packaging: {
validators: {
notEmpty: {
message: 'نوع بسته بندی لازم است'
}
}
},
preferreddelivery: {
validators: {
notEmpty: {
message: "نحوه ی تحویل لازم است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 4
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
locaddress1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
locpostcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
loccity: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
locstate: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
loccountry: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard_v3');
_formEl = KTUtil.getById('kt_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard3.init();
});

View File

@ -0,0 +1,215 @@
"use strict";
// Class definition
var KTWizard4 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
fname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lname: {
validators: {
notEmpty: {
message: "نام خانوادگی لازم است"
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
}
}
},
email: {
validators: {
notEmpty: {
message: 'ایمیل لازم است'
},
emailAddress: {
message: "مقدار یک آدرس ایمیل معتبر نیست"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 3
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
ccname: {
validators: {
notEmpty: {
message: 'نام کارت اعتباری الزامی است'
}
}
},
ccnumber: {
validators: {
notEmpty: {
message: "شماره کارت اعتباری لازم است"
},
creditCard: {
message: "شماره کارت اعتباری معتبر نیست"
}
}
},
ccmonth: {
validators: {
notEmpty: {
message: "ماه کارت اعتباری لازم است"
}
}
},
ccyear: {
validators: {
notEmpty: {
message: "سال کارت اعتباری لازم است"
}
}
},
cccvv: {
validators: {
notEmpty: {
message: "CVV کارت اعتباری لازم است"
},
digits: {
message: "مقدار CVV معتبر نیست. فقط شماره مجاز است "
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard_v4');
_formEl = KTUtil.getById('kt_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard4.init();
});

View File

@ -0,0 +1,158 @@
"use strict";
// Class definition
var KTWizard5 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
firstname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lastname: {
validators: {
notEmpty: {
message: 'نام خانوادگی را وارد کنید'
}
}
},
phone: {
validators: {
notEmpty: {
message: "تلفن لازم است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
address2: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard');
_formEl = KTUtil.getById('kt_wizard_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard5.init();
});

View File

@ -0,0 +1,151 @@
"use strict";
// Class definition
var KTWizard6 = function () {
// Base elements
var _wizardEl;
var _formEl;
var _wizard;
var _validations = [];
// Private functions
var initWizard = function () {
// Initialize form wizard
_wizard = new KTWizard(_wizardEl, {
startStep: 1, // initial active step number
clickableSteps: true // allow step clicking
});
// Validation before going to next page
_wizard.on('beforeNext', function (wizard) {
// Don't go to the next step yet
_wizard.stop();
// Validate form
var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step
validator.validate().then(function (status) {
if (status == 'Valid') {
_wizard.goNext();
KTUtil.scrollTop();
} else {
Swal.fire({
text: "با عرض پوزش ، به نظر می رسد برخی از خطاها شناسایی شده اند ، لطفا دوباره امتحان کنید.",
icon: "error",
buttonsStyling: false,
confirmButtonText: "باشه فهمیدم!",
customClass: {
confirmButton: "btn font-weight-bold btn-light"
}
}).then(function () {
KTUtil.scrollTop();
});
}
});
});
// Change event
_wizard.on('change', function (wizard) {
KTUtil.scrollTop();
});
}
var initValidation = function () {
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
// Step 1
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
firstname: {
validators: {
notEmpty: {
message: "نام لازم است"
}
}
},
lastname: {
validators: {
notEmpty: {
message: 'نام خانوادگی را وارد کنید'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
// Step 2
_validations.push(FormValidation.formValidation(
_formEl,
{
fields: {
address1: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
address2: {
validators: {
notEmpty: {
message: "آدرس لازم است"
}
}
},
postcode: {
validators: {
notEmpty: {
message: "کدپستی لازم است"
}
}
},
city: {
validators: {
notEmpty: {
message: "شهر مورد نیاز است"
}
}
},
state: {
validators: {
notEmpty: {
message: "استان لازم است"
}
}
},
country: {
validators: {
notEmpty: {
message: "کشور مورد نیاز است"
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
));
}
return {
// public functions
init: function () {
_wizardEl = KTUtil.getById('kt_wizard');
_formEl = KTUtil.getById('kt_wizard_form');
initWizard();
initValidation();
}
};
}();
jQuery(document).ready(function () {
KTWizard6.init();
});