
';
$('.Comment').append(text);
editingRows();
$('#commentKolesiko').html('');
});
}
else {
alert('Введите сообщение');
}
document.getElementById('userMassageTextarea').value='';
}
function getComments(idObject) {
var page = $('#commPage').val();
var where = $('#where').val();
$.post("/ajax/getcomments.php", { idObject:idObject,where:where, page: page },function(data) {
if (data != '') {
$('.Comment').append(data);
page++;
$('#commPage').val(page);
}
else {
$('.lookMore').html('');
}
});
}
function deleteComment(obj, idObject,idUser) {
var where = $('#where').val();
$.post("/ajax/deletecomment.php", { idObject:idObject,where:where, idUser: idUser },function(data) {});
$(obj).parent().parent().html('');
}
function sendOnWall(id_user) {
var mass = $('.userWallTextarea').val();
var append = $('#userWallAppendContent').html();
if ((mass !='' && mass != '\n') || append != '') {
$.post("/ajax/senduseronwall.php", { id_user: id_user, mess: mass, append: append },
function(data) {
var data =jQuery.parseJSON(data);
path = '';
for(i=0;i
"+ append;
photo = '/files/photo'+path+'/small.jpg';
if (data.idPhoto == '0') photo = '/images/nophotosmall.jpg';
var str = '';
$('#userWall').prepend(str);
$('.userWallTextarea').val('');
$('#userWallAppendContent').html('');
wallListEditing();
});
}
else {
alert('Введите сообщение');
}
}
function removeFromUserWall(obj ,id) {
$(obj).parent().parent().parent().html('').removeClass('userListRow');
$.post("/ajax/removefromuserwall.php", { id: id },function(data) {});
}
function getWall(idUser) {
page = $('#wallPage').val();
$.post("/ajax/getwall.php", { idUser: idUser, page: page },function(data) {
if (data != '') {
$('#userWall').append(data);
page++;
$('#wallPage').val(page);
wallListEditing();
}
else {
$('.lookMore').html('');
}
});
}
function getWallPhotoes() {
$.post("/ajax/getwallphotoes.php", { },function(data) {
$('#wallContent').html(data);
});
}
function getWallReports() {
$.post("/ajax/getwallreports.php", { },function(data) {
$('#wallContent').html(data);
});
}
function getWallVideos() {
$.post("/ajax/getwallvideos.php", { },function(data) {
$('#wallContent').html(data);
});
}
function appendPhotoOnWall(src, srcBig) {
$('#userWallAppendContent').html('
');
tb_remove();
}
function appendReportOnWall(src, srcBig,title) {
$('#userWallAppendContent').html(title+'
');
tb_remove();
}
function appendVideoOnWall(src, srcBig,title) {
$('#userWallAppendContent').html(title+'
');
tb_remove();
}
function wallListEditing() {
$('.userListRow').mouseover(function() {
obj = $(this).find('.editing');
obj.removeClass('displayNone');
});
$('.userListRow').mouseout(function() {
obj = $(this).find('.editing');
obj.addClass('displayNone');
});
}
function removeUserPhotoAlbum(obj ,idUser, idPhotoAlbum) {
if (confirm("Вы действительно хотите удалить фотоальбом?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeuserphotoalbum.php", { idUser: idUser, idPhotoAlbum: idPhotoAlbum },function(data) {});
}
}
function removeUserPhotoAlbum1(obj ,idUser, idPhotoAlbum) {
if (confirm("Вы действительно хотите удалить фотоальбом?")){
$.post("/ajax/removeuserphotoalbum.php", { idUser: idUser, idPhotoAlbum: idPhotoAlbum },function(data) {
document.location.href='/photoalbums/id/'+idUser;
});
}
}
function removeUserPhoto(obj ,idPhoto) {
$(obj).parent().html('').removeClass('photoAlbumDiv');
$.post("/ajax/removeuserphoto.php", { idPhoto: idPhoto },function(data) {});
}
function setMainImg(idPhotoAlbum, idImg) {
$.post("/ajax/setmainimg.php", { idPhotoAlbum: idPhotoAlbum, idImg: idImg },function(data) {});
}
function setAvatarImg(idPhotoAlbum, idImg) {
$.post("/ajax/setavatarimg.php", { idPhotoAlbum: idPhotoAlbum, idImg: idImg },function(data) {});
}
function setAvatarImgFromWall(idPhotoAlbum, idImg, userId) {
$.post("/ajax/setavatarimg.php", { idPhotoAlbum: idPhotoAlbum, idImg: idImg },function(data) {});
window.location.href='/user/id/'+userId;
}
function PhotoesAlbumLike(idVideo,like,obj) {
jQuery(obj).removeAttr("onclick");
var num = parseInt(jQuery(obj).find('span').text(), 10);
if (isNaN(num)) num = 0;
num = num + 1;
jQuery(obj).find('span').text(num);
jQuery.post("/ajax/photoalbumlike.php", { idVideo: idVideo, like: like },function(data) {});
}
function removeUserArticle(obj ,idUser, idArticle) {
if (confirm("Вы действительно хотите удалить статью?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeuserarticle.php", { idUser: idUser, idArticle: idArticle },function(data) {});
}
}
function removeUserArticle1(obj ,idUser, idArticle) {
if (confirm("Вы действительно хотите удалить статью?")){
$.post("/ajax/removeuserarticle.php", { idUser: idUser, idArticle: idArticle },function(data) {
document.location.href='/articles/id/'+idUser;
});
}
}
function removeUserArticlePhoto(obj ,idPhoto) {
$(obj).parent().parent().html('').removeClass('photoAlbumDiv');
$.post("/ajax/removeuserarticlephoto.php", { idPhoto: idPhoto },function(data) {});
}
function setMainImgArticle(idPhotoAlbum, idImg) {
$.post("/ajax/setmainimgarticle.php", { idPhotoAlbum: idPhotoAlbum, idImg: idImg },function(data) {});
}
function removeUserVideo(obj ,idUser, idVideo) {
if (confirm("Вы действительно хотите удалить видеозапись?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeuservideo.php", { idUser: idUser, idVideo: idVideo },function(data) {});
}
}
function removeVideo(obj ,idUser, idVideo) {
if (confirm("Вы действительно хотите удалить видеозапись?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removevideo.php", { idUser: idUser, idVideo: idVideo },function(data) {});
}
}
function removeUserVideo1(obj ,idUser, idVideo) {
if (confirm("Вы действительно хотите удалить видеозапись?")){
$.post("/ajax/removeuservideo.php", { idUser: idUser, idVideo: idVideo },function(data) {
document.location.href='/videos/id/'+idUser;
});
}
}
function removeVideo1(obj ,idUser, idVideo) {
if (confirm("Вы действительно хотите удалить видеозапись?")){
$.post("/ajax/removevideo.php", { idUser: idUser, idVideo: idVideo },function(data) {
document.location.href='/videos';
});
}
}
function userAddVideo(idVideo, obj) {
$.post("/ajax/useraddvideo.php", { idVideo: idVideo },function(data) {
$(obj).parent().html(data);
});
}
function VideoLike(idVideo,like,obj) {
jQuery(obj).removeAttr("onclick");
var num = parseInt(jQuery(obj).find('span').text(), 10);
if (isNaN(num)) num = 0;
num = num + 1;
jQuery(obj).find('span').text(num);
jQuery.post("/ajax/videolike.php", { idVideo: idVideo, like: like },function(data) {});
}
function dialogWindow(){
$( "#popupWindow" ).dialog({
height: 140,
modal: true
});
}
function validateNotEmpty(data, fieldName) {
if (data == '') return 'Поле '+fieldName+' обязательное для заполнения'; else return '';
}
function isValidEmail (email)
{
var re = /^\w+([\.-]?\w+)*@(((([a-z0-9]{2,})|([a-z0-9][-][a-z0-9]+))[\.][a-z0-9])|([a-z0-9]+[-]?))+[a-z0-9]+\.([a-z]{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/i;
return re.test(email);
}
function removeUserShop(obj ,idUser, idShop) {
if (confirm("Вы действительно хотите удалить магазин?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeusershop.php", { idUser: idUser, idShop: idShop },function(data) {});
}
}
function removeUserShop1(obj ,idUser, idShop) {
if (confirm("Вы действительно хотите удалить магазин?")){
$.post("/ajax/removeusershop.php", { idUser: idUser, idShop: idShop },function(data) {
document.location.href='/shops';
});
}
}
function setMainImgProduct(idPhotoAlbum, idImg, userId) {
$.post("/ajax/catalog/setmainimgproduct.php", { idPhotoAlbum: idPhotoAlbum, idImg: idImg, id:userId },function(data) {});
}
function removeProductPhoto(obj ,idPhoto, userId) {
$(obj).parent().parent().html('').removeClass('photoAlbumDiv');
$.post("/ajax/catalog/removeproductphoto.php", { idPhoto: idPhoto, id: userId },function(data) {});
}
function removeProduct(obj ,idUser, idProduct) {
if (confirm("Вы действительно хотите удалить товар?")){
jQuery(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
jQuery.post("/ajax/catalog/removeproduct.php", { idUser: idUser, idProduct: idProduct },function(data) {});
}
}
function removeProduct1(obj ,idUser, idProduct) {
if (confirm("Вы действительно хотите удалить товар?")){
jQuery.post("/ajax/catalog/removeproduct.php", { idUser: idUser, idProduct: idProduct },function(data) {
document.location.href='/shop';
});
}
}
function saveImgProductByLink(obj,idProduct,userId) {
var link = $(obj).parent().find('input').val();
if (link != '') {
$.post("/ajax/catalog/saveimgproductbylink.php", { link: link,idProduct: idProduct, id: userId },function(data) {
if (data == 1) {
location.href='/shop/catalog/productedit/idproduct/'+idProduct+/id/+userId;
}
else {
alert (data);
}
});
}
}
function saveTitleForProduct(idImg, obj, userId) {
var title = $(obj).parent().find('input').val();
jQuery.post("/ajax/catalog/savetitleforproduct.php", { idImg: idImg, title: title, id: userId },function(data) {
alert('Заголовок сохранен');
});
}
function shopProductLike(idProduct,like,obj) {
jQuery(obj).removeAttr("onclick");
var num = parseInt(jQuery(obj).find('span').text(), 10);
if (isNaN(num)) num = 0;
num = num + 1;
jQuery(obj).find('span').text(num);
jQuery.post("/ajax/catalog/like.php", { idProduct: idProduct, like: like },function(data) {});
}
function goToProduct(idProduct) {
jQuery.post("/ajax/catalog/click.php", { idProduct: idProduct },function(data) {});
}
function getShopAtrrib(title) {
$('#listattribs').html('
');
jQuery.post("/ajax/catalog/getshopatrrib.php", { title: title },function(data) {
$('#listattribs').html(data);
});
}
function getShopFilters(title) {
$('#listfilters').html('
');
jQuery.post("/ajax/catalog/getshopfilters.php", { title: title },function(data) {
$('#listfilters').html(data);
});
}
function removeUserFishingbase(obj ,idUser, idFishingbase) {
if (confirm("Вы действительно хотите удалить рыболовную базу?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeuserfishingbase.php", { idUser: idUser, idFishingbase: idFishingbase },function(data) {});
}
}
function removeUserFishingbase1(obj ,idUser, idFishingbase) {
if (confirm("Вы действительно хотите удалить рыболовную базу?")){
$.post("/ajax/removeuserfishingbase.php", { idUser: idUser, idFishingbase: idFishingbase },function(data) {
document.location.href='/fishingbases';
});
}
}
function removeFishbaseDisCount(obj ,idUser, idFishingbase,idDiscount) {
if (confirm("Вы действительно хотите удалить эту скидку?")){
$(obj).parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removefishbasediscount.php", { idUser: idUser, idFishingbase: idFishingbase,idDiscount: idDiscount },function(data) {});
}
}
function removeUserPhotoFishingbase(obj ,idPhoto) {
$(obj).parent().html('').removeClass('photoAlbumDiv');
$.post("/ajax/removeuserphotofishingbase.php", { idPhoto: idPhoto },function(data) {});
}
function activeFishbase(idfishbase,obj) {
activefield = $(obj).find('.active').val();
if (activefield == 1) {
$(obj).find('.active').val(0);
$(obj).find('img').attr("title", "Показать");
$(obj).parent().parent().parent().parent().parent().parent().addClass('notActive');
active = 0;
}
else {
$(obj).find('.active').val(1);
$(obj).find('img').attr("title", "Скрыть");
$(obj).parent().parent().parent().parent().parent().parent().removeClass('notActive');
active = 1;
}
$.post("/ajax/active/activefishbase.php", { idfishbase: idfishbase,active:active },function(data) {});
}
function attachedFishbase(idfishbase,obj) {
activefield = $(obj).find('.attache').val();
if (activefield == 1) {
$(obj).find('.attache').val(0);
$(obj).find('img').attr("title", "Прикркпить");
attached = 0;
}
else {
$(obj).find('.attache').val(1);
$(obj).find('img').attr("title", "Открепить");
attached = 1;
}
$.post("/ajax/active/attachefishbase.php", { idfishbase: idfishbase,attached:attached },function(data) {});
}
function removeUserCook(obj ,idUser, idAd) {
if (confirm("Вы действительно хотите удалить рецепт?")){
$(obj).parent().parent().parent().parent().parent().parent().html('').removeClass('userMassageRow');
$.post("/ajax/removeuserad.php", { idUser: idUser, idAd: idAd },function(data) {});
}
}
function removeUserCook1(obj ,idUser, idCook) {
if (confirm("Вы действительно хотите удалить рецепт?")){
$.post("/ajax/removeusercook.php", { idUser: idUser, idCook: idCook },function(data) {
document.location.href='/cooks/id/'+idUser;
});
}
}