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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <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:20px;
                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: 4px;
}

.tr1:nth-child(even) {
  background-color: #000000;
}
</style>
     <script type="text/javascript">
         var receiptnos = null; var installsids = null;
         var appends = "";
         var balanceadm = 0;
         var totalamount = 0;
         var totalinwords = ""; var recpts = "";
         $(document).ready(function () {
             receiptnos = GetParameterValues('receipts');
         
             $.ajax({
                 type: "POST",
                 url: "incomeprint.aspx/GetData",
                 data: "{reptsids :'" + receiptnos + "'}",
                 contentType: "application/json; charset=utf-8",
                 dataType: "json",
                 success: function (data) {
                     if (data.d != "") {
                         data = JSON.parse(data.d);
                         $("#billtbl").find("tbody").empty();
                         $("#lblreceptids").html(data[0].recptnos);
                         $("#lblreceptids1").html(data[0].recptnos);
                         $("#lblrecptdate").html(data[0].recptdate);
                         $("#lblrecptdate1").html(data[0].recptdate);
                         if (data[0].incstudid != "") {
                             $("#studsnm").show(); $("#studsnm1").show();
                             if (data[0].stitles != null) {
                                 $("#lblstuds").html(data[0].stitles + "." + data[0].fname + " " + data[0].mname + " " + data[0].lname);
                                 $("#lblstuds1").html(data[0].stitles + "." + data[0].fname + " " + data[0].mname + " " + data[0].lname);
                             }
                             else {
                                 $("#lblstuds").html(data[0].fname + " " + data[0].mname + " " + data[0].lname);
                                 $("#lblstuds1").html(data[0].fname + " " + data[0].mname + " " + data[0].lname);
                             }
                             $("#studdet").show(); $("#studdet1").show();
                             $("#lblcls").html(data[0].clsname); $("#lblcls1").html(data[0].clsname);
                             $("#lbldivsid").html(data[0].divsname); $("#lbldivsid1").html(data[0].divsname);
                             $("#lblsemeister").html(data[0].semisternm); $("#lblsemeister1").html(data[0].semisternm);
                         }
                         else {
                             $("#studsnm").hide(); $("#studdet").hide();
                         }
                         
                         for (var i = 0 ; i < data.length; i++) {
                             var appendss = "<tr><td>" + data[i].incname + "</td><td>" + data[i].narrations + "</td><td>" + data[i].amount + "</td></tr>";
                             $("#billtbl").find("tbody").append(appendss); $("#billtbl1").find("tbody").append(appendss);
                         }
                         $("#lbltotal").html(data[0].totalamts); $("#lbltotal1").html(data[0].totalamts);
                         recpts = convertNumberToWords(data[0].totalamts);
                         $("#lblnoswords").html(recpts); $("#lblnoswords1").html(recpts);
                      
                         if (data[0].paymodes == "online") {
                             $("#lblmode").html(data[0].paymodes); $("#divs").show();
                             $("#lblmode1").html(data[0].paymodes); $("#divs1").show();
                             $("#lblutrnos").html(data[0].utrnos);
                             $("#lblutrnos1").html(data[0].utrnos);
                         } else {
                             $("#lblmode").html(data[0].paymodes); $("#divs").hide(); $("#lblmode1").html(data[0].paymodes); $("#divs1").hide();
                         }
                     }
                 },
                 error: function (error) {
                     console.log(JSON.stringify(error));
                 }
             });
             setTimeout(function () { window.print(); }, 1000);
           // setTimeout(function () { $("#first12").clone().insertAfter("#first12"); window.print(); }, 1000);
         });
         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";
         }
         </script>
</head>
<body style="font-size:14px;" id="first12">
  <div style="width:100%;" 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;margin-bottom:5px; " align="left" border="1" >
      <%-- <tr>
             <td colspan="3" align="center"  style="width: 15%;">
            <h4> Hi-Tech College Of Pharmacy</h4>
            </td>

       </tr>
      <tr>
             <td colspan="3" align="center"  style="width: 15%;font-size:18px">
     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:21px"><b>Hi-Tech College Of Pharmacy</b></span>, <span style="font-size:16px"><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="margin-bottom:5px;margin-top:10px;font-weight:bold"><h3>Office Copy</h3></label></center>
        <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:45%;font-weight:bold">Student Name: <label id="lblstuds"></label></td>
             <td style="width:35%;font-weight:bold">Date : &nbsp;<label id="lblrecptdate"></label></td>
        </tr>
    </table>
      <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="0">
        <tr>
            <td style="width:25%;font-weight:bold"">Class:<label id="lblcls"></label></td>
            <td style="width:45%;font-weight:bold"">Division: &nbsp;<label id="lbldivsid"></label></td>
             <td style="width:35%;font-weight:bold"">Semister :&nbsp;<label id="lblsemeister"></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;" align="left" border="1">
                  <thead>
  <tr class="tr1">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="th1">Particulars</th>
    <th class="th1">Narration</th>
      <th class="th1">Amount</th>
     
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
      <hr />
  <table style="width:100%;border-collapse: collapse;border-color: #cccccc;height:60%;margin:bottom:75px" 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="lblmode"></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>
                <div class="col-md-8" style="margin-top:200px;">
                                    
                                </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>
  <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 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 /><br /><br /><br /><br /><br /><br /><br /><br /><br />
     <div style="width:100%;margin-top:30px" 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;margin-bottom:5px; " 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="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:21px"><b>Hi-Tech College Of Pharmacy</b></span>, <br /><span style="font-size:16px">  <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="margin-bottom:5px;margin-top:10px;font-weight:bold"><h3>Student Copy</label></center>
           <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:45%;font-weight:bold">Student Name: <label id="lblstuds1"></label></td>
             <td style="width:35%;font-weight:bold">Date : &nbsp;<label id="lblrecptdate1"></label></td>
        </tr>
    </table>
      <table style="width:97%;border-collapse: collapse;border-color: #cccccc; " align="left" border="0">
        <tr>
            <td style="width:25%;font-weight:bold"">Class:<label id="lblcls1"></label></td>
            <td style="width:45%;font-weight:bold"">Division: &nbsp;<label id="lbldivsid1"></label></td>
             <td style="width:35%;font-weight:bold"">Semister :&nbsp;<label id="lblsemeister1"></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;" align="left" border="1">
                  <thead>
  <tr class="tr1">
  <%--  <th class="th1">Sr.No.</th>--%>
    <th class="th1">Particulars</th>
    <th class="th1">Narration</th>
      <th class="th1">Amount</th>
     
  </tr>
                      </thead>
                  <tbody>

                  </tbody>
 
 
</table>                
      <hr />
  <table style="width:100%;border-collapse: collapse;border-color: #cccccc;height:60%;margin:bottom:75px;" 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="lblmode1"></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>
                <div class="col-md-8" style="margin-top:200px;">
                                    
                                </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>
  <table style="width:100%;display:none" id="Table3">
     <tr>
    <td style="width:13%;font-weight:bold">ChequeNo</td>
    <td style="width:12%"><label id="Label11"></label></td>
    <td></td>
         <td></td>

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

     </tr>
 
</table>                
               <table style="width:100%;border-collapse: collapse;border-color: #cccccc;display:none" id="Table5" align="left" border="0">    
  <tr>
    <td style="width:13%;font-weight:bold">Bank</td>
    <td style="width:16%"><label id="Label13"></label></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>
     <%--    <table style="width:100%;border-collapse: collapse; margin-top:3px; max-width:100%; min-width:50%; border-color: #cccccc; height:60%;" align="left" border="0" >
            
           </table>--%>
</body>
   
</html>
