Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Internet Explorer VBScript runtime (0x800A01A8)

    i got the following error i.e.
    Error Type:
    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'ChkFeeType'
    /School/Fee/FeeIntimation.asp, line 309




    code :
    <%
    Opendb()
    If not session("login") Then
    Closedb()
    response.redirect (ROOT & "/logout.asp")
    Else
    CheckNavigationAccess Trim(CInt(session("DID"))),Trim(CInt(rstr("NAVID")))
    End If
    %>
    <html>
    <HEAD>

    <link type="text/css" rel="stylesheet" href="<%=ROOT%>/css/styles.css">
    <link type="text/css" rel="stylesheet" href="<%=ROOT%>/css/calender.css">
    <script type="text/javascript" src="<%=ROOT%>/js/popcalendar.js"></script>
    <script type='text/javascript' src='<%=ROOT%>/js/common.js'></script>
    <title>Fee Intimation Slips</title>
    <!-- #include Virtual ="School/inc/lib.asp" -->
    <script>
    var blnChecked
    var bchecked
    function F_Fee_Intimation_GetSections(frm,url)
    {
    if (frm.intSection_id)
    {
    frm.intSection_id.options[frm.intSection_id.selectedIndex].value = ""
    }
    frm.action =url;
    frm.submit();
    }
    function F_Fee_Intimation_validate(frm)
    {
    blnChecked = false
    bchecked=false
    if(frm.intClassId.value == "")
    {
    alert("Please select class")
    frm.intClassId.focus();
    return false;
    }
    if(frm.intSection_id.value == "")
    {
    alert("Please select section")
    frm.intSection_id.focus();
    return false;
    }
    /*if(frm.intFeeTypeId.value == "")
    {
    alert("Select Fee type upto")
    frm.intFeeTypeId.focus();
    return false;
    }*/
    if(frm.ChkFeeType.length == undefined)
    {
    if(frm.ChkFeeType.checked == false)
    {
    alert("Please check at least one fee type to gernerate Fee intimation slips")
    return false;
    }

    else
    blnChecked = true
    }

    for(var i=0; i<frm.ChkFeeType.length; i++)
    {
    if(frm.ChkFeeType[i].checked == true)
    {
    blnChecked = true
    }
    }
    if(!blnChecked)
    {
    alert("Please check at least one fee type to gernerate Fee intimation slips")
    return false;
    }

    if(frm.ChkBusFeeType.length == undefined)
    {
    if(frm.ChkBusFeeType.checked == false)
    {
    alert("Please check at least one bus fee month to gernerate Fee intimation slips")
    return false;
    }

    else
    bchecked = true
    }

    for(var i=0; i<frm.ChkBusFeeType.length; i++)
    {
    if(frm.ChkBusFeeType[i].checked == true)
    {
    bchecked = true
    }
    }
    if(!bchecked)
    {
    alert("Please check at least one bus fee month to gernerate Fee intimation slips")
    return false;
    }

    if(frm.strDueDate.value =="")
    {
    alert("Please select due date")
    frm.strDueDate.focus();
    return false;

    }
    frm.btnSubmit.disabled = true;
    }
    function F_Print_FeeIntimation(url)
    {
    document.open(url,'cardview2','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=630,height= 500')
    }
    </Script>
    </HEAD>
    <body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onKeyPress="return disableCtrlKeyCombination(event);" onKeyDown="return disableCtrlKeyCombination(event);">
    <%
    opendb()
    print ("<form name='F_Fee_Intimation' method='post' action='FeeIntimation.asp?NAVID="&rstr("NAVID")&"&RID="&rstr("RID")&"&action=getSections&report=duel ist' onSubmit='return F_Fee_Intimation_validate(document.F_Fee_Intimation);'>")

    print("<table width='100%' border='0' cellpadding=0 cellspacing= 0 bordercolor='red'>")

    print("<tr height='10' bgcolor='#F4F4F4'><td valign='top'>")
    InnerLinksRow rstr("navid"), rstr("RID")
    print("</td></tr>")


    print("<tr><td height='10'>&nbsp</td></tr>")

    print ("<tr height='10'><td valign='top'>")
    print ("<table cellpadding=4 cellspacing=1 align=center width='50%' border=0 bordercolor='red' >")
    print ("<tr><td>")
    print ("<fieldset class='normal'><legend>Fee Intimation</legend>")
    print ("<table cellpadding=4 cellspacing=0 align=center width='100%' border=0 bordercolor='red' >")

    print ("<Tr><td align='right' class='normal' valign='top' width='40%'>Select class :</td><td>")
    print ("<select name='intClassId' class='input_txt' onchange=""F_Fee_Intimation_GetSections(document.F_Fee_Intimation,'"&PAGE&"?NAVID="&rstr("NAVID")&"& RID="&rstr("RID")&"&action=getSections')""><option value=''>Select Class</option>")

    rsTemp.open "EXEC Fee_GetAllClasses",conn,3,3
    If rsTemp.recordcount > 0 Then
    While Not rsTemp.EOF
    print ("<option value='"&rsTemp("Class_id")&"'")
    If request("intClassId") <> "" then
    If CInt(rsTemp("Class_id")) = CInt(request("intClassId")) Then
    print (" selected ")
    End If
    End if
    print (" >"&rsTemp("Class_name")&"</option>")
    rsTemp.movenext()
    Wend
    End If
    rsTemp.close
    print ("</select>")
    print("</td></tr>")

    If rstr("action") = "getSections" then
    print ("<Tr><td align='right' class='normal'>Section :</td><td><select class='input_txt' name='intSection_id'><option value=''>Select Section</option>")
    rsTemp.open "EXEC STUDENT_GetSectionsByClassId '"&rform("intClassId")&"' ",conn,3,3
    If rsTemp.recordcount > 0 then
    while not rsTemp.EOF
    print ("<option value='"&rsTemp("Section_id")&"'")
    If request("intSection_id") <> "" then
    If CInt(rsTemp("Section_id")) = CInt(request("intSection_id")) Then
    print (" selected ")
    End If
    End if
    print(">"&rsTemp("Section_Name")&"</option>")
    rsTemp.movenext()
    wend
    End if
    rsTemp.close
    print ("</select></td></tR>")


    rsTemp.open "SELECT * FROM TBLTermFeeTypes WHERE FY_ID = "&GETFYID()&" AND CLASS_ID="&TRIM(rform("intClassId")),conn,3,3
    If rsTemp.recordcount > 0 then
    print ("<Tr><td align='right' class='normal'>Fee Types :</td>")
    print ("<td class='normal'>")
    While not rsTemp.EOF
    print ("<input type='checkbox' name='ChkFeeType' value='"&rsTemp("FeeType_Id")&"'>"&rsTemp("Description")&" (Rs."&rsTemp("Amount")&")<br />")
    rsTemp.movenext
    Wend
    End if
    rsTemp.close
    print ("</td></tr>")



    rsTemp.open "SELECT Month_Id, MONTH_NAME, YEAR FROM TBLMONTHS WHERE FY_ID = "&GETFYID(),conn,3,3
    If rsTemp.recordcount > 0 then
    print ("<Tr><td align='right' class='normal'>Month :</td>")
    print ("<td class='normal'>")
    While not rsTemp.EOF
    print ("<input type='checkbox' name='ChkBusFeeType' value='"&rsTemp("Month_Id")&"'>"&rsTemp("MONTH_NAME")&"-"&rsTemp("YEAR")&"<br />")
    rsTemp.movenext
    Wend



    print ("<Tr><td align='right' class='normal'>Due Date :</td><td><input type='text' name='strDueDate' readonly class='input_txt'>")
    %>
    <script language='javascript'>
    <!--
    if (!document.layers)
    {
    document.write('<a href="javascript:void(0);" onclick="popUpCalendar(F_Fee_Intimation.strDueDate, F_Fee_Intimation.strDueDate, \'mm/dd/yyyy\');"><img src="<%=ROOT%>/images/cal.gIf" border="0" align="absmiddle" alt="Due date"></a>')
    }
    //-->
    </script>
    <%
    Print ("</td></tr>")
    print ("<Tr><td align='center' colspan='2'><input type='Submit' class='input_txt' name='btnSubmit' value='Generate'></td></tr>")
    Else
    print ("<Tr><td align='center' colspan='2' class='rednormal'>Fee types are not yet declared.<br />Please contact administrator</td></tr>")
    End if
    rsTemp.close
    print("</form>")
    End if

    print ("</table>")
    print ("</fieldset>")
    print("</td></tr>")
    print ("</table>")
    print("</td></tr>")

    If Trim(rform("intClassId")) <> "" and Trim(rform("intSection_id")) <> "" then
    intFYId = getFYID()
    flgDataExists = false
    strClassName = getClass(rform("intClassId"))
    strSectionName = getSection(rform("intSection_id"))

    'rsTemp.open "SELECT FirstName ,lastname, Date_Created FROM tblFeeIntimationSlips TFI, tbluser TU WHERE Class_Id=" & Trim(rform("intClassId")) & " AND Section_Id = " & Trim(rform("intSection_id")) & " AND FY_ID = "&intFYId &" AND Convert (VARCHAR, Date_Created,101) = Convert (VARCHAR, '"& getLocalDateTime()&"',101) AND TFI.UID = TU.UID ORDER BY DATE_CREATED DESC ",CONN,3,3

    rsTemp.open "Exec sp_FeeCheckGen "&cint(Trim(rform("intClassId"))) & ", " & cint(Trim(rform("intSection_id"))) & ", '" & getLocalDateTime() &"','Term Fees','Bus Fees'",conn,3,3


    If rsTemp.recordcount > 0 then
    flgDataExists = true
    strUserName = rsTemp("FirstName") & " " & rsTemp("lastname")
    strGenTime = FormatDateTime(rsTemp("Date_Created"),1)&" "&FormatDateTime(rsTemp("Date_Created"),3)
    End if
    rsTemp.close


    If Trim(rform("intClassId")) <> "" and Trim(rform("intSection_id")) <> "" and Trim(rstr("report")) = "duelist" and flgDataExists = false Then

    strClass = getClass(Trim(rform("intClassId")))
    strSection = getSection(Trim(rform("intSection_id")))

    rsTemp.open "SELECT ISNULL(MAX(FeeIntimationId),1000) CNT FROM tblFeeIntimationSlips", CONN,3,3
    If rsTemp.recordcount > 0 then
    slipId = rsTemp("CNT") + 1
    End if
    rsTemp.close
    intStartSlipId = slipId

    intReceiptCatId = 0
    rsTemp.open "Select Receipt_Cat_Id FROM tblReceiptCategory where Receipt_Category_Name in('Term Fees','Bus Fees')", CONN,3,3
    If rsTemp.recordcount > 0 then
    intReceiptCatId = rsTemp("Receipt_Cat_id")

    End if
    rsTemp.close


    rsTemp.open "EXEC sp_prashanth " &Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&request("ChkFeeType")&"','"&request ("ChkBusFeeType")&"'",conn,3,3
    If rsTemp.recordcount >0 Then
    'print ("STEP 1<BR>")
    intStudentId = 0
    strSQL = ""

    While Not rsTemp.eof
    If intStudentId <> rsTemp("Student_id") then
    If intStudentId <> 0 then
    strSlip = strSlip & "<tr><td class=""normal"" align=""right"">Total Due:</td><td class=""normal"" align=""right""><b>"&totalDue&"</b></td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">Pay on or before : "&getDateFormat(request("strDueDate"))&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">"&ChequeAmount(totalDue)&"</td></tr>"

    totalDue = 0
    strSlip = strSlip & "</TABLE>"
    'strSlip = strSlip & "</TD></tr>"
    'print strSlip
    strSQL = strSQL & "INSERT INTO tblFeeIntimationSlips(FeeIntimationId,FY_ID,Receipt_Cat_Id,Student_Id,Date_Created,UID, Class_Id, Section_Id, FeeParticulars,Batchid)"
    strSQL = strSQL & "SELECT " &slipId&","&intFYId&","&intReceiptCatId&","&intStudentId&",'"&getLocalDateTime&"',"&session("DID")&" ,"&Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&strSlip&"',0; "
    strPrintSlip = strPrintSlip & strSlip
    strSlip = ""
    slipId = slipId + 1
    End if
    'strSlip = strSlip & "<tr><TD>"

    strSlip = strSlip & "<table align=""center"" cellpadding=4 cellspacing=0 border=1 bordercolor=""gray"">"
    strSlip = strSlip & "<tr><td colspan=2 class=blackbold align=""center""><b>Montessori English Medium School</b></td></tr>"
    strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center""><b>"&getInstance()&".</b></td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center"">&nbsp;</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal"">Slip Id: "&slipId&"</td><td class=""normal"">Date:"&getDateFormat(getLocalDateTime)&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Name : "&rsTemp("FULLName")&"</td><td class=""normal"">"& rsTEmp("Student_Code")&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Parent : "&rsTemp("FatherName")&"</td><td class=""normal"">"&strClass & " ("& strSection &")</td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align="""">------------------------------------------------------------------------------------------------------------------</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal""><b>Fee Particulars</b></td><td class=""normal"" align=""left""><b>Amount</b></td></tr>"
    'strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"

    End If
    If ChkFeeType.checked=True Then
    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"
    End If
    If ChkBusFeeType.checked=false Then
    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_BUS")&"</td><td class=""normal"">"&rsTemp("due_busamount")&"</td></tr>"
    End If
    intStudentId = rsTemp("Student_id")
    totalDue = totalDue +rsTemp("due_busamount")+rsTemp("due_feeamount")
    rsTemp.movenext
    Wend
    'TOTALDUEAMOUNT = totalDue+rsTemp("due_feeamount")
    rsTemp.close

    strSlip = strSlip & "<tr><td class=""normal"" align=""right"">Total Due:</td><td class=""normal"" align=""right""><b>"&totalDue&"</b> </td></tr>"

    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">Pay on or before : "&getDateFormat(getLocalDateTime)&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">"&ChequeAmount(totalDue)&"</td></tr>"
    strSlip = strSlip & "</TABLE>"

    strSQL = strSQL & "INSERT INTO tblFeeIntimationSlips(FeeIntimationId,FY_ID,Receipt_Cat_Id,Student_Id,Date_Created,UID,Class_Id, Section_Id, FeeParticulars,Batchid)"
    strSQL = strSQL & "SELECT " &slipId&","&intFYId&","&intReceiptCatId&","&intStudentId&",'"&getLocalDateTime()&"',"&session("DID") &","&Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&strSlip&"',0; "
    strPrintSlip = strPrintSlip & strSlip

    print("<tr height='100%'><td valign='top'>")
    PRINT ("<table align=""center"" cellpadding=4 cellspacing=0 border=1 style='border-color:#DDDDDD;border-width:1px;border-style:Solid;border-collapse:collapse;'>")

    on error resume next
    Conn.beginTrans

    conn.execute(strSQL)

    strSQL = "INSERT INTO tblFeeIntimationBatches (FeeIntimationStartId, FeeIntimationEndId, Receipt_Cat_Id, Class_Id, Section_Id, Date_Created, UID, fy_id) VALUES("&intStartSlipId&","&slipId&","&intReceiptCatId&","&Trim(rform("intClassId"))&","&Trim(rform( "intSection_id"))&",'"&getDateFormat(getLocalDateTime)&"',"&session("DID")&","&intFYID&")"

    Conn.Execute(strSQL)

    rsTemp.open "SELECT Batchid from tblFeeIntimationBatches WHERE FeeIntimationStartId="&intStartSlipId&" AND FeeIntimationEndId="&slipId ,conn,3,3
    If rsTemp.recordcount > 0 then
    intBatchId = rsTemp("BatchId")
    End if
    rsTemp.close

    strSQL = "UPDATE tblFeeIntimationSlips SET BATCHID = "&intBatchId&" WHERE FeeIntimationId BETWEEN "&intStartSlipId&" AND "&slipId
    conn.execute (strSQL)

    Call checkDBError(strSQL)
    Conn.commitTrans

    'print (strPrintSlip)

    PRINT ("</TABLE>")
    print("</TD></tr>")

    print("<tr><td colspan='2' align='center' class='greennormal'>Fee intimation slips generated successfully. Batch ID =<b>"&intBatchId&"</b></td></tr>")
    print("<tr><td colspan='2' align='center'>")
    'print ("<input type='submit' value='Print Fee Intimation Slips' class='inputbutton' onclick = ""F_Print_FeeIntimation('printFeeIntimation.asp?NAVID="&request("NAVID")&"&intStartId="&intStartSlip Id&"&intEndId="&slipId&"&action=printFeeIntimationSlips');"">")
    print("<a href='printFeeIntimation.asp?NAVID="&request("NAVID")&"&intStartId="&intStartSlipId&"&intEndId="&sli pId&"&action=printFeeIntimationSlips' target=_blank class='normal'>Print</a>")
    print ("</td></tr>")

    print("</table></td></tr>")
    %>
    <script>alert("Fee intimation Batch Id:"+<%=intBatchId%>)</script>
    <%
    Else
    print ("<tr height='10'><td class='normal' align='center'>No Dues found in "&strClassName&" ("&strSectionName&")</td></tr>")
    End If

    Else
    print ("<tr><td class='rednormal' align='center'>Fee intimation slips already generated by <strong>"&strUserName&" </strong> <br />on <strong>"& strGenTime &"</strong>. You can generate tomorrow.</td></tr>")
    End if

    End if
    print ("</table>")
    closedb()
    %>
    </body>
    </html>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,635 Times in 4,597 Posts
    It would help if you would show us WHICH LINE the problem is on.

    I am *guessing* it is here:
    Code:
        If ChkFeeType.checked=True Then
    which would make sense, because you are trying to use a DOM property (Document Object Model, the version of the web page as seen by javascript *IN THE BROWSER*) in server-side code.

    Nope, can't do that, at all.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    again i have same problem at
    if request("ChkFeeType")=True Then
    could you tell me how to use chekbox id in the if condition.Actually in my code two groups of check boxes are there(ChkFeeType,ChkBusFeeType).one group has three items second group has 12 items.when i checked the checkboxes of two groups the loop will be running for the max.no.of items.For that i want to use if condition to stop the retrive the data if not necessary



    code is

    <%
    Opendb()
    If not session("login") Then
    Closedb()
    response.redirect (ROOT & "/logout.asp")
    Else
    CheckNavigationAccess Trim(CInt(session("DID"))),Trim(CInt(rstr("NAVID")))
    End If
    %>
    <html>
    <HEAD>

    <link type="text/css" rel="stylesheet" href="<%=ROOT%>/css/styles.css">
    <link type="text/css" rel="stylesheet" href="<%=ROOT%>/css/calender.css">
    <script type="text/javascript" src="<%=ROOT%>/js/popcalendar.js"></script>
    <script type='text/javascript' src='<%=ROOT%>/js/common.js'></script>
    <title>Fee Intimation Slips</title>
    <!-- #include Virtual ="School/inc/lib.asp" -->
    <script>
    var blnChecked
    var bchecked
    function F_Fee_Intimation_GetSections(frm,url)
    {
    if (frm.intSection_id)
    {
    frm.intSection_id.options[frm.intSection_id.selectedIndex].value = ""
    }
    frm.action =url;
    frm.submit();
    }
    function F_Fee_Intimation_validate(frm)
    {
    blnChecked = false
    bchecked=false
    if(frm.intClassId.value == "")
    {
    alert("Please select class")
    frm.intClassId.focus();
    return false;
    }
    if(frm.intSection_id.value == "")
    {
    alert("Please select section")
    frm.intSection_id.focus();
    return false;
    }
    /*if(frm.intFeeTypeId.value == "")
    {
    alert("Select Fee type upto")
    frm.intFeeTypeId.focus();
    return false;
    }*/
    if(frm.ChkFeeType.length == undefined)
    {
    if(frm.ChkFeeType.checked == false)
    {
    alert("Please check at least one fee type to gernerate Fee intimation slips")
    return false;
    }

    else
    blnChecked = true
    }

    for(var i=0; i<frm.ChkFeeType.length; i++)
    {
    if(frm.ChkFeeType[i].checked == true)
    {
    blnChecked = true
    }
    }
    if(!blnChecked)
    {
    alert("Please check at least one fee type to gernerate Fee intimation slips")
    return false;
    }

    if(frm.ChkBusFeeType.length == undefined)
    {
    if(frm.ChkBusFeeType.checked == false)
    {
    alert("Please check at least one bus fee month to gernerate Fee intimation slips")
    return false;
    }

    else
    bchecked = true
    }

    for(var i=0; i<frm.ChkBusFeeType.length; i++)
    {
    if(frm.ChkBusFeeType[i].checked == true)
    {
    bchecked = true
    }
    }
    if(!bchecked)
    {
    alert("Please check at least one bus fee month to gernerate Fee intimation slips")
    return false;
    }

    if(frm.strDueDate.value =="")
    {
    alert("Please select due date")
    frm.strDueDate.focus();
    return false;

    }
    frm.btnSubmit.disabled = true;
    }
    function F_Print_FeeIntimation(url)
    {
    document.open(url,'cardview2','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=630,height= 500')
    }
    </Script>
    </HEAD>
    <body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onKeyPress="return disableCtrlKeyCombination(event);" onKeyDown="return disableCtrlKeyCombination(event);">
    <%
    opendb()
    print ("<form name='F_Fee_Intimation' method='post' action='FeeIntimation.asp?NAVID="&rstr("NAVID")&"&RID="&rstr("RID")&"&action=getSections&report=duel ist' onSubmit='return F_Fee_Intimation_validate(document.F_Fee_Intimation);'>")

    print("<table width='100%' border='0' cellpadding=0 cellspacing= 0 bordercolor='red'>")

    print("<tr height='10' bgcolor='#F4F4F4'><td valign='top'>")
    InnerLinksRow rstr("navid"), rstr("RID")
    print("</td></tr>")


    print("<tr><td height='10'>&nbsp</td></tr>")

    print ("<tr height='10'><td valign='top'>")
    print ("<table cellpadding=4 cellspacing=1 align=center width='50%' border=0 bordercolor='red' >")
    print ("<tr><td>")
    print ("<fieldset class='normal'><legend>Fee Intimation</legend>")
    print ("<table cellpadding=4 cellspacing=0 align=center width='100%' border=0 bordercolor='red' >")

    print ("<Tr><td align='right' class='normal' valign='top' width='40%'>Select class :</td><td>")
    print ("<select name='intClassId' class='input_txt' onchange=""F_Fee_Intimation_GetSections(document.F_Fee_Intimation,'"&PAGE&"?NAVID="&rstr("NAVID")&"& RID="&rstr("RID")&"&action=getSections')""><option value=''>Select Class</option>")

    rsTemp.open "EXEC Fee_GetAllClasses",conn,3,3
    If rsTemp.recordcount > 0 Then
    While Not rsTemp.EOF
    print ("<option value='"&rsTemp("Class_id")&"'")
    If request("intClassId") <> "" then
    If CInt(rsTemp("Class_id")) = CInt(request("intClassId")) Then
    print (" selected ")
    End If
    End if
    print (" >"&rsTemp("Class_name")&"</option>")
    rsTemp.movenext()
    Wend
    End If
    rsTemp.close
    print ("</select>")
    print("</td></tr>")

    If rstr("action") = "getSections" then
    print ("<Tr><td align='right' class='normal'>Section :</td><td><select class='input_txt' name='intSection_id'><option value=''>Select Section</option>")
    rsTemp.open "EXEC STUDENT_GetSectionsByClassId '"&rform("intClassId")&"' ",conn,3,3
    If rsTemp.recordcount > 0 then
    while not rsTemp.EOF
    print ("<option value='"&rsTemp("Section_id")&"'")
    If request("intSection_id") <> "" then
    If CInt(rsTemp("Section_id")) = CInt(request("intSection_id")) Then
    print (" selected ")
    End If
    End if
    print(">"&rsTemp("Section_Name")&"</option>")
    rsTemp.movenext()
    wend
    End if
    rsTemp.close
    print ("</select></td></tR>")


    rsTemp.open "SELECT * FROM TBLTermFeeTypes WHERE FY_ID = "&GETFYID()&" AND CLASS_ID="&TRIM(rform("intClassId")),conn,3,3
    If rsTemp.recordcount > 0 then
    print ("<Tr><td align='right' class='normal'>Fee Types :</td>")
    print ("<td class='normal'>")
    While not rsTemp.EOF
    print ("<input type='checkbox' name='ChkFeeType' value='"&rsTemp("FeeType_Id")&"'>"&rsTemp("Description")&" (Rs."&rsTemp("Amount")&")<br />")
    rsTemp.movenext
    Wend
    End if
    rsTemp.close
    print ("</td></tr>")



    rsTemp.open "SELECT Month_Id, MONTH_NAME, YEAR FROM TBLMONTHS WHERE FY_ID = "&GETFYID(),conn,3,3
    If rsTemp.recordcount > 0 then
    print ("<Tr><td align='right' class='normal'>Month :</td>")
    print ("<td class='normal'>")
    While not rsTemp.EOF
    print ("<input type='checkbox' name='ChkBusFeeType' value='"&rsTemp("Month_Id")&"'>"&rsTemp("MONTH_NAME")&"-"&rsTemp("YEAR")&"<br />")
    rsTemp.movenext
    Wend



    print ("<Tr><td align='right' class='normal'>Due Date :</td><td><input type='text' name='strDueDate' readonly class='input_txt'>")
    %>
    <script language='javascript'>
    <!--
    if (!document.layers)
    {
    document.write('<a href="javascript:void(0);" onclick="popUpCalendar(F_Fee_Intimation.strDueDate, F_Fee_Intimation.strDueDate, \'mm/dd/yyyy\');"><img src="<%=ROOT%>/images/cal.gIf" border="0" align="absmiddle" alt="Due date"></a>')
    }
    //-->
    </script>
    <%
    Print ("</td></tr>")
    print ("<Tr><td align='center' colspan='2'><input type='Submit' class='input_txt' name='btnSubmit' value='Generate'></td></tr>")
    Else
    print ("<Tr><td align='center' colspan='2' class='rednormal'>Fee types are not yet declared.<br />Please contact administrator</td></tr>")
    End if
    rsTemp.close
    print("</form>")
    End if

    print ("</table>")
    print ("</fieldset>")
    print("</td></tr>")
    print ("</table>")
    print("</td></tr>")

    If Trim(rform("intClassId")) <> "" and Trim(rform("intSection_id")) <> "" then
    intFYId = getFYID()
    flgDataExists = false
    strClassName = getClass(rform("intClassId"))
    strSectionName = getSection(rform("intSection_id"))

    'rsTemp.open "SELECT FirstName ,lastname, Date_Created FROM tblFeeIntimationSlips TFI, tbluser TU WHERE Class_Id=" & Trim(rform("intClassId")) & " AND Section_Id = " & Trim(rform("intSection_id")) & " AND FY_ID = "&intFYId &" AND Convert (VARCHAR, Date_Created,101) = Convert (VARCHAR, '"& getLocalDateTime()&"',101) AND TFI.UID = TU.UID ORDER BY DATE_CREATED DESC ",CONN,3,3

    rsTemp.open "Exec sp_FeeCheckGen "&cint(Trim(rform("intClassId"))) & ", " & cint(Trim(rform("intSection_id"))) & ", '" & getLocalDateTime() &"','Term Fees','Bus Fees'",conn,3,3


    If rsTemp.recordcount > 0 then
    flgDataExists = true
    strUserName = rsTemp("FirstName") & " " & rsTemp("lastname")
    strGenTime = FormatDateTime(rsTemp("Date_Created"),1)&" "&FormatDateTime(rsTemp("Date_Created"),3)
    End if
    rsTemp.close


    If Trim(rform("intClassId")) <> "" and Trim(rform("intSection_id")) <> "" and Trim(rstr("report")) = "duelist" and flgDataExists = false Then

    strClass = getClass(Trim(rform("intClassId")))
    strSection = getSection(Trim(rform("intSection_id")))

    rsTemp.open "SELECT ISNULL(MAX(FeeIntimationId),1000) CNT FROM tblFeeIntimationSlips", CONN,3,3
    If rsTemp.recordcount > 0 then
    slipId = rsTemp("CNT") + 1
    End if
    rsTemp.close
    intStartSlipId = slipId

    intReceiptCatId = 0
    rsTemp.open "Select Receipt_Cat_Id FROM tblReceiptCategory where Receipt_Category_Name in('Term Fees','Bus Fees')", CONN,3,3
    If rsTemp.recordcount > 0 then
    intReceiptCatId = rsTemp("Receipt_Cat_id")

    End if
    rsTemp.close


    rsTemp.open "EXEC sp_prashanth " &Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&request("ChkFeeType")&"','"&request ("ChkBusFeeType")&"'",conn,3,3
    If rsTemp.recordcount >0 Then
    'print ("STEP 1<BR>")
    intStudentId = 0
    strSQL = ""

    While Not rsTemp.eof
    If intStudentId <> rsTemp("Student_id") then
    If intStudentId <> 0 then
    strSlip = strSlip & "<tr><td class=""normal"" align=""right"">Total Due:</td><td class=""normal"" align=""right""><b>"&totalDue&"</b></td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">Pay on or before : "&getDateFormat(request("strDueDate"))&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">"&ChequeAmount(totalDue)&"</td></tr>"

    totalDue = 0
    strSlip = strSlip & "</TABLE>"
    'strSlip = strSlip & "</TD></tr>"
    'print strSlip
    strSQL = strSQL & "INSERT INTO tblFeeIntimationSlips(FeeIntimationId,FY_ID,Receipt_Cat_Id,Student_Id,Date_Created,UID, Class_Id, Section_Id, FeeParticulars,Batchid)"
    strSQL = strSQL & "SELECT " &slipId&","&intFYId&","&intReceiptCatId&","&intStudentId&",'"&getLocalDateTime&"',"&session("DID")&" ,"&Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&strSlip&"',0; "
    strPrintSlip = strPrintSlip & strSlip
    strSlip = ""
    slipId = slipId + 1
    End if
    'strSlip = strSlip & "<tr><TD>"

    strSlip = strSlip & "<table align=""center"" cellpadding=4 cellspacing=0 border=1 bordercolor=""gray"">"
    strSlip = strSlip & "<tr><td colspan=2 class=blackbold align=""center""><b>Montessori English Medium School</b></td></tr>"
    strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center""><b>"&getInstance()&".</b></td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center"">&nbsp;</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal"">Slip Id: "&slipId&"</td><td class=""normal"">Date:"&getDateFormat(getLocalDateTime)&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Name : "&rsTemp("FULLName")&"</td><td class=""normal"">"& rsTEmp("Student_Code")&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Parent : "&rsTemp("FatherName")&"</td><td class=""normal"">"&strClass & " ("& strSection &")</td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align="""">------------------------------------------------------------------------------------------------------------------</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal""><b>Fee Particulars</b></td><td class=""normal"" align=""left""><b>Amount</b></td></tr>"
    'strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"

    End If
    if request("ChkFeeType")=True Then
    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"
    'Else
    'rsTemp("due_feeamount")=0
    End If

    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_BUS")&"</td><td class=""normal"">"&rsTemp("due_busamount")&"</td></tr>"

    intStudentId = rsTemp("Student_id")
    totalDue = totalDue +rsTemp("due_busamount")+rsTemp("due_feeamount")
    rsTemp.movenext
    Wend
    'TOTALDUEAMOUNT = totalDue+rsTemp("due_feeamount")
    rsTemp.close

    strSlip = strSlip & "<tr><td class=""normal"" align=""right"">Total Due:</td><td class=""normal"" align=""right""><b>"&totalDue&"</b> </td></tr>"

    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">Pay on or before : "&getDateFormat(getLocalDateTime)&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">"&ChequeAmount(totalDue)&"</td></tr>"
    strSlip = strSlip & "</TABLE>"

    strSQL = strSQL & "INSERT INTO tblFeeIntimationSlips(FeeIntimationId,FY_ID,Receipt_Cat_Id,Student_Id,Date_Created,UID,Class_Id, Section_Id, FeeParticulars,Batchid)"
    strSQL = strSQL & "SELECT " &slipId&","&intFYId&","&intReceiptCatId&","&intStudentId&",'"&getLocalDateTime()&"',"&session("DID") &","&Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&strSlip&"',0; "
    strPrintSlip = strPrintSlip & strSlip

    print("<tr height='100%'><td valign='top'>")
    PRINT ("<table align=""center"" cellpadding=4 cellspacing=0 border=1 style='border-color:#DDDDDD;border-width:1px;border-style:Solid;border-collapse:collapse;'>")

    on error resume next
    Conn.beginTrans

    conn.execute(strSQL)

    strSQL = "INSERT INTO tblFeeIntimationBatches (FeeIntimationStartId, FeeIntimationEndId, Receipt_Cat_Id, Class_Id, Section_Id, Date_Created, UID, fy_id) VALUES("&intStartSlipId&","&slipId&","&intReceiptCatId&","&Trim(rform("intClassId"))&","&Trim(rform( "intSection_id"))&",'"&getDateFormat(getLocalDateTime)&"',"&session("DID")&","&intFYID&")"

    Conn.Execute(strSQL)

    rsTemp.open "SELECT Batchid from tblFeeIntimationBatches WHERE FeeIntimationStartId="&intStartSlipId&" AND FeeIntimationEndId="&slipId ,conn,3,3
    If rsTemp.recordcount > 0 then
    intBatchId = rsTemp("BatchId")
    End if
    rsTemp.close

    strSQL = "UPDATE tblFeeIntimationSlips SET BATCHID = "&intBatchId&" WHERE FeeIntimationId BETWEEN "&intStartSlipId&" AND "&slipId
    conn.execute (strSQL)

    Call checkDBError(strSQL)
    Conn.commitTrans

    'print (strPrintSlip)

    PRINT ("</TABLE>")
    print("</TD></tr>")

    print("<tr><td colspan='2' align='center' class='greennormal'>Fee intimation slips generated successfully. Batch ID =<b>"&intBatchId&"</b></td></tr>")
    print("<tr><td colspan='2' align='center'>")
    'print ("<input type='submit' value='Print Fee Intimation Slips' class='inputbutton' onclick = ""F_Print_FeeIntimation('printFeeIntimation.asp?NAVID="&request("NAVID")&"&intStartId="&intStartSlip Id&"&intEndId="&slipId&"&action=printFeeIntimationSlips');"">")
    print("<a href='printFeeIntimation.asp?NAVID="&request("NAVID")&"&intStartId="&intStartSlipId&"&intEndId="&sli pId&"&action=printFeeIntimationSlips' target=_blank class='normal'>Print</a>")
    print ("</td></tr>")

    print("</table></td></tr>")
    %>
    <script>alert("Fee intimation Batch Id:"+<%=intBatchId%>)</script>
    <%
    Else
    print ("<tr height='10'><td class='normal' align='center'>No Dues found in "&strClassName&" ("&strSectionName&")</td></tr>")
    End If

    Else
    print ("<tr><td class='rednormal' align='center'>Fee intimation slips already generated by <strong>"&strUserName&" </strong> <br />on <strong>"& strGenTime &"</strong>. You can generate tomorrow.</td></tr>")
    End if

    End if
    print ("</table>")
    closedb()
    %>
    </body>
    </html>

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,635 Times in 4,597 Posts
    You need to understand that an *UN*checked checkbox sends *NOTHING AT ALL* to the ASP page. This is how HTML works, nothing directly to do with ASP.

    So I do checkboxes in ASP this way:
    Code:
    ChkFeeTypeWasChecked = ( Trim(request("ChkFeeType")) <> "" )
    And then you can use
    Code:
    If ChkFeeTypeWasChecked Then
        ...
    End If
    
    or
    
    If Not ChkFeeTypeWasChecked Then
        ...
    End If
    This assumes that you don't really care about the *value* of the checkbox and only want to know if it was checked or not.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    prashanth193 (01-03-2012)

  • #5
    New Coder
    Join Date
    Dec 2011
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    in the below code which is mentioned in the while loop i have a problem
    that is i am retriving four fields which are selected by the check box.those are

    1.strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"
    2.strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_BUS")&"</td><td class=""normal"">"&rsTemp("due_busamount")&"</td></tr>"

    the above two lines are executed every time without check the boxes


    the output is coming like this

    Montessori English Medium School
    Bhupalapally.
    Slip Id: 1202 Date:3-Jan-2012
    Name : ANVESH SANGEPU BHUADM110004
    Parent : SRINIVAS 10 (A1)
    Fee Particulars Amount
    FIRST TERM 5000
    June Bus Fee 200
    FIRST TERM 5000
    July Bus Fee 200
    FIRST TERM 5000
    August Bus Fee 200
    Total Due: 15600
    Pay on or before : 3-Jan-2012
    Rupees Fifteen Thousand Six Hundred only.




    in the above result only one term box is checked and 3 months are selected but every time first term fee also added to the feeparticulars.Could you tell me what can i do for not repeate the first term more than once




    While Not rsTemp.eof
    If intStudentId <> rsTemp("Student_id") then
    If intStudentId <> 0 then
    strSlip = strSlip & "<tr><td class=""normal"" align=""right"">Total Due:</td><td class=""normal"" align=""right""><b>"&totalDue&"</b></td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">Pay on or before : "&getDateFormat(request("strDueDate"))&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"" colspan=""2"">"&ChequeAmount(totalDue)&"</td></tr>"

    totalDue = 0
    strSlip = strSlip & "</TABLE>"
    'strSlip = strSlip & "</TD></tr>"
    'print strSlip
    strSQL = strSQL & "INSERT INTO tblFeeIntimationSlips(FeeIntimationId,FY_ID,Receipt_Cat_Id,Student_Id,Date_Created,UID, Class_Id, Section_Id, FeeParticulars,Batchid)"
    strSQL = strSQL & "SELECT " &slipId&","&intFYId&","&intReceiptCatId&","&intStudentId&",'"&getLocalDateTime&"',"&session("DID" )&" ,"&Trim(rform("intClassId"))&","&Trim(rform("intSection_id"))&",'"&strSlip&"',0; "
    strPrintSlip = strPrintSlip & strSlip
    strSlip = ""
    slipId = slipId + 1
    End if
    'strSlip = strSlip & "<tr><TD>"

    strSlip = strSlip & "<table align=""center"" cellpadding=4 cellspacing=0 border=1 bordercolor=""gray"">"
    strSlip = strSlip & "<tr><td colspan=2 class=blackbold align=""center""><b>Montessori English Medium School</b></td></tr>"
    strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center""><b>"&getInstance()&".</b></td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align=""center"">&nbsp;</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal"">Slip Id: "&slipId&"</td><td class=""normal"">Date:"&getDateFormat(getLocalDateTime)&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Name : "&rsTemp("FULLName")&"</td><td class=""normal"">"& rsTEmp("Student_Code")&"</td></tr>"
    strSlip = strSlip & "<tr><td class=""normal"">Parent : "&rsTemp("FatherName")&"</td><td class=""normal"">"&strClass & " ("& strSection &")</td></tr>"

    'strSlip = strSlip & "<tr><td colspan=""2"" class=""normal"" align="""">------------------------------------------------------------------------------------------------------------------</td></tr>"

    strSlip = strSlip & "<tr><td class=""normal""><b>Fee Particulars</b></td><td class=""normal"" align=""left""><b>Amount</b></td></tr>"
    'strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"

    End If
    if request("ChkFeeType")=True Then
    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_FEE")&"</td><td class=""normal"">"&rsTemp("due_feeamount")&"</td></tr>"
    'Else
    'rsTemp("due_feeamount")=0
    End If

    strSlip = strSlip & "<tr><td class=""normal"">"&rsTemp("Description_BUS")&"</td><td class=""normal"">"&rsTemp("due_busamount")&"</td></tr>"

    intStudentId = rsTemp("Student_id")
    totalDue = totalDue +rsTemp("due_busamount")+rsTemp("due_feeamount")
    rsTemp.movenext
    Wend
    Last edited by prashanth193; 01-03-2012 at 01:24 PM.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,635 Times in 4,597 Posts
    I'm sorry, I can't follow your logic in that code.

    I don't even understand why you are coding that using strSlip = strSlip & ... which will make the code harder to read an *MUCH* slower.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    prashanth193 (01-04-2012)

  • #7
    New Coder
    Join Date
    Dec 2011
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    in my designing part i am using 15 check boxes in that 3 are under one id that is ChkFeeTypeId and remaining all are under second id that is ChkBusFeeId .I want to retrive the data for checked items.could you tell me how can i retrive the data for the checked items and also tell me how to use for each loop for retriving the data for the checked items


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •