";var output=$this.parent().parent().find('.report');output.append(ops);$this.parent().parent().find('.report').find('.graph'+key).animate({width:percent+"%"},{duration:'slow'})});var output=$this.parent().parent().find('.report');output.append("
Total: "+total_vote+"
")}})}});$('body').on("click",".frmSurvey input[type=checkbox]",function(){$this=$(this);var info=$(this).data("info");if($(this).is(":checked")){$this.parent().parent().find('.ajax-loading').html("

");$.ajax({url:"../../modules/survey/ajax_question_stat.php",type:"GET",data:{"survey_id":info.survey_id,"question_id":info.question_id,"option_id":info.option_id,"type":info.type},success:function(html){$this.parent().parent().find('.ajax-loading').html("");obj=JSON.parse(html);var result="";var total_vote=0;var values=[];var options=[];var colors=["lightgreen","lightgray","skyblue","pink","yellow","wheat","powderblue","papayawhip","moccasin","aliceblue","beige","lavender"];var feedback=0;$.each(obj,function(key,value){options.push(value.option);values.push(value.total);total_vote+=parseInt(value.total);if(value.feedback){feedback=value.feedback}else if(value.feedback<0){feedback=value.feedback}});if(feedback==1){$this.parent().parent().find('.ajax-loading').html("
Success. Thank your for your contribution.
")}else if(feedback==0){$this.parent().parent().find('.ajax-loading').html("
Failed. You have alread contributed.
")}else if(feedback<0){$this.parent().parent().find('.ajax-loading').html("
Failed. Please login to make your contribution.
")}var output=$this.parent().parent().find('.report').html("");$.each(values,function(key,v){percent=Math.round((v/total_vote)*100,2);ops="
"+percent+"% "+options[key]+", Counted "+v+"
";var output=$this.parent().parent().find('.report');output.append(ops);$this.parent().parent().find('.report').find('.graph'+key).animate({width:percent+"%"},{duration:'slow'})});var output=$this.parent().parent().find('.report');output.append("
Total: "+total_vote+"
")}})}});$('body').on("click",".frmSurvey .btnSurvey",function(){})});