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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Exam fee receipt</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;
  border : 1px solid #000000;
  width: 100%;
}

.td1, .th1 {
  border: 1px solid #ffffff;
  text-align: left;
  padding: 8px;
  width:35%
}

.tr1:nth-child(even) {
  background-color: #ffffff;
}
</style>
   
    <script type="text/javascript">
      
        var stid = null;
        var pkid = null;
        var yid = null;
        var clid = null; var divid = null; var exid = null; var semiid = null; var classdivs = ""; var totals = 0; var wordstonos = "";
        var examinaterepts = null;
        var addrow = "";
        $(document).ready(function () {
            stid = GetParameterValues('SID');
           // pkid = GetParameterValues('pkid');
            yid = GetParameterValues('yid');
            clid = GetParameterValues('clid'); divid = GetParameterValues('divid');
            exid = GetParameterValues('exid'); semiid = GetParameterValues('semiid');
            examinaterepts = GetParameterValues('examrept'); 
            $.ajax({
                type: "POST",
                url: "examfeereceipt.aspx/GetData",
                data: "{studids :'" + stid + "',yearsid :'" + yid + "',classid:'" + clid + "',divisionid :'" + divid + "',expkgid :'" + exid + "',semisterid :'" + semiid + "',examre :'" + examinaterepts + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d != "") {
                        data = JSON.parse(data.d);
                        console.log(data);
                        $("#lblreceptids").html(data[0].examrecpt);
                        $("#lblreceptids1").html(data[0].examrecpt);
                        $("#lblstname").html(data[0].pname);
                        $("#lblstname1").html(data[0].pname);
                        classdivs = data[0].clsname + "(" + data[0].divsname + ")";
                        $("#lblcalss").html(classdivs); $("#lblcalss1").html(classdivs);
                        $("#lblpkgname").html(data[0].feepackname); $("#lblpkgname1").html(data[0].feepackname);
                        $("#lblsem").html(data[0].semnos); $("#lblsem1").html(data[0].semnos);
                        $("#lblrecptdate").html(data[0].recptdate); $("#lblrecptdate1").html(data[0].recptdate);
                        if (data[0].paymode == "online") {
                         
                            $("#lblpaymode").html(data[0].paymode); $("#divs").show();
                            $("#lblutrnos").html(data[0].utrnos);
                            $("#lblpaymode1").html(data[0].paymode); $("#divs1").show();
                            $("#lblutrnos1").html(data[0].utrnos);
                        } else if (data[0].paymode == "cash") {
                            $("#lblpaymode").html(data[0].paymode); $("#divs").hide(); $("#lblpaymode1").html(data[0].paymode); $("#divs1").hide();
                        }
                       // $("#billtbl").find("tbody").empty();
                      //  for (var i = 0; i < data.length; i++) {
                            if (data[0].theoryfee != "0") {
                                totals = totals + parseFloat(data[0].theoryfee);
                                addrow = "<tr class='' style='border:1px solid #000000;text-align:center'><td class=''>Theory Fee</td><td class=''>"+ data[0].theoryfee +"</td></tr>";
                                $("#billtbl").find("tbody").append(addrow); $("#billtbl1").find("tbody").append(addrow);
                            }
                            if (data[0].practicalfee != "0") {
                                totals = totals + parseFloat(data[0].practicalfee);
                                addrow = "<tr class='' style='border:1px solid #000000;'><td class=''>Practical Fee</td><td class=''>" + data[0].practicalfee + "</td></tr>";
                                $("#billtbl").find("tbody").append(addrow); $("#billtbl1").find("tbody").append(addrow);
                            }
                            if (data[0].projectfee != "0") {
                                totals = totals + parseFloat(data[0].projectfee);
                                addrow = "<tr class='' style='border:1px solid #000000;'><td class=''>Project Fee</td><td class=''>" + data[0].projectfee + "</td></tr>";
                                $("#billtbl").find("tbody").append(addrow); $("#billtbl1").find("tbody").append(addrow);
                            }
                            if (data[0].processingfee != "0") {
                                totals = totals + parseFloat(data[0].processingfee);
                                addrow = "<tr class='' style='border:1px solid #000000;'><td class=''>Processing Fee</td><td class=''>" + data[0].processingfee + "</td></tr>";
                                $("#billtbl").find("tbody").append(addrow); $("#billtbl1").find("tbody").append(addrow);
                            }
                            if (data[0].degreefee != "0") {
                                totals = totals + parseFloat(data[0].degreefee);
                                addrow = "<tr class='' style='border:1px solid #000000;'><td class=''>Degree Fee</td><td class=''>" + data[0].degreefee + "</td></tr>";
                                $("#billtbl").find("tbody").append(addrow); $("#billtbl1").find("tbody").append(addrow);
                            }
                    }
                   
                        $("#lbltotal").html(totals); $("#lbltotal1").html(totals);
                        wordstonos = convertNumberToWords(totals); 
                        $("#lblnoswords").html(wordstonos); $("#lblnoswords1").html(wordstonos);
                      
                   // }
                },
                error: function (error) {
                    console.log(JSON.stringify(error));
                }
            });
        });
    

        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 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";
        }
        $(document).ajaxStop(function () {
            window.print();
            //alert();
            //$("#detail").height($("#detail").prop('scrollHeight'));
           // setTimeout(function () { $("#first12").clone().insertAfter("#first12"); window.print(); }, 1000);
        });
    </script>
</head>
<body style="font-size:14px;" id="first12">
  <div style="width:100%;margin-top:20px" id="firstdiv">
       <!--    <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:100%;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="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>
        <center> <label  style="font-size:14px; text-align:center;margin-top:10px;"><b>Office Copy(Exam Receipt)</b> </label></center>
    <table style="width:100%;border-collapse: collapse;border-color: #000000;margin-top:10px" align="left" border="1">
        <tr>
            <td style="width:25%;font-weight:bold">Receipt No.&nbsp;: &nbsp;&nbsp;&nbsp;<label id="lblreceptids"></label></td>
             <td style="width:40%;font-weight:bold">Student Name&nbsp;:&nbsp;&nbsp;&nbsp; <label id="lblstname"></label></td>
             <td style="width:40%;font-weight:bold">Class&nbsp;:&nbsp;&nbsp;&nbsp;<label id="lblcalss"></label></td>
        </tr>
    </table>
      <table style="width:100%;border-collapse: collapse;border-color: #000000;" align="left" border="1">
        <tr>
            <td style="width:25%;font-weight:bold"></td>
            <td style="width:40%;font-weight:bold">Semister &nbsp;:&nbsp;&nbsp;&nbsp; <label id="lblsem"></label></td>
             <td style="width:40%;font-weight:bold">Date&nbsp; :&nbsp;&nbsp;&nbsp; <label id="lblrecptdate"></label></td>
        </tr>
    </table>
       <table style="width:100%;border-collapse: collapse;border-color: #000000; " align="left" border="1">
        <tr>
            <td style="width:100%;font-weight:bold">Package Name&nbsp;: &nbsp;&nbsp;<label id="lblpkgname"></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;border:1px solid #000000;margin-top:20px;text-align:center;" align="left" border="1">
                  <thead>
  <tr class="" style="border:1px solid #000000;">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="">Particulars</th>
<%--    <th class=""></th>--%>
      <th class=""> Amount</th>
     
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
      <hr />
  <table style="width:100%;border-collapse: collapse;border-color: #000000;" align="left" border="1"">
  <tr>
    <td  style="width:10%"><b>In Words :</b></td>
    <td style="width:45%"><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>
    <td  style="width:10%"><b>Pay Mode</b></td>
    <td style="width:45%"><label id="lblpaymode"></label></td>
    <td  style="width:13%; font-weight:bold"></td>
      <td  style="width:13%"></td>
  </tr> 
       <tr style="display:none" id="divs">
    <td  style="width:10%"><b>UTR NO.</b></td>
    <td style="width:45%"><label id="lblutrnos"></label></td>
    <td  style="width:13%; font-weight:bold"></td>
      <td  style="width:13%"></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%"><label id="lblchkque"></label></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%"><label id="chkdate"></label></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%"><label id="lblbankname"></label></td>
    <td></td>
         <td></td>

  </tr>
 
</table>
                  <div class="col-md-8" style="margin-top:120px;">
                                    
                                </div>
                 <div class="col-md-10"></div>
         <div class="col-md-2" style="margin-top: 40px;">
              <table width="100%">
                    <tr>
                        <td style="float:left;"></td>
                        <td ></td>
                        <td style="float: right; width:200px;">
                           Sign
                        </td>
                            
                     </tr>
             </table>
             </div>               
   <%--<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>
    <br /><br /><br />
    <div style="width:100%;margin-top:20px" id="Div1">
       <!--    <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:100%;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>
        <center> <label  style="font-size:14px; text-align:center;margin-top:10px;"><b>Student Copy(Exam Receipt)</b> </label></center>
    <table style="width:100%;border-collapse: collapse;border-color: #000000;margin-top:10px" align="left" border="1">
        <tr>
            <td style="width:25%;font-weight:bold">Receipt No.&nbsp;: &nbsp;&nbsp;&nbsp;<label id="lblreceptids1"></label></td>
             <td style="width:40%;font-weight:bold">Student Name&nbsp;:&nbsp;&nbsp;&nbsp; <label id="lblstname1"></label></td>
             <td style="width:40%;font-weight:bold">Class&nbsp;:&nbsp;&nbsp;&nbsp;<label id="lblcalss1"></label></td>
        </tr>
    </table>
      <table style="width:100%;border-collapse: collapse;border-color: #000000;" align="left" border="1">
        <tr>
            <td style="width:25%;font-weight:bold"></td>
            <td style="width:40%;font-weight:bold">Semister &nbsp;:&nbsp;&nbsp;&nbsp; <label id="lblsem1"></label></td>
             <td style="width:40%;font-weight:bold">Date&nbsp; :&nbsp;&nbsp;&nbsp; <label id="lblrecptdate1"></label></td>
        </tr>
    </table>
       <table style="width:100%;border-collapse: collapse;border-color: #000000; " align="left" border="1">
        <tr>
            <td style="width:100%;font-weight:bold">Package Name&nbsp;: &nbsp;&nbsp;<label id="lblpkgname1"></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="billtbl1" style="border-collapse: collapse;border-color: #000000;border:1px solid #000000;margin-top:20px;text-align:center;" align="left" border="1">
                  <thead>
  <tr class="" style="border:1px solid #000000;">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="">Particulars</th>
<%--    <th class=""></th>--%>
      <th class=""> Amount</th>
     
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
      <hr />
  <table style="width:100%;border-collapse: collapse;border-color: #000000;" align="left" border="1"">
  <tr>
    <td  style="width:10%"><b>In Words :</b></td>
    <td style="width:45%"><label id="lblnoswords1"></label></td>
    <td  style="width:13%;font-weight:bold">Amount</td>
      <td  style="width:13%"><label id="lbltotal1"></label></td>
  </tr>
       <tr>
    <td  style="width:10%"><b>Pay Mode</b></td>
    <td style="width:45%"><label id="lblpaymode1"></label></td>
    <td  style="width:13%; font-weight:bold"></td>
      <td  style="width:13%"></td>
  </tr> 
       <tr style="display:none" id="divs1">
    <td  style="width:10%"><b>UTR NO.</b></td>
    <td style="width:45%"><label id="lblutrnos1"></label></td>
    <td  style="width:13%; font-weight:bold"></td>
      <td  style="width:13%"></td>
  </tr>
      </table>
  <table style="width:100%;display:none" id="tblchek3">
     <tr>
    <td style="width:13%;font-weight:bold">ChequeNo</td>
    <td style="width:12%"><label id="lblchkque1"></label></td>
    <td></td>
         <td></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%"><label id="chkdate1"></label></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">Bank</td>
    <td style="width:16%"><label id="lblbankname1"></label></td>
    <td></td>
         <td></td>

  </tr>
 
</table>
                  <div class="col-md-8" style="margin-top:120px;">
                                    
                                </div>
                 <div class="col-md-10"></div>
         <div class="col-md-2" style="margin-top: 40px;">
              <table width="100%">
                    <tr>
                        <td style="float:left;"></td>
                        <td ></td>
                        <td style="float: right; width:200px;">
                           Sign
                        </td>
                            
                     </tr>
             </table>
             </div>               
   <%--<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>
