<%@ Page Language="C#" AutoEventWireup="true" CodeFile="printreceipt.aspx.cs" Inherits="module_printreceipt" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> 
    <script type="text/javascript" src="../assets/js/jquery.min.js"></script>

<style>
        body {
            font-family: Arial, Helvetica, sans-serif;
            font-size:14px;
        }
        h2 {
        }
        @media print{
            @page {
                margin-top:8px;
                margin-bottom:8px;
            }
        }
    </style>
    <style>
.tbl2 {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

.td1, .th1 {
  border: 1px solid #000000;
  text-align: left;
  padding: 8px;
}

.tr1:nth-child(even) {
  background-color: #000000;
}
</style>
    <script type="text/javascript">
        //127.0.0.1 Port=3306
        var studentsids = null; var installsids = null;
        var appends = "";
        var balanceadm = 0;
        var totalamount = 0;
        var totalinwords = "";
        var pkgid = null;
        var yrsid = null;
        var clsid = null;
        var divsid = null;
        var recptno = "";
        function GetParameterValuespkgs(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        function GetParameterValuesyrsids(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        function GetParameterValuesclsids(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        function GetParameterValuesdivions(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        $(document).ready(function () {
            studentsids = GetParameterValues('student');
            installsids = GetParameterValuesinstall('instids'); 
            recptno = GetParameterValuesrecnos('receptsids');
             pkgid = GetParameterValuespkgs('pkgsids');;
             yrsid = GetParameterValuesyrsids('yrs');;
             clsid = GetParameterValuesclsids('clsid');;
             divsid = GetParameterValuesdivions('diviid');;
            $.ajax({
                type: "POST",
                url: "printreceipt.aspx/GetData",
                data: "{studids :'" + studentsids + "',inst : '" + installsids + "',recptnos :'" + recptno + "',pkgid :'" + pkgid + "',yearsid :'" + yrsid + "',classid : '"+ clsid +"',divisid :'"+ divsid +"'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) { 
                    if (data.d != "") {
                        data = JSON.parse(data.d);
                    
                        $("#lblreceptids").html(data[0].receiptnos); $("#lblreceptids1").html(data[0].receiptnos);
                        var fullname = data[0].title + "." + data[0].fname + " " + data[0].mname + " " + data[0].lname;
                        $("#lblstname").html(fullname); $("#lblstname1").html(fullname);
                     
                        var clsname = data[0].class + "(" + data[0].divsname + ")";
                        $("#lblcalss").html(clsname);
                        $("#lblpkgname").html(data[0].packgenme);
                        $("#lblpaymode").html(data[0].paymode);
                        $("#lblpaymode1").html(data[0].paymode);
                        $("#lblrecptdate").html(data[0].recptdate);
                        $("#lblcalss1").html(clsname);
                        $("#lblpkgname1").html(data[0].packgenme);
                        if (data[0].remark != "") {
                            $("#lblremark").html(data[0].remark); $("#lblremark1").html(data[0].remark);
                            $("#remtd").show(); $("#remtd1").show();
                        } else {
                            $("#remtd").hide(); $("#remtd1").hide();
                        }
                        $("#lblrecptdate1").html(data[0].recptdate);
                        if (data[0].paymode == "cash") {
                            $("#tdsign").show(); $("#tdcheck").hide(); $("#tdcheck1").hide(); $("#tdcheck2").hide(); $("#tdcheck12").show();
                            $("#tdcheck13").hide(); $("#tdcheck14").hide(); $("#tdcheck15").hide();
                        } else if (data[0].paymode == "cheque") {
                            $("#tdcheck").show(); $("#tdcheck1").show(); $("#tdcheck2").show(); $("#tdsign").hide(); $("#tdcheck13").show(); $("#tdcheck14").show(); $("#tdcheck15").show(); $("#tdcheck12").hide();
                        }
                        if (data[0].chequenos != null) {
                           
                            $("#lblchkque").html(data[0].chequenos); $("#lblchkque1").html(data[0].chequenos);
                            if (data[0].chkdt != null) {
                                //var chkdates = data[0].chequedate;
                                //var dt1 = new Date(chkdates);
                                //var dt1year = dt1.getFullYear();
                                //var dt1months1 = dt1.getMonth();
                                //var dt1day = dt1.getDay();
                                //var chksdt = dt1day + "-" + dt1months1 + "-" + dt1year;
                                $("#chkdate").html(data[0].chkdt); $("#chkdate1").html(data[0].chkdt);
                            }
                            $("#lblbankname").html(data[0].bankname); $("#lblbankname1").html(data[0].bankname);
                        }
                   $("#Table1").find("tbody").empty();
                    $("#billtbl").find("tbody").empty();
                        for (var i = 0 ; i < data.length; i++) {
                            if (data[0].baladmfees != "0") {
                                var pkgadmfee11 = 0;
                                var pkgadmfee = parseFloat(data[0].admissionfee);
                                var paidadmfee = parseFloat(data[0].baladmfees);
                                if (data[0].prevbaladmissions == null) {
                                    pkgadmfee11 = parseFloat(data[0].prevbaladmissions1);
                                }
                                else if (parseFloat(data[0].prevbaladmissions) > 0) {
                                    pkgadmfee11 = paidadmfee + parseFloat(data[0].prevbaladmissions);
                                } else {
                                    pkgadmfee11 = paidadmfee;
                                }
                                balanceadm = pkgadmfee - pkgadmfee11;
                                totalamount = totalamount + paidadmfee;
                                appends = "<tr><td>Addmission Fees</td><td>" + data[0].admissionfee + "</td><td>" + balanceadm + "</td><td>" + data[0].baladmfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].baltutionfees != "0") {
                                var pkgadmfee12 = 0;
                                var paidadmfee1 = parseFloat(data[0].baltutionfees); 
                                var pkgadmfee = parseFloat(data[0].tuitionfee);
                              
                                if ( parseFloat(data[0].prevbaltutuions2) > 0) {
                                    pkgadmfee12 = parseFloat(data[0].prevbaltutuions2);
                                }
                         
                           
                                 else if (parseFloat(data[0].prevbaltutuions) > 0) {
                                    
                                     pkgadmfee12 = paidadmfee1 + parseFloat(data[0].prevbaltutuions); 
                                  } 

                                 else {
                                   
                                    pkgadmfee12 = paidadmfee1;
                               }
                              
                                balanceadm = parseFloat(data[0].tuitionfee) - pkgadmfee12;
                                totalamount = totalamount + paidadmfee1;
                                appends = "<tr><td>Tution Fees</td><td>" + data[0].tuitionfee + "</td><td>" + balanceadm + "</td><td>" + data[0].baltutionfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                          
                            if (data[0].balcollegefess != "0") {
                                var pkgadmfee13 = 0;
                                var paidadmfee2 = parseFloat(data[0].balcollegefess);
                                var pkgadmfee = parseFloat(data[0].collegefee);
                                if (data[0].prevbalcolleges == null) {
                                    pkgadmfee13 = parseFloat(data[0].prevbalcolleges1);
                                }
                                else if (parseFloat(data[0].prevbalcolleges) > 0) {
                                    pkgadmfee13 = paidadmfee2 + parseFloat(data[0].prevbalcolleges);
                                } else {
                                    pkgadmfee13 = paidadmfee2;
                                }
                                balanceadm = parseFloat(data[0].collegefee) - pkgadmfee13;
                                totalamount = totalamount + paidadmfee2;
                                appends = "<tr><td>College Magzine Fees</td><td>" + data[0].collegefee + "</td><td>" + balanceadm + "</td><td>" + data[0].balcollegefess + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balcautinmon != "0") {
                                var pkgadmfee12 = 0;
                                var paidadmfee3 = parseFloat(data[0].balcautinmon);
                                //  var paidadmfee3 = 
                                if (data[0].prevbalcautions == null) {
                                    pkgadmfee12 = parseFloat(data[0].prevbalcautions1);
                                }
                                else if (parseFloat(data[0].prevbalcautions) > 0) {
                                    pkgadmfee12 = paidadmfee3 + parseFloat(data[0].prevbalcautions);
                                } else {
                                    pkgadmfee12 = paidadmfee3;
                            }
                            
                                balanceadm = parseFloat(data[0].cautionmny) - pkgadmfee12;
                                totalamount = totalamount + paidadmfee3;
                                appends = "<tr><td>Caution Money</td><td>" + data[0].cautionmny + "</td><td>" + balanceadm + "</td><td>" + data[0].balcautinmon + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balidentitys != "0") {
                                var pkgadmfee11 = 0
                                var pkgadmfee = parseFloat(data[0].identycrdfee);
                                var paidadmfee4 = parseFloat(data[0].balidentitys);
                                if (data[0].prevbalidentitys == null) {
                                    pkgadmfee10 = parseFloat(data[0].prevbalidentitys1);
                                }
                                else if (parseFloat(data[0].prevbalidentitys) > 0) {
                                    pkgadmfee10 = paidadmfee4 + parseFloat(data[0].prevbalidentitys);
                                } else {
                                    pkgadmfee10 = paidadmfee4;
                                }
                                balanceadm = parseFloat(data[0].identycrdfee) - pkgadmfee10
                                totalamount = totalamount + paidadmfee4;
                                appends = "<tr><td>Identity Cards Fees</td><td>" + data[0].identycrdfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balidentitys + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balinsurance != "0") {
                                var pkgadmfee10 = 0;
                                var paidadmfee5 = parseFloat(data[0].balinsurance)
                                if (data[0].prevbalinsur == null) {
                                    pkgadmfee10 = parseFloat(data[0].prevbalinsur1);
                                }
                                else if (parseFloat(data[0].prevbalinsur) > 0) {
                                    pkgadmfee10 = paidadmfee5 + parseFloat(data[0].prevbalinsur);
                                }else{
                                    pkgadmfee10 = paidadmfee5;
                            }
                               
                                balanceadm = parseFloat(data[0].insurance) - pkgadmfee10;
                                totalamount = totalamount + paidadmfee5;
                                appends = "<tr><td>Insurance</td><td>" + data[0].insurance + "</td><td>" + balanceadm + "</td><td>" + data[0].balinsurance + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].universesfees != "0") {
                                var pkgadmfee9 = 0;
                                var paidadmfee6 = parseFloat(data[0].universesfees);
                                if (data[0].prevbaluniversity == null) {
                                    pkgadmfee9 = parseFloat(data[0].prevbaluniversity1);
                                }
                                else if (parseFloat(data[0].prevbaluniversity) > 0) {
                                    pkgadmfee9 = paidadmfee6 + parseFloat(data[0].prevbaluniversity);
                                }else{
                            }
                                var pkgadmfee9 = paidadmfee6;
                             
                                balanceadm = parseFloat(data[0].unifees) - pkgadmfee9;
                                totalamount = totalamount + paidadmfee6;
                                appends = "<tr><td>University Fees</td><td>" + data[0].unifees + "</td><td>" + balanceadm + "</td><td>" + data[0].universesfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].baleligible != "0") {
                                var pkgadmfee8 = 0;
                                var paidadmfee7 = parseFloat(data[0].baleligible);
                                if (data[0].prevbalbaleligible == null) {
                                    pkgadmfee8 = parseFloat(data[0].prevbalbaleligible1);
                                }
                              
                                else if (parseFloat(data[0].prevbalbaleligible) > 0) {
                                    pkgadmfee8 = paidadmfee7 + parseFloat(data[0].prevbalbaleligible);
                                }else{
                                    var pkgadmfee8 = paidadmfee7;
                            }
                                balanceadm = parseFloat(data[0].eligibilityfee) - pkgadmfee8;
                                totalamount = totalamount + paidadmfee7;
                                appends = "<tr><td>Eligibility Fees</td><td>" + data[0].eligibilityfee + "</td><td>" + balanceadm + "</td><td>" + data[0].baleligible + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balbusfees != "0") {
                                var pkgadmfee7 = 0;
                                var paidadmfee8 = parseFloat(data[0].balbusfees);
                                if (data[0].prevbalbusfees == null) {
                                    pkgadmfee7 = parseFloat(data[0].prevbalbusfees1);
                                }
                                else if (parseFloat(data[0].prevbalbusfees) > 0) {
                                    pkgadmfee7 = paidadmfee8 + parseFloat(data[0].prevbalbusfees);
                                } else {
                                    pkgadmfee7 = paidadmfee8;
                                }
                               
                                balanceadm = parseFloat(data[0].busfee) - pkgadmfee7;
                                totalamount = totalamount + paidadmfee8;
                                appends = "<tr><td>Bus Fees</td><td>" + data[0].busfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balbusfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balexamfess != "0") {
                                var pkgadmfee6 = 0;
                                var paidadmfee9 = parseFloat(data[0].balexamfess);
                                if (data[0].prevbalexamination == null) {
                                    pkgadmfee6 = parseFloat(data[0].prevbalexamination1);
                                }
                                else if (parseFloat(data[0].prevbalexamination) > 0) {
                                    pkgadmfee6 = paidadmfee9 + parseFloat(data[0].prevbalexamination);
                                }else{
                                    var pkgadmfee6 = paidadmfee9;
                            }
                              
                                balanceadm = parseFloat(data[0].exminfee) - pkgadmfee6;
                                totalamount = totalamount + paidadmfee9;
                                appends = "<tr><td>Examination Fees</td><td>" + data[0].exminfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balexamfess + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balenrollment != "0") {
                                var pkgadmfee5 = 0;
                                var paidadmfee10 = parseFloat(data[0].balenrollment);
                                if (data[0].prevbalenrollments == null) {
                                    pkgadmfee5 = parseFloat(data[0].prevbalenrollments1);
                                }
                               else if (parseFloat(data[0].prevbalenrollments) > 0) {
                                   pkgadmfee5 = paidadmfee10 + parseFloat(data[0].prevbalenrollments);
                                } else {
                                   pkgadmfee5 =  paidadmfee10
                                }
                                balanceadm = parseFloat(data[0].enrollfee) - pkgadmfee5;
                                totalamount = totalamount + paidadmfee10;
                                appends = "<tr><td>Enrollment Fees</td><td>" + data[0].enrollfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balenrollment + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].lockerfees != "0") {
                                var pkgadmfee4 = 0;
                                var paidadmfee11 = parseFloat(data[0].lockerfees);
                                if (data[0].prevballockerfees == null) {
                                    pkgadmfee4 = parseFloat(data[0].prevballockerfees1);
                                }
                                else if (parseFloat(data[0].prevballockerfees) > 0) {
                                    pkgadmfee4 = paidadmfee11 + parseFloat(data[0].prevballockerfees);
                                }else{
                                    pkgadmfee4 = paidadmfee11;
                            }
                                balanceadm = parseFloat(data[0].lockerfee) - pkgadmfee4;
                                totalamount = totalamount + paidadmfee11;
                                appends = "<tr><td>Locker Fees</td><td>" + data[0].lockerfee + "</td><td>" + balanceadm + "</td><td>" + data[0].lockerfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balgamesfees != "0") {
                                var pkgadmfee3 = 0;
                                var paidadmfee12 = parseFloat(data[0].balgamesfees);
                                if (data[0].prevbalgamesfees == null) {
                                    pkgadmfee3 = parseFloat(data[0].prevbalgamesfees1);
                                }
                                else if (parseFloat(data[0].prevbalgamesfees) > 0) {
                                    pkgadmfee3 = paidadmfee12 + parseFloat(data[0].prevbalgamesfees);
                                    }
                                else { pkgadmfee3 = paidadmfee12;}
                              
                                balanceadm = parseFloat(data[0].gmespofee) - pkgadmfee3;
                                totalamount = totalamount + paidadmfee12;
                                appends = "<tr><td>Games&sports Fees</td><td>" + data[0].gmespofee + "</td><td>" + balanceadm + "</td><td>" + data[0].balgamesfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balboardfees != "0") {
                                var pkgadmfee2 = 0;
                                var paidadmfee13 = parseFloat(data[0].balboardfees);
                                if (data[0].prevbalboardsfees == null) {
                                    pkgadmfee2 = parseFloat(data[0].prevbalboardsfees1);;
                                }
                                else if (parseFloat(data[0].prevbalboardsfees) > 0) {
                                    pkgadmfee2 = paidadmfee13 + parseFloat(data[0].prevbalboardsfees);
                                }else{
                                    pkgadmfee2 = paidadmfee13;
                                }
                                balanceadm = parseFloat(data[0].boardfee) - pkgadmfee2;
                                totalamount = totalamount + paidadmfee13;
                                appends = "<tr><td>Board Fees</td><td>" + data[0].boardfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balboardfees + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].balextraactivity != "0") {
                                var pkgadmfee1 = 0;
                                var paidadmfee14 = parseFloat(data[0].balextraactivity);
                                if (data[0].prevbalextraactivity == null) {
                                    pkgadmfee1 = parseFloat(data[0].prevbalextraactivity1);
                                }
                                else if (parseFloat(data[0].prevbalextraactivity) > 0) {
                                    pkgadmfee1 = paidadmfee14 + parseFloat(data[0].prevbalextraactivity);
                                } else {
                                    pkgadmfee1 = paidadmfee14;
                                }
                              
                                balanceadm = parseFloat(data[0].exactivityfee) - pkgadmfee1;
                                totalamount = totalamount + paidadmfee14;
                                appends = "<tr><td>Extracurricular Activity Fees</td><td>" + data[0].exactivityfee + "</td><td>" + balanceadm + "</td><td>" + data[0].balextraactivity + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                            if (data[0].baldevelopemntfee != "0") {
                                var pkgadmfee = 0; 
                                var paidadmfee15 = parseFloat(data[0].baldevelopemntfee);
                              
                                if (data[0].baldevelops == null) {
                                    pkgadmfee = parseFloat(data[0].baldevelops1);
                                }
                                else if(parseFloat(data[0].baldevelops) > 0){
                                    pkgadmfee = paidadmfee15 + parseFloat(data[0].baldevelops);
                                  }     else{
                                        pkgadmfee =  paidadmfee15;
                                      }                              
                          
                              
                                balanceadm = parseFloat(data[0].developfee) - pkgadmfee; 
                                totalamount = totalamount + paidadmfee15; 
                                appends = "<tr><td>Developement Fees</td><td>" + data[0].developfee + "</td><td>" + balanceadm + "</td><td>" + data[0].baldevelopemntfee + "</td></tr>";
                                $("#billtbl").find("tbody").append(appends); $("#Table1").find("tbody").append(appends);
                            }
                           
                        }
                        
                        $("#lbltotal").html(totalamount); $("#lbltotal1").html(totalamount);
                        totalinwords = convertNumberToWords(totalamount);
                        $("#lblnoswords").html(totalinwords); $("#lblnoswords1").html(totalinwords);

                    }
                },
                error: function (error) {
                    console.log(JSON.stringify(error));
                }
            });
          //  window.print();


           // setTimeout(function () { $("#first12").clone().insertAfter("#first12"); window.print(); }, 3000);
            setTimeout(function () { window.print(); }, 3000);
        });
       
        function GetParameterValues(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        function GetParameterValuesinstall(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        } 
             function GetParameterValuesrecnos(param) {
            var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < url.length; i++) {
                var urlparam = url[i].split('=');
                if (urlparam[0] == param) {
                    return urlparam[1];
                }
            }
        }
        function convertNumberToWords(amount) {
            var words = new Array();
            words[0] = '';
            words[1] = 'One';
            words[2] = 'Two';
            words[3] = 'Three';
            words[4] = 'Four';
            words[5] = 'Five';
            words[6] = 'Six';
            words[7] = 'Seven';
            words[8] = 'Eight';
            words[9] = 'Nine';
            words[10] = 'Ten';
            words[11] = 'Eleven';
            words[12] = 'Twelve';
            words[13] = 'Thirteen';
            words[14] = 'Fourteen';
            words[15] = 'Fifteen';
            words[16] = 'Sixteen';
            words[17] = 'Seventeen';
            words[18] = 'Eighteen';
            words[19] = 'Nineteen';
            words[20] = 'Twenty';
            words[30] = 'Thirty';
            words[40] = 'Forty';
            words[50] = 'Fifty';
            words[60] = 'Sixty';
            words[70] = 'Seventy';
            words[80] = 'Eighty';
            words[90] = 'Ninety';
            amount = amount.toString();
            var atemp = amount.split(".");
            var number = atemp[0].split(",").join("");
            var n_length = number.length;
            var words_string = "";
            if (n_length <= 9) {
                var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
                var received_n_array = new Array();
                for (var i = 0; i < n_length; i++) {
                    received_n_array[i] = number.substr(i, 1);
                }
                for (var i = 9 - n_length, j = 0; i < 9; i++, j++) {
                    n_array[i] = received_n_array[j];
                }
                for (var i = 0, j = 1; i < 9; i++, j++) {
                    if (i == 0 || i == 2 || i == 4 || i == 7) {
                        if (n_array[i] == 1) {
                            n_array[j] = 10 + parseInt(n_array[j]);
                            n_array[i] = 0;
                        }
                    }
                }
                value = "";
                for (var i = 0; i < 9; i++) {
                    if (i == 0 || i == 2 || i == 4 || i == 7) {
                        value = n_array[i] * 10;
                    } else {
                        value = n_array[i];
                    }
                    if (value != 0) {
                        words_string += words[value] + " ";
                    }
                    if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
                        words_string += "Crores ";
                    }
                    if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
                        words_string += "Lakhs ";
                    }
                    if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
                        words_string += "Thousand ";
                    }
                    if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
                        words_string += "Hundred and ";
                    } else if (i == 6 && value != 0) {
                        words_string += "Hundred ";
                    }
                }
                words_string = words_string.split("  ").join(" ");
            }
            return words_string + " " + "ONLY";
        }
    </script>
    </head>
<body style="font-size:14px;width:97%" id="first12">
<div style="width:97%;margin-top:20px" id="firstdiv" align="center">
       <!--    <table style="width:100%;border-collapse: collapse;  border-color: #cccccc; " align="left" border="0" >
                <tr>
            	<td colspan="7" align="center">
        			<a><img src="netram.png" width="100%;"/></a>
        		</td>
         	</tr>
         </table>
 -->
 <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="1" >
      <%-- <tr>
             <td colspan="3" align="center"  style="width: 15%;">
            <h3> Hi-Tech College Of Pharmacy</h3>
            </td>

       </tr>
      <tr>
             <td colspan="3" align="center"  style="width: 15%;">
     PADOLI PHATA , NAGPUR HIGH-WAY , MORWA ROAD , CHANDRAPUR
                 </td>
          </tr>--%>
              <tr>
              <td colspan="1" align="center"  style="width: 15%;">
              <img  id="imgpat" src="../assets/images/logo-icon.png" height="78px" width="100px"/>
            </td>
           <!--  <td colspan="5" align="center" style="width: 70%;"><span style="font-size: 18px;"><b>NETRAM PHARMA</b></span><br>
                 <span style="font-size: 11px;">NMC Reg. No. 997</span><br /><hr />
           <span style="font-size: 11px;">Ground Floor,Sai Krupa Apartment, Next to Chaudhari Hospital,<br /> Umred Road Sakkardara, Nagpur-24<br /><img src="globe.png" height="10px" width="10px" /> : netramhospital.com, <img src="phone.png" height="10px" width="10px" /> : 0712-275 0 275, 9852 804 804</span> </td> -->
           <td style="text-align:center;font-size:16px">
                    
                    <span style="font-size:16px"><b>Hi-Tech College Of Pharmacy</b>,<br />  <b>PADOLI PHATA , NAGPUR HIGH-WAY , MORWA ROAD , CHANDRAPUR</b> </span>
                        <%--<br /> <span style="font-size:11px"><b><label id="lblinitial"></label></b></span> &nbsp;&nbsp;, <span style="font-size:11px"><b><label id="hregno"></label></b></span> <br /> <img src="../../img/globe.png" height="10px" width="10px" /><span  style="font-size:11px"> : <label id="website"></label>, <img src="../../img/phone.png" height="10px" width="10px" /> : <label id="phone"></label>, <label id="mobiles"></label></span>--%>
                   

                </td>
          <%--  <td colspan="1" align="center" style="width: 15%;"><p id="imgnabh"></p></td>--%>
          </tr>
         </table>
    <table style="width:97%;border-collapse: collapse;border-color: #cccccc;margin-top:10px" align="left" border="0">
        <tr>
            <td style="width:25%;font-weight:bold">Receipt No.: <label id="lblreceptids"></label></td>
             <td style="width:40%;font-weight:bold">Student Name: <label id="lblstname"></label></td>
             <td style="width:40%;font-weight:bold">Class:<label id="lblcalss"></label></td>
        </tr>
    </table>
      <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="0">
        <tr>
            <td style="width:50%;font-weight:bold"">Category: <label id="lblpkgname"></label></td>
            <td style="width:20%;font-weight:bold""></td>
             <td style="width:50%;font-weight:bold"">Date : <label id="lblrecptdate"></label></td>
        </tr>
    </table>
    <center> <h3> Office-Copy</h3></center>
          <%--<div class="col-md-2"></div>--%>
           <div class="col-md-12">
       
              <table class="tbl2" id="billtbl" style="border-collapse: collapse;border-color: #000000;width:97%;border-bottom:1px solid #000000;" align="left" border="1">
                  <thead>
  <tr class="tr1">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="th1">Particulars</th>
    <th class="th1">Amount</th>
      <th class="th1">Balance Amount</th>
      <th class="th1">Paid Amount</th>
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
      
  <table style="width:97%;border-collapse: collapse;border-color: #000000; " align="left" border="1">
  <tr>
    <td  style="width:10%"><b>In Words :</b></td>
    <td style="width:35%"><label id="lblnoswords"></label></td>
    <td  style="width:13%;font-weight:bold">Amount</td>
      <td  style="width:13%"><label id="lbltotal"></label></td>
  </tr>
         <tr id="remtd" style="display:none">
    <td  style="width:10%"><b>Remark :</b></td>
    <td style="width:35%"><label id="lblremark"></label></td>
    <td  style="width:13%;font-weight:bold"></td>
      <td  style="width:13%"></td>
  </tr>
       <tr>
    <td  style="width:10%;border-color: #000000"><b>Pay Mode</b></td>
    <td style="width:39%;border-color: #000000"><label id="lblpaymode"></label></td>
  <td  style="width:13%;font-weight:bold;border:none"></td>
      <td  style="width:13%;border:none"></td>
     
  </tr>
      <tr id="tdsign" style="display:none">
    <td  style="width:10%;border:none;height:65px;"></td>
    <td style="width:39%;border:none;height:65px;"></td>
  <td  style="width:13%;font-weight:bold;height:65px;border:none;"></td>
      <td  style="width:13%;height:65px;border:none;">Sign</td>
     
  </tr>
       <tr id="tdcheck" style="display:none">
    <td style="width:13%;font-weight:bold;">ChequeNo</td>
    <td style="width:39%;"><label id="lblchkque"></label></td>
   
 

  </tr>
        <tr id="tdcheck1" style="display:none">
    <td style="width:13%;font-weight:bold;">Cheque Date</td>
    <td style="width:39%;"><label id="chkdate"></label></td>
          

  </tr>
      <tr id="tdcheck2" style="display:none">
    <td style="width:13%;font-weight:bold;">Bank</td>
    <td style="width:39%;"><label id="lblbankname"></label></td>
       
  <td style="border:none;text-align:center">Sign</td>
   

  </tr> 
      
      </table>
<%--  <table style="width:100%;display:none" id="tblchek">
     <tr>
    <td style="width:13%;font-weight:bold">ChequeNo</td>
    <td style="width:12%"></td>
    <td></td>
         <td></td>

  </tr>
      </table>  
                <table style="width:100%;border-collapse: collapse;border-color: #cccccc;display:none; " id="tblchek1" align="left" border="0">    
  <tr>
    <td style="width:13%;font-weight:bold">Cheque Date</td>
    <td style="width:12%"></td>
       <td></td>
         <td></td>

     </tr>
 
</table>                
               <table style="width:100%;border-collapse: collapse;border-color: #cccccc;display:none" id="tblchek2" align="left" border="0">    
  <tr>
    <td style="width:13%;font-weight:bold">Bank</td>
    <td style="width:16%"></td>
    <td></td>
         <td></td>

  </tr>
 
</table>--%>               
   <%--<div style="border:1px solid black; height:150px; margin-top: 10px;">
                <table id="tt" style="width:99.99%; border-collapse: collapse; border-color: #cccccc; border-top:none; border-left:none; border-right:none; margin:1px;" align="center" border="1" >  
                    <thead>
                     <tr>
                       <th width="5%"> Sr No. </th>
                       <th width="40%">ITEM NAME</th>
                       <th width="15%">MFG</th>
                       <th width="10%">BATCH </th>
                       <th width="10%">EXP</th>
                       <th width="5%">QTY</th>
                       <th width="10%">MRP</th>
                       <th width="10%">AMOUNT</th>
                     </tr>
                    </thead>
                <tbody>

               </tbody>
           </table>
       </div>--%>
        
          

     
              
</div>
  
 </div>
           
    <div style="width:97%;margin-top:47.9%" id="Div1" align="center">
       <!--    <table style="width:100%;border-collapse: collapse;  border-color: #cccccc; " align="left" border="0" >
                <tr>
            	<td colspan="7" align="center">
        			<a><img src="netram.png" width="100%;"/></a>
        		</td>
         	</tr>
         </table>
 -->
 <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="1" >
      <%-- <tr>
             <td colspan="3" align="center"  style="width: 15%;">
            <h3> Hi-Tech College Of Pharmacy</h3>
            </td>

       </tr>
      <tr>
             <td colspan="3" align="center"  style="width: 15%;">
     PADOLI PHATA , NAGPUR HIGH-WAY , MORWA ROAD , CHANDRAPUR
                 </td>
          </tr>--%>
              <tr>
              <td colspan="1" align="center"  style="width: 15%;">
              <img  id="img1" src="../assets/images/logo-icon.png" height="77px" width="100px"/>
            </td>
           <!--  <td colspan="5" align="center" style="width: 70%;"><span style="font-size: 18px;"><b>NETRAM PHARMA</b></span><br>
                 <span style="font-size: 11px;">NMC Reg. No. 997</span><br /><hr />
           <span style="font-size: 11px;">Ground Floor,Sai Krupa Apartment, Next to Chaudhari Hospital,<br /> Umred Road Sakkardara, Nagpur-24<br /><img src="globe.png" height="10px" width="10px" /> : netramhospital.com, <img src="phone.png" height="10px" width="10px" /> : 0712-275 0 275, 9852 804 804</span> </td> -->
           <td style="text-align:center;font-size:16px">
                    
                    <span style="font-size:16px"><b>Hi-Tech College Of Pharmacy</b>,<br />  <b>PADOLI PHATA , NAGPUR HIGH-WAY , MORWA ROAD , CHANDRAPUR</b> </span>
                        <%--<br /> <span style="font-size:11px"><b><label id="lblinitial"></label></b></span> &nbsp;&nbsp;, <span style="font-size:11px"><b><label id="hregno"></label></b></span> <br /> <img src="../../img/globe.png" height="10px" width="10px" /><span  style="font-size:11px"> : <label id="website"></label>, <img src="../../img/phone.png" height="10px" width="10px" /> : <label id="phone"></label>, <label id="mobiles"></label></span>--%>
                   

                </td>
          <%--  <td colspan="1" align="center" style="width: 15%;"><p id="imgnabh"></p></td>--%>
          </tr>
         </table>
    <table style="width:97%;border-collapse: collapse;border-color: #cccccc;margin-top:10px" align="left" border="0">
        <tr>
            <td style="width:25%;font-weight:bold">Receipt No.: <label id="lblreceptids1"></label></td>
             <td style="width:40%;font-weight:bold">Student Name: <label id="lblstname1"></label></td>
             <td style="width:40%;font-weight:bold">Class:<label id="lblcalss1"></label></td>
        </tr>
    </table>
      <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="0">
        <tr>
            <td style="width:50%;font-weight:bold"">Category: <label id="lblpkgname1"></label></td>
            <td style="width:20%;font-weight:bold""></td>
             <td style="width:50%;font-weight:bold"">Date : <label id="lblrecptdate1"></label></td>
        </tr>
    </table>
    <center> <h3> Student-Copy</h3></center>
          <%--<div class="col-md-2"></div>--%>
           <div class="col-md-12">
       
              <table class="tbl2" id="Table1" style="border-collapse: collapse;border-color: #000000;width:97%" align="left" border="1">
                  <thead>
  <tr class="tr1">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="th1">Particulars</th>
    <th class="th1">Amount</th>
      <th class="th1">Balance Amount</th>
      <th class="th1">Paid Amount</th>
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
    
  <table style="width:97%;border-collapse: collapse;border-color: #000000; " align="left" border="1">
  <tr>
    <td  style="width:8%"><b>In Words :</b></td>
    <td style="width:39%"><label id="lblnoswords1"></label></td>
    <td  style="width:9%;font-weight:bold">Amount</td>
      <td  style="width:9%"><label id="lbltotal1"></label></td>
  </tr>
       <tr style="display:none" id="remtd1">
    <td  style="width:10%"><b>Remark :</b></td>
    <td style="width:35%"><label id="lblremark1"></label></td>
    <td  style="width:13%;font-weight:bold"></td>
      <td  style="width:13%"></td>
  </tr>
   <tr>
    <td  style="width:8%"><b>Pay Mode</b></td>
    <td style="width:45%"><label id="lblpaymode1"></label></td>
    <td  style="width:13%;font-weight:bold;border:none"></td>
      <td  style="width:13%;border:none"></td>
  </tr>
        <tr id="tdcheck12" style="display:none">
    <td  style="width:8%;border:none;height:65px;"></td>
    <td style="width:39%;border:none;height:65px;"></td>
  <td  style="width:13%;font-weight:bold;height:65px;border:none;"></td>
      <td  style="width:13%;height:65px;border:none;">Sign</td>
     
  </tr>
      <tr id="tdcheck13" style="display:none">
      <td  style="width:8%; font-weight:bold">ChequeNo</td>
      <td  style="width:13%"><label id="lblchkque1"></label></td>
         
      </tr>
      <tr id="tdcheck14" style="display:none">
    <td  style="width:8%"><b>Cheque Date</b></td>
    <td style="width:45%"><label id="chkdate1"></label></td>
         
   
  </tr>
      <tr id="tdcheck15" style="display:none">
           <td  style="width:9%; font-weight:bold">Bank</td>
      <td  style="width:13%"><label id="lblbankname1"></label></td>
        
      <td  style="width:13%;border:none;text-align:center">Sign</td>
      </tr>
      </table>
<%--  <table style="width:100%;display:none" id="tblchek3">
     <tr>
    <td style="width:13%;font-weight:bold"></td>
    <td style="width:12%"></td>
  

  </tr>
      </table>  
                <table style="width:100%;border-collapse: collapse;border-color: #cccccc;display:none; " id="tblchek4" align="left" border="0">    
  <tr>
    <td style="width:13%;font-weight:bold">Cheque Date</td>
    <td style="width:12%"></td>
       <td></td>
         <td></td>

     </tr>
 
</table>                
               <table style="width:100%;border-collapse: collapse;border-color: #cccccc;display:none" id="tblchek5" align="left" border="0">    
  <tr>
    <td style="width:13%;font-weight:bold"></td>
    <td style="width:16%"></td>
    <td></td>
         <td></td>

  </tr>
 
</table> --%>              
   <%--<div style="border:1px solid black; height:150px; margin-top: 10px;">
                <table id="tt" style="width:99.99%; border-collapse: collapse; border-color: #cccccc; border-top:none; border-left:none; border-right:none; margin:1px;" align="center" border="1" >  
                    <thead>
                     <tr>
                       <th width="5%"> Sr No. </th>
                       <th width="40%">ITEM NAME</th>
                       <th width="15%">MFG</th>
                       <th width="10%">BATCH </th>
                       <th width="10%">EXP</th>
                       <th width="5%">QTY</th>
                       <th width="10%">MRP</th>
                       <th width="10%">AMOUNT</th>
                     </tr>
                    </thead>
                <tbody>

               </tbody>
           </table>
       </div>--%>
        
          

     
              
</div>
  
 </div>
            </body>
    </html>