Charika - Fiche d'Identité Société : GUSMA
Toucha nord
Monaiche trans
Creative hydrautic
Rc : 1403 (Tribunal de Tanger)
Adresse : C/o Meubles Farah Rue De Hollande N39 - Tanger-Assilah
05-39-37-54-59
05-39-37-55-66
Activité : toutes operations immobilieres, bancaires, acquisition, gerance, location, etc
', css: { "z-index": '1011', top: '20px', width: '80%', right: '0px', left: '0px' } }); bilid = "39978" ; entid = "40987"; url = getUrl(e) ; $.ajax( { type: "POST", data: {url: url,bilid: bilid, entid : entid}, url: "upload-logoUrl", context: this }).done(function (result) { $(imageField).unblock(); crop(result); }); return false; }); } // Gestion de l'upload uploader = new qq.FileUploaderBasic( { action: 'upload-logoEntreprise', debug: false }); $(".service-edit-logo").live("click", function (e) { e.preventDefault(); currentService = $(this); if (!userConnected(e, $(this))) return false; bilid = "39978"; entid = "40987"; uploader.setParams( { bilid : bilid, entid: entid }); $("#upload").click(); imageField = $(this).find("img"); }); $('#upload').live("change", function (e) { e.preventDefault(); var input = $('#upload')[0]; if (uploader._handler instanceof qq.UploadHandlerXhr) { uploader._uploadFileList(input.files); $(imageField.parent()).block( { message: '
', css : { "z-index": "1011", top: "20px", width: "80%", right: "0px", left: "0px" } }); $.ajax ({ type: "POST", url: "societe-ddGeocodage", context : this, data: "url="+url+"&bilid=39978&entid=40987", timeout: 600000, success: function(data) { if(data.success) { callbackGeocodage(mapBackoffice,data.lattitude, data.longitude); } else { notitificateur = noty({text: "erreur lors du traitement : "+ data.error, layout:"topCenter", type:"error"}); notitificateur.setTimeout(6000); $('div#map-google-2').unblock(); } }, error: function(request, errorType, errorThrown) { alert("Erreur lors de la validation"); } });	return false; }); $('#new-comment').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; $('#new-review-haut').fadeIn(); }); function doTruncateCommentText() { $('.review-content').jTruncate({ length: 200, minTrail: 0, moreText: "[plus]", lessText: "[moins]", ellipsisText: " ..." }); } //doTruncateCommentText(); $('.go-review').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; resetReviewForm($("#new-review-haut").find("form")[0]); resetReviewForm($("#new-review-bas").find("form")[0]); $('.containerToggle').fadeOut(0,function() { $('div#new-review-haut').fadeIn(0);	}); return false; }); function showFiche(idFIche) { $('.containerToggle').fadeOut(0,function() { $('div#'+ idFIche).fadeIn(0);	}); } $('.comment-text').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; //$(this).val(""); }); //afficher les 5 premiers commentaires doReviewPaging(DEFAULT_PAGE_SIZE); function validateReviewForm(formId) { var message=""; var form = $(formId); var titre = $(formId).find("#id-review-title-input"); var commentaire = $(formId).find("#ReviewText"); var valid=true; var i = 0; if(!(titre.val()) || titre.val() == titre.attr("placeholder")) { message += "- le champ titre est requis
" + message; } form.find(".submit-error").html(message).show(); } return valid; } function resetReviewForm(formId) { var message = ""; var form = $(formId); form[0].reset(); var titre = $(formId).find("#id-review-title-input"); var commentaire = $(formId).find("#ReviewText"); titre.removeClass("require-vide"); commentaire.removeClass("require-vide"); form.find(".submit-error").hide(); $(".form-new-review").show(); $(".thanks-box").hide(); initFormCommentStars(); } $('.annuler-comment').click(function(e) {	e.preventDefault(); showFiche("fiche"); }); $('.return-to-fiche').click(function(e) {	e.preventDefault(); var parentId=$(this).parents('div[id^="rubrique-new-review"]')[0].id; if(parentId == "new-review-haut") showFiche("fiche"); }); $('.do-another-review').click(function(e) {	e.preventDefault(); $(this).hide(); //on montre le formulaire var parent = $(this).parents('div[id^="rubrique-new-review"]'); parent.find(".return-to-fiche").show(); parent.find("#id-thanks-box").fadeOut(function() { parent.find("#id-form-new-review").show(); }); }); $('.submit-comment').click(function(e) {	e.preventDefault(); if(!userConnected(e, this)) return; var commentBloc = $(this).parents('.new-review'); var formId = commentBloc.find("form")[0]; if(!validateReviewForm(formId)) return; var commentText = commentBloc.find('.comment-text'); var rating = commentBloc.find('.note-rating').children('input').val(); var rating1 = commentBloc.find('.note-rating-1').children('input').val(); var rating2 = commentBloc.find('.note-rating-2').children('input').val(); var rating3 = commentBloc.find('.note-rating-3').children('input').val(); var rating4 = commentBloc.find('.note-rating-4').children('input').val(); var titre = commentBloc.find('.titre'); var commentData = "note=" + rating + "¬e1=" + rating1 + "¬e2=" + rating2 + "¬e3=" + rating3 + "¬e4=" + rating4 + "&comment=" + commentText.val() +"&titre="+titre.val() ; $.ajax ( { type: "POST", url: "societe-comment", data: commentData, timeout: 600000, success: function(data) { var parentId = commentBloc[0].id; var returnedComment = $(data); var returnedJson = eval('(' + $(returnedComment.find('.returnedJson')[0]).html() + ')'); $(returnedComment.find('.star')[0]).raty({score: returnedJson.note, readOnly : true, space: false}); $(returnedComment.find('.note1')[0]).raty({score: returnedJson.note1, readOnly : true, space: false}); $(returnedComment.find('.note2')[0]).raty({score: returnedJson.note2, readOnly : true, space: false}); $(returnedComment.find('.note3')[0]).raty({score: returnedJson.note3, readOnly : true, space: false}); $(returnedComment.find('.note4')[0]).raty({score: returnedJson.note4, readOnly : true, space: false}); $('.global-star').raty({'score': returnedJson.noteGlobale, readOnly : true, space: false}); $(".nbrComment").html(returnedJson.nbrComment); $("#list-review").append(returnedComment); commentText.val(''); resetReviewForm(formId); returnedComment.find('.review-content').jTruncate({ length: 200, minTrail: 0, moreText: "[plus]", lessText: "[moins]", ellipsisText: " ..." }); $(".selector-user-"+returnedJson.idMktUser).find(".nombreCommentaireUser").html(returnedJson.nombreCommentaireUser); doReviewPaging(DEFAULT_PAGE_SIZE); //showFiche("fiche"); commentBloc.find("#id-form-new-review").slideUp(function() { commentBloc.find("#id-thanks-box").show(); }); if(parentId != "new-review-bas") { $('.do-another-review').hide(); $('.return-to-fiche').show(); $('body').animate({scrollTop:0}, 'slow'); } else { //lorsqu'on est sur le bloc de commentaire tout en bas de la page $('.do-another-review').show(); $('.return-to-fiche').hide(); } }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } }); }); $('.global-star').each(function(star) { var x = eval('(' + $(this).children('.returnedJson').html() + ')'); $(this).raty({ readOnly : true, score : x? x.note: 0, space: false }); }); function refreshStars() { $('.star').each(function(star) { var x = eval('(' + $(this).children('.returnedJson').html() + ')'); $(this).raty({ readOnly : true, score : x? x.note: 0, space: false }); var review=$(this).parents(".review"); review.find(".note1-existe").hide(); review.find(".note2-existe").hide(); review.find(".note3-existe").hide(); review.find(".note4-existe").hide(); var ratingSpecifiqueExiste = false; if(x.note1 && x.note1!="0") { ratingSpecifiqueExiste = true; review.find(".note1-existe").show(); review.find(".note1").raty( { readOnly : true, score : x? x.note1: 0, space: false }); } if(x.note2 && x.note2!="0" ) { ratingSpecifiqueExiste = true; review.find(".note2-existe").show(); review.find(".note2").raty( { readOnly : true, score : x? x.note2: 0, space: false }); } if(x.note3 && x.note3!="0") { ratingSpecifiqueExiste = true; review.find(".note3-existe").show(); review.find(".note3").raty( { readOnly : true, score : x? x.note3: 0, space: false }); } if(x.note4 && x.note4!="0") { ratingSpecifiqueExiste = true; review.find(".note4-existe").show(); review.find(".note4").raty( { readOnly : true, score : x? x.note4: 0, space: false }); } if(!ratingSpecifiqueExiste) { review.find(".rating-specifique").remove(); } }); } refreshStars(); function initFormCommentStars() { $('.note-rating').raty({ space: false }); $('.note-rating-1').raty({ space: false }); $('.note-rating-2').raty({ space: false }); $('.note-rating-3').raty({ space: false }); $('.note-rating-4').raty({ space: false }); } //initFormCommentStars(); $(".btn-utile").live("click",function(e) { e.preventDefault(); if(!userConnected(e, $(this))) return; var $this = $(this); var review = $this.parents(".review-wrapper"); var messageZone = $this.parents(".wrapper-btn-utile"); var returnedJson = eval('(' + $(review.find('.returnedJson')[0]).html() + ')'); var spinner = $(" ").addClass("ajax-loader-rond").css("visibility", "visible"); $this.replaceWith(spinner); var idUserComment = returnedJson.idMktUser; $.ajax ({ type: "POST", url: "societe-voteutile", context : this, data: "commentId="+returnedJson.id+"&idUser="+idUserComment, timeout: 600000, success: function(data) { //spinner.remove(); messageZone.fadeOut(0,function() { messageZone.html("Merci de votre contribution.").fadeIn(); review.find(".nombreVoteUtile").html(data.nombreVoteUtileCommentaire); $(".selector-user-"+idUserComment).find(".nombreVoteUtileUser").html(data.nombreVoteUtileUser); }); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-date').click(function(e) { e.preventDefault(); var $this = $(this); var order = "recent"; if($this.hasClass("recent")) { order = "ancien"; } else { order = "recent"; } $("#ajax-loader-date").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=39978∨der=" + order +"&critere=date", timeout: 600000, success: function(data) { $("#ajax-loader-date").css("visibility","hidden"); if($this.hasClass("ancien")) { $this.removeClass("ancien").addClass("recent sprite-review"); } else { $this.removeClass("recent").addClass("ancien sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-note,.commentaire-trie-vote").removeClass("rating-max rating-min sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-note').click(function(e) { e.preventDefault(); var $this = $(this); if($this.hasClass("rating-max")) { order = "max"; } else { order = "min"; } $("#ajax-loader-rating").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=39978∨der=" + order +"&critere=rating", timeout: 600000, success: function(data) { $("#ajax-loader-rating").css("visibility","hidden"); if($this.hasClass("rating-max")) { $this.removeClass("rating-max").addClass("rating-min sprite-review"); } else { $this.removeClass("rating-min").addClass("rating-max sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-date,.commentaire-trie-vote").removeClass("recent ancien sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-vote').click(function(e) { e.preventDefault(); var $this = $(this); if($this.hasClass("rating-max")) { order = "max"; } else { order = "min"; } $("#ajax-loader-vote").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=39978∨der=" + order +"&critere=vote", timeout: 600000, success: function(data) { $("#ajax-loader-vote").css("visibility","hidden"); if($this.hasClass("rating-max")) { $this.removeClass("rating-max").addClass("rating-min sprite-review"); } else { $this.removeClass("rating-min").addClass("rating-max sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-date,.commentaire-trie-note").removeClass("recent ancien sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); $('.review-popup-close').click(function(e) { e.preventDefault(); closePopup(); }); $('.react-link').live("click",function(e) { e.preventDefault(); var $this= $(this); var review = $this.parents(".review-wrapper"); var returnedJson = eval('(' + $(review.find('.returnedJson')[0]).html() + ')'); if(!userConnected(e, this)) return; $(".review-popup-abus-consult").hide(); $(".review-popup-abus-edit").show(); showPopup("review-popup-abus"); //global varible commentId = returnedJson.id ; reactionLink= $this; }); $('.submit-reaction').click(function(e) { e.preventDefault(); if(!userConnected(e)) return; var commentBloc = $(this).parents('.comment-wrapper').children('.react-comment'); $("#ajax-loader-reaction").css("visibility", "visible"); $.ajax ({ type: "POST", url: "societe-reaction", data: "commentId="+commentId+"&reaction="+$("#textearea-reaction").val()+"&idTypeAbus="+$("#selectIdTypeAbus").val(), context : this, timeout: 600000, success: function(data) { $("#ajax-loader-reaction").css("visibility", "hidden"); $(".review-popup-abus-consult").show(); $(".review-popup-abus-edit").hide(); reactionLink.replaceWith($("").html("Merci pour votre action.")) }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } } ); }); $('.next-societe').live("click",function(e) { e.preventDefault(); window.location = "societe-backoffice-next"; return false; }); function doReviewPaging(pageSize) { var nombreReview = jQuery("#list-review").find(".review-wrapper").length; if( nombreReview > 0 ) { $('.pagination').show(); $(".no-comment-found").hide(); $(".comment-found").show(); jQuery(".nombre-commentaire").html(nombreReview +" commentaire"+((nombreReview>1 )?'s':'')+" "); } else { $('.pagination').hide(); $(".no-comment-found").show(); $(".comment-found").hide(); } } /* reviews js part */ $(".review-container .rate").raty( { size:30, starType: 'i', hints: ['Horrible', 'Médiocre', 'Moyen', 'Très bien', 'Excellent'], click: function(score, evt) { $(this).parent().find('input').val(score); } }); $(".review-container").find(".add-review, .add-subreview").click(function() { if(userConnected()) { if($(this).hasClass("add-review")) { $("#review-fiche .add-review").hide(); $(".review-container .review-new").show(); if($(".review-container .review").length > 0) $(".review-container .review-new .annuler").show(); } } }); $(".review-container .annuler").click(function() { var $container = $(this).closest(".review-new"); if($container.hasClass("review-new") && $(".review-container .review").length == 0) return; $container.hide().find("input, textarea").val(""); $("#review-fiche .add-review").show(); }); $(".review-container .envoyer").click(function(e) { var $form = $("#post-review"); sessionStorage.setItem("charika-review-form", JSON.stringify($form.serializeArray())); if(userConnected()) { sessionStorage.removeItem("charika-review-form"); if($form[0].checkValidity && !$form[0].checkValidity()) { $(".review-container .form-error").text("Veuillez écrire au moins un titre et un commentaire avant de l'envoyer").show(); return;	} var noteGlob = $form.find("input[name=note]").val(); if(typeof noteGlob == "undefined" || Number(noteGlob) <= 0) { $(".review-container .form-error").text("Il faut renseigner une note globale pour la société").show(); $(".review-container form .rating").addClass("isrequired").find("h4").addClass("animate-flicker"); return; } $(".review-container .form-error").hide(); $(".review-container .isrequired").removeClass("isrequired").find("h4").removeClass("animate-flicker"); $.blockUI({ message: ' Publication du commentaire en cours...' , css: { height: "50px", paddingTop: "12px"}}); $.post("societe-comment?bilid=39978&entid=40987&" + $form.serialize()).done(function(r) { if(r) { $(".review-container .review-new").hide(); $("#review-fiche .add-review").show(); var nbAvis = Number($('
'); $div.find(".nbcmt, .moynote").remove(); r = $div.html(); $(".review-container .reviews").prepend(r); $.unblockUI(); } }).fail(function() { $.unblockUI(); alert("Erreur d'enregistrement du commentaire"); }); } }); $(".user-publisher .nomprenom.modify").click(function() { $("#user-change-name").modal("show"); }); $("#user-change-name").find(".valider, .annuler").click(function(e) { e.preventDefault(); if($(this).hasClass("annuler")) { $("#user-change-name").modal("hide"); } else { var $form = $(this).closest("form"); if(userConnected()) { if($form[0].checkValidity && !$form[0].checkValidity()) { $form.find(".form-error").text("Merci de vérifier les données saisies").show(); return;	} $form.find(".form-error").hide(); $.blockUI({ message: ' Traitments en cours...' , css: { height: "50px", paddingTop: "12px"}}); $.post("user-updateprofile?bilid=39978&entid=40987&" + $form.serialize()).done(function(r) { if(r.success) { $(".user-publisher .nomprenom").text("("+r.nom+" "+r.prenom+")"); $("#user-change-name").modal("hide"); } $.unblockUI(); }).fail(function() { alert("Erreur lors du traitement des données"); $.unblockUI(); }); } } }); sessionStorage.removeItem("charika-review-form"); });