add station id to create user
This commit is contained in:
@@ -61,9 +61,6 @@ function errorHandler(error) {
|
||||
break;
|
||||
|
||||
default:
|
||||
console.error("Error trace object");
|
||||
console.log("Error object:");
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
icon: "error",
|
||||
title: "خطا",
|
||||
@@ -433,7 +430,7 @@ function getTollhouseByCity(city_id, dom_id, selected_id = 0) {$.ajax({
|
||||
for (let index = 0; index < cities.length; index++) {
|
||||
|
||||
$(`#${dom_id}`).append(
|
||||
`<option value=${cities[index].id}>${cities[index].name_fa}</option>`
|
||||
`<option value=${cities[index].id}>${cities[index].name}</option>`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -960,7 +957,6 @@ $(document).on('click', '#report_btn', function () {
|
||||
var tr = $(this).closest("tr");
|
||||
var row = table.row(tr);
|
||||
$("#report_modal").modal('show');
|
||||
console.log(row.data().id);
|
||||
$("#selected_user_for_report").val(row.data().id);
|
||||
|
||||
})
|
||||
@@ -1040,7 +1036,6 @@ $(document).on('click', '#activity_report', function () {
|
||||
showLoaderScreen()
|
||||
},
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
|
||||
$("#activity_time").text(result.activity_time);
|
||||
$("#average_activity_time").text(result.average_activity_time);
|
||||
@@ -1079,9 +1074,6 @@ $(document).on('click', '.permission-control', function () {
|
||||
modal.find('.permission-label').removeClass('text-muted')
|
||||
modal.find('.all-permission-by-type').prop('checked', false)
|
||||
modal.find('#user_id').val(row.data().id)
|
||||
|
||||
console.log(row.data().province_id);
|
||||
console.log(row.data().edarate_shahri_id);
|
||||
modal.find('.permission-input').each((index, element) => {
|
||||
if ($(element).data('needProvince') == 1) {
|
||||
if (row.data().province_id == null) {
|
||||
@@ -1662,7 +1654,6 @@ $("table").on("click", "tbody tr", function () {
|
||||
|
||||
|
||||
$('#user_data_table').on('change', ".user-finder-all", function () {
|
||||
console.log(checkedItemsId);
|
||||
|
||||
var thiz = $(this);
|
||||
if (thiz.is(':checked')) {
|
||||
@@ -1679,7 +1670,6 @@ $('#user_data_table').on('change', ".user-finder-all", function () {
|
||||
});
|
||||
|
||||
$('#user_data_table').on('change', ".user-finder", function () {
|
||||
console.log(checkedItemsId);
|
||||
|
||||
const checkedItemId = $(this).data("idUser");
|
||||
|
||||
@@ -2141,7 +2131,6 @@ $("#edit_province_office").change(function () {
|
||||
|
||||
|
||||
$("#edit_city_office").change(function () {
|
||||
console.log("this is ok");
|
||||
setUserName("edit");
|
||||
})
|
||||
|
||||
@@ -2424,20 +2413,15 @@ $("#add_province_office").change(function () {
|
||||
})
|
||||
|
||||
$("#add_simple_city").change(function () {
|
||||
console.log("add_simple_city change happend");
|
||||
|
||||
console.log("valuee:", $(this).val());
|
||||
|
||||
if ($("#add_simple_city").val() == -1) {
|
||||
console.log("value of city is or -1");
|
||||
|
||||
disableDOM("add_simple_tollhouse")
|
||||
$("#add_simple_tollhouse").empty();
|
||||
} else {
|
||||
console.log("tolls should send reqest");
|
||||
|
||||
enableDOM("add_simple_tollhouse")
|
||||
getTollhouseByCity($("#add_simple_province").val(), "add_simple_tollhouse")
|
||||
getTollhouseByCity($("#add_simple_city").val(), "add_simple_tollhouse")
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2673,8 +2657,10 @@ $("#add_simple_province_office").change(function () {
|
||||
|
||||
disableDOM("add_simple_city")
|
||||
disableDOM("add_simple_city_office")
|
||||
disableDOM("add_simple_tollhouse")
|
||||
$("#add_simple_city").empty();
|
||||
$("#add_simple_city_office").empty();
|
||||
$("#add_simple_tollhouse").empty();
|
||||
|
||||
} else {
|
||||
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
|
||||
@@ -2708,6 +2694,7 @@ $("#add_simple_submit_form").on("click", function () {
|
||||
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
|
||||
var national_code = $("#add_simple_national_code").val();
|
||||
var city_id = $("#add_simple_city").children("option:selected").val();
|
||||
var tollhouse_id = $("#add_simple_tollhouse").children("option:selected").val();
|
||||
|
||||
|
||||
if (edarate_ostani_id <= 0 && edarate_shahri_id <= 0) {
|
||||
@@ -2746,6 +2733,12 @@ $("#add_simple_submit_form").on("click", function () {
|
||||
} else {
|
||||
$("#add_simple_city").removeClass("validity-checker");
|
||||
}
|
||||
if (tollhouse_id == 0) {
|
||||
$("#add_simple_tollhouse").addClass("validity-checker");
|
||||
form_validation_status = false;
|
||||
} else {
|
||||
$("#add_simple_tollhouse").removeClass("validity-checker");
|
||||
}
|
||||
|
||||
if (province_id < 0) {
|
||||
$("#add_simple_province").addClass("validity-checker");
|
||||
@@ -2785,6 +2778,10 @@ $("#add_simple_submit_form").on("click", function () {
|
||||
formData.append("city_id", city_id);
|
||||
}
|
||||
|
||||
if (tollhouse_id != undefined) {
|
||||
formData.append("station_id", tollhouse_id);
|
||||
}
|
||||
|
||||
formData.append("password_confirmation", repass);
|
||||
if (edarate_ostani_id != 0) {
|
||||
formData.append("edarate_ostani_id", edarate_ostani_id);
|
||||
|
||||
Reference in New Issue
Block a user