Добавление техники

Перемещая красный маркер, можно указать точное расположение техники
Выберите категорию

Загрузить фотографии

Для загрузки используйте только свои фотографии в форматах JPEG, PNG, GIF

Войти | Зарегистрироваться

'; htmlText += '
'; htmlText += ''; htmlText += ''; htmlText += '
'; } else { $('#inline-login').removeClass('inline-nolink'); $('#inline-login').addClass('inline-link'); $('#inline-register').removeClass('inline-link'); $('#inline-register').addClass('inline-nolink'); htmlText += ''; htmlText += 'Нажав на кнопку "Добавить", вы соглашаетесь с правилами и условиями, описанными на странице Правила и условия'; htmlText += '
'; htmlText += ''; htmlText += ''; htmlText += 'или
'; htmlText += ''; htmlText += ''; htmlText += '10 цифр, без кода страны, например: 9991234567'; htmlText += '
'; htmlText += '
'; htmlText += ''; htmlText += ''; htmlText += '
'; htmlText += '
'; htmlText += ''; htmlText += ''; htmlText += ''; htmlText += ''; htmlText += '
'; } $('#login-form-inline').html(htmlText); } Удалить
'; } $("#bookForm").html(htmltext); } else { $("#bookForm").html("Для выбранной категории нет доступных характеристик"); } }); } } $('#editform').submit(function () { if (nolog) { regLog(); } else { submitCard(); } return false; }); function regLog() { if (loginRegister == 'login') { $.ajax({ type: "POST", url: "/user/login/", async: false, data: { username: $("#user-login-form-email").val(), password: $("#user-login-form-password").val(), } }).done(function (msg) { var response = JSON.parse(msg); if (response['result'] == "ok") { submitCard(); } else { errors = response['errors']; $("#loginErrorsDiv").html(errors); } }); } else if (loginRegister == 'register') { $.ajax({ type: "POST", url: "/user/register/", async: false, data: { username: $("#user-register-form-email").val(), phone: $("#user-register-form-phone").val(), name: $("#user-register-form-name").val(), password: $("#user-register-form-password").val(), repassword: $("#user-register-form-password-retype").val(), city_id: $("#userCityId").val() } }).done(function (msg) { console.log(msg); var response = JSON.parse(msg); if (response['result'] == "ok") { submitCard(); } else { errors = response['errors']; $("#loginErrorsDiv").html(errors); } }); } return false; } function submitCard() { pos = marker.getPosition(); $.ajax({ type: "POST", url: "/tech/save/" + cardId, data: $("form").serialize() + "&lat=" + pos.lat() + "&long=" + pos.lng() }).done(function (msg) { console.log(msg); var response = JSON.parse(msg); $("form").find('input,select,textarea').each(function (i, o) { $('#' + o.id).removeClass('error'); }); if (response['result'] == "ok") { $("#resultDiv").css("background-color", "rgba(5, 255, 77, 0.1)").css("border-radius", "5px").html('Изменения сохранены!
'); $('#resultDiv').animate({ backgroundColor: "rgba(5, 255, 77, 0)" }, 5000); if (cardId != response['id']) { setTimeout((function () { document.location.href = '/tech/edit/' + response['id']; }), 1000); } cardId = response['id']; if (response['image-html']) { $("#edit-images").html(response['image-html']); } } else { errorsHtml = ''; $.each(response['errors'], function (item, i, arr) { $('#' + item).addClass('error'); errorsHtml += i + ''; }); $("#resultDiv").html('' + errorsHtml + '
'); } $('body, html').animate({scrollTop: $(".product-detail-header").offset().top}, 800); }); return false; } function withImage(id, action) { $.ajax({ type: "POST", url: "/tech/setimage/" + cardId, data: { id: id, action: action, } }).done(function (msg) { var response = JSON.parse(msg); if (response['result'] == "ok") { if (response['image-html']) { $("#edit-images").html(response['image-html']); } } else { } }); return false; } function deleteCard() { $.ajax({ type: "POST", url: "/tech/delete/" }).done(function (msg) { var response = JSON.parse(msg); if (response['result'] == "ok") { $("#resultDiv").html('Объявление удалено
'); $('body, html').animate({scrollTop: 150}, 800); setTimeout((function () { document.location.href = '/user/tech'; }), 1000); } else { $("#resultDiv").html('Ошибка. Попробуйте позже.
'); } }); return false; }