<%@ page import="java.sql.*, java.lang.*, com.iitguide.utils.dbutils.*, java.util.*, java.text.*,java.io.*" %> <%@ page errorPage="error.jsp" %>

The VIDEO CHAT way of coaching!
Contact us at - Tel: 91-8954000504  or   e-mail: contact@iitguide.com

                                                           

<% if (session.getAttribute("isstudentsession")==null){%>

Please login to watch the high definition video recordings, test series and to access assignments-



Student email-id  
Password


Please use your email-id which you used for course registration and if you do not know your password, please send us an email at contact@iitguide.com.

<%} if (request.getParameter("email_id") != null && !request.getParameter("email_id").equals("") ) { ResultSet rs1; try { Connection connDB=new DBConnection().getConnection(); Statement stmt1 = connDB.createStatement(); String strsql = "select * from students where email_id='"+request.getParameter("email_id")+"' and password='"+request.getParameter("password")+"'"; rs1 = stmt1.executeQuery(strsql); if(rs1.next()) { session.setAttribute("isstudentsession",request.getParameter("email_id")); stmt1.close(); connDB.close(); response.sendRedirect("./studentlogin.jsp"); } else{ stmt1.close(); connDB.close(); } } catch(SQLException r){System.out.println("no"+r);} }%> <% if (session.getAttribute("isstudentsession")!=null) { %> <% ResultSet rs1; ResultSet rs2; ResultSet rs3; ResultSet rs4; ResultSet rs5; //Dummy classes to show that student do not have access ResultSet rs6; try { Connection connDB=new DBConnection().getConnection(); Statement stmt1 = connDB.createStatement(); //instances of courses Statement stmt2 = connDB.createStatement(); //for inner loop Statement stmt3 = connDB.createStatement(); // check the state Statement stmt4 = connDB.createStatement(); // Check the payment status and route to ccavenue Statement stmt5 = connDB.createStatement(); //Dummmy statement to show that student do not have access Statement stmt6 = connDB.createStatement(); // Note: Do not showing the media bookshelf if the student is completed or Ineffective Entry String strsql = null; //Following should be done from database, shalabh doing in code to do test and trial - start - Just change the discount_coupon_code and factor String discount_coupon_code = "EXCEL35"; Double discount_coupon_reduction_factor = (1-0.35); String course_price_effective_with_discount_coupon = ""; //Following should be done from database, shalabh doing in code to do test and trial - end //Forcing for payment either through cc avenue or the bank accounts -- start // registering when students logs in and login is successful - start DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); TimeZone tz = TimeZone.getTimeZone("IST"); dateFormat.setTimeZone(tz); java.util.Date date = new java.util.Date(); System.out.println(date+":"+session.getAttribute("isstudentsession")); strsql = "update students set last_login_date_time='"+dateFormat.format(date)+"' where email_id= '"+session.getAttribute("isstudentsession")+"'"; stmt6.execute(strsql); //System.out.println(strsql); // registering when students logs in and login is successful - end strsql = "Select * from registrationdetailspackage r,offeredcoursepackages o, students s where r.email_id='"+session.getAttribute("isstudentsession")+"' and s.email_id = '"+session.getAttribute("isstudentsession")+"' and r.offered_course_package_code=o.offered_course_package_code and registration_status in ('Registered', 'Cancelled') and r.offered_course_package_code not like 'free%'"; //out.println(strsql); rs4 = stmt4.executeQuery(strsql); boolean showTableHeader =true; //required to show header only when there is a payment due. while (rs4.next() ) { //Shalabh work here and depict it nicely and create the row indices so that only ros clicked is being sent to ccavenue %> <% if (showTableHeader) {%>

<%} showTableHeader=false; %> <%} //Forcing for payment either through cc avenue or the bank accounts -- end %>
You have unpaid course
Unpaid Order No. Course Name Course Price Status Pay Online
<%=rs4.getString("registrationdetailspackage_id")%> You are registered for <%=rs4.getString("offeredcoursepackages_name")%>
Course Contents:<%=rs4.getString("offeredcoursepackages_contents")%>
Click Pay Online to pay "securely" online now to have INSTANT access!


(Send us an email at " target="_top">contact@iitguide.com, if you want to buy other courses)
Rs.   <% //Show the value discounted if the coupon is correct if (request.getParameter("discount_coupon_code_hidden") != null && !request.getParameter("discount_coupon_code_hidden").equals("") && request.getParameter("discount_coupon_code_hidden").equals(discount_coupon_code)) { course_price_effective_with_discount_coupon = Double.toString(Double.parseDouble(rs4.getString("course_price_effective"))*discount_coupon_reduction_factor); out.println(course_price_effective_with_discount_coupon); //display value %><% } //Show the value of original course price effective if coupon is invalid else { course_price_effective_with_discount_coupon=rs4.getString("course_price_effective"); out.println (course_price_effective_with_discount_coupon); //display value } %>



Unpaid ','<%=rs4.getString("r.offered_course_package_code")%>', '<%=session.getAttribute("isstudentsession")%>','<%=course_price_effective_with_discount_coupon%>','<%=rs4.getString("offeredcoursepackages_name")%>','<%=rs4.getString("first_name")%>','<%=rs4.getString("last_name")%>');" />

<% //start the display of bookshelf //get the unique all_* courses in set strsql= "Select * from registrationdetailspackage r,offeredcoursepackages o where r.email_id='"+session.getAttribute("isstudentsession")+"' and r.offered_course_package_code=o.offered_course_package_code"; //out.println(strsql); rs1 = stmt1.executeQuery(strsql); TreeSet setids = new TreeSet(); String substringid = ""; int index = 0; while (rs1.next()) { index = rs1.getString("o.mapped_to_offered_course_package_code").indexOf("_"); // you are changing the course from offered_course_package_code to mapped_to_offered_course_package_code here substringid = rs1.getString("o.mapped_to_offered_course_package_code").substring(index); // you are changing the course from offered_course_package_code to mapped_to_offered_course_package_code here //out.print(substringid); -- Now Treeset should only contain all_ for all the things student has registered, further we will recurse on this all to check individual course package such as chemistry physics or math. //attempting to take out completed course or ineffective entry for good students (bad students see all cancelled courses) and also exclude free package if (!rs1.getString("registration_status").equals("Completed") && !rs1.getString("registration_status").equals("IneffectiveEntry") && !rs1.getString("r.offered_course_package_code").contains("free")) { setids.add("all"+substringid); //Tree set will contain mapped_to_offered_course_package_code for a student registered for offered_course_package_code - means a student registering for crashcourse_main_2015_1 will have entry in tree set as all_main_2014_1 because that is the real course. } } Iterator itr = setids.iterator(); boolean videoaccess = false; String message = null; //the big while loop, required when a student register for more than one packages (like last year and this year) -- knowing all packages of any course registered. int i = 1; while (itr.hasNext()) { String parent_offered_course_package_code = itr.next().toString(); //find all packages associated to all_main_ - start strsql = "select * from offeredcoursepackages where parent_offered_course_package_code = '"+parent_offered_course_package_code+"'"; rs2 = stmt2.executeQuery(strsql); //find all packages associated to all_main_ - end %>
Selected Title
<%while(rs2.next() && !rs2.getString("offered_course_package_code").contains("all") ) { strsql = "SELECT subject_code,chapter_name, c.chapter_code, o.offered_course_code, recordinglink,DATE_FORMAT(recordinglink_expiration, '%W, %M %D %Y'),DATE_FORMAT(schedule, '%W, %M %D %Y, ' '%H:%i:%s') FROM offeredcourses o, courses c where o.offered_course_package_code='"+rs2.getString("offered_course_package_code")+"' and o.chapter_code=c.chapter_code order by schedule"; //out.println(strsql); rs1 = stmt1.executeQuery(strsql); //rs1 now has the all instances of offeredcourses for physics or chemistry or math //Find the State of student for physics, mathematics or chemistry courses -- start //getting the status of the student on this particular course package - like physics_main_, chemistry_main_ etc, so this means that on this inner while you are setting access of vide based on paid status strsql = "select * from registrationdetailspackage r,offeredcoursepackages o where mapped_to_offered_course_package_code = '"+rs2.getString("offered_course_package_code")+"' and email_id='"+session.getAttribute("isstudentsession")+"' and r.offered_course_package_code=o.offered_course_package_code"; rs3 = stmt3.executeQuery(strsql); if (rs3.next()) { if (rs3.getString("registration_status").equals("Registered") ){ videoaccess = false; message = "You have not paid for the course and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("Paid") ){ videoaccess = true; } if (rs3.getString("registration_status").equals("TrialVideo")){ videoaccess = true; message = "You have not paid for the course and videos are available for limited time to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("Cancelled")){ videoaccess = false; message ="You registration has been cancelled and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("AllowAssignments")){ videoaccess = false; message ="You have not paid for the course and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} } //getting the status of the student on this particular course package through all_main is true for him (remember you now need to parent_offered_course_package_code to mapped_to_offered_course_package_code strsql = "select * from registrationdetailspackage r,offeredcoursepackages o where mapped_to_offered_course_package_code = '"+parent_offered_course_package_code+"' and email_id='"+session.getAttribute("isstudentsession")+"' and r.offered_course_package_code=o.offered_course_package_code"; rs3 = stmt3.executeQuery(strsql); if (rs3.next()) { if (rs3.getString("registration_status").equals("Registered") ){ videoaccess = false; message = "You have not paid for the course and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("Paid") ){ videoaccess = true; } if (rs3.getString("registration_status").equals("TrialVideo")){ videoaccess = true; message = "You have not paid for the course and videos are available for limited time to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("Cancelled")){ videoaccess = false; message = "You registration has been cancelled and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} if (rs3.getString("registration_status").equals("AllowAssignments")){ videoaccess = false; message ="You have not paid for the course and videos are not available to you. Please contact at 91-8954000504 or contact@iitguide.com for getting access to video recordings.";} } //Find the State of student for physics, mathematics or chemistry courses -- end %> <%if (rs2.getString("subject_code").equals("chemistry")) { if (videoaccess) { %>
<%while(rs1.next() ) { if (rs1.getString("recordinglink")!=null && !rs1.getString("recordinglink").equals("null") && rs1.getString("recordinglink").contains("vimeo")) {//System.out.println("3"); %>
;" title="" >.png" alt="" width="210" height="128" / >
<%} }//closing while %>
<% } //Deal with showing no video to student, note that we are hardcoding all_main_2014 courses- student will see these no access regardless of any course he registered - start if (!videoaccess) { %>
<% strsql = "SELECT * FROM offeredcourses where offered_course_package_code='chemistry_main_2015_1' order by schedule"; rs5 = stmt5.executeQuery(strsql); while(rs5.next() ) { %>
.png" alt="" width="210" height="128" />
<% }//closing while %>
<% } //Deal with showing no video to student - end }%> <%if (rs2.getString("subject_code").equals("mathematics")) { if (videoaccess ) {%>
<%while(rs1.next() ) { if (rs1.getString("recordinglink")!=null && !rs1.getString("recordinglink").equals("null") && rs1.getString("recordinglink").contains("vimeo")) {//System.out.println("3"); %>
" title="">.png" alt="" width="210" height="128" />
<%} } //closing while %>
<%} //Deal with showing no video to student, note that we are hardcoding all_main_2014 courses- student will see these no access regardless of any course he registered - start if (!videoaccess) {%>
<% strsql = "SELECT * FROM offeredcourses where offered_course_package_code='mathematics_main_2015_1' order by schedule"; rs5 = stmt5.executeQuery(strsql); while(rs5.next() ) { %>
.png" alt="" width="210" height="128" />
<% }//closing while %>
<% } //Deal with showing no video to student - end }%> <%if (rs2.getString("subject_code").equals("physics")) { if (videoaccess ) {%>
<%while(rs1.next() ) { if (rs1.getString("recordinglink")!=null && !rs1.getString("recordinglink").equals("null") && rs1.getString("recordinglink").contains("vimeo")) {//System.out.println("3"); %>
;" title="">.png" alt="" width="210" height="128" />
<%} }//closing while %>
<%} //Deal with showing no video to student, note that we are hardcoding all_main_2014 courses- student will see these no access regardless of any course he registered - start if (!videoaccess) {%>
<% strsql = "SELECT * FROM offeredcourses where offered_course_package_code='physics_main_2015_1' order by schedule"; rs5 = stmt5.executeQuery(strsql); while(rs5.next() ) { %>
.png" alt="" width="210" height="128" />
<% }//closing while %>
<% } //Deal with showing no video to student - end } %> <% videoaccess=false; //setting video acess to false to reinitialize for this loop. }%>

<% }%>

user: <%=session.getAttribute("isstudentsession")%> | Change Password | Log Out

<% stmt1.close(); stmt2.close(); stmt3.close(); stmt4.close(); stmt5.close(); stmt6.close(); connDB.close(); } catch(SQLException r){out.println("no"+r); throw r;} %>
<%}%>