My question for advance java related....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • parthjpatel
    New Member
    • Feb 2015
    • 4

    My question for advance java related....

    hi guys , In my case I working on one music portal..
    I have one problem guys. In my system , after some ratings by users on uploader (artist) page . I want to display one hide button which is already there.
    Ex- users are rate the particular song of artist then after I admin have satified after 3 rate out of 5 then one {send for license} button to display on artist page which is already hide.

    Code:
     #btn1
                {
                    display:none;
                }
    this button is in one division which is separate,
    Code:
     <div> 
                    <form action="send_l.jsp">
                        <input  id="btn1" type="submit" value="send for license"/>
                    </form>
                </div>
    and I has been find ratings through ajax call to one jsp. and this counter display on artist_page jsp.]
  • parthjpatel
    New Member
    • Feb 2015
    • 4

    #2
    Code:
     var a = 0;
                setInterval(function ajaxcall()
          
                {
    
                    /*< audio controls >
                         < source src = "bell-ringing-05.mp3" type = "audio/mpeg" >
                         < /audio>*/
                    var xmlhttp;
                    if (window.XMLHttpRequest) {
                        // code for IE7+, Firefox, Chrome, Opera, Safari
                        xmlhttp = new XMLHttpRequest();
                    }
                    xmlhttp.onreadystatechange = function() {
                        if (xmlhttp.readyState == 4) {
                            var res = xmlhttp.responseText;
                            //                        alert(res);
                            if (res != a) {
                                document.getElementById('counter').innerHTML = res;
                                a = res
                                abc();
                                xyz();
                            }
                        }
                    }
                    xmlhttp.open("GET", "l_counter.jsp", true);
                    xmlhttp.send();
    
                }, 6000);

    Comment

    • parthjpatel
      New Member
      • Feb 2015
      • 4

      #3
      Code:
      <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
      
      <sql:setDataSource driver="com.mysql.jdbc.Driver"
           				   url="jdbc:mysql://localhost:3306/music_portal"
           				   var="localSource"
           				   user="root"
           				   password=""/>   
            <sql:query dataSource="${localSource}" var="result">
                SELECT COUNT(s_id) as cnt from song_rating_tab where average>=3.5;
            </sql:query>
            <c:forEach items="${result.rows}" var="row">
                <c:set var="cnt" value="${row.cnt}"> </c:set>
                 
            </c:forEach>
           <c:out value="${cnt}"/>

      Comment

      • parthjpatel
        New Member
        • Feb 2015
        • 4

        #4
        above code is store the ratings in one divition name(counter).

        Comment

        Working...