<script language="javascript">
function Calc(className){
var elements = document.getElementsByClassName(className);
var total = 0;

for(var i = 0; i < elements.length; ++i){
total += parseInt(elements[i].value);
}

document.form0.total.value = total;
}

function addone(field) {
field.value = Number(field.value) + 1;
}

function subtractone(field) {
field.value = Number(field.value) - 1;
}
</script>
<div class="panel-body">
				<form action="action-pages/account/create-receipt-action1.php" method="post" name="form0" id="form0">
				<input type="hidden" name="rept" value="<?php echo $GetRptNo1['id']+5000; ?>" />
				
						
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Enter SID</div><div class="col-md-4">

														<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
 
  
    $('#sid').change(function(e){
		  $.post('module/insert3-receipt.php',{sid:$(this).val()},function(data){
			
			   $('#detail').html(data);
			  });
		});
		
     $('#sem').change(function(e){
		  $.post('module/insert.php',{subject:$(this).val()},function(data){
		  		
			   $('#subject').html(data);
			  });
		});		
});
</script>
			
				
				<input type="text" class="form-control"  disabled="disabled"id="sid" value="<?php echo $sid?>">
				<input type="hidden" class="form-control" name="sid" id="sid" value="<?php echo $sid?>"></div>
						</div>
<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Enter Student Name</div><div class="col-md-4"><input type="text" class="form-control" required name="student_name" placeholder="Enter Student Name" value="<?php echo $GetStDetail1['firstname']; ?>&nbsp;<?php echo $GetStDetail1['middlename']; ?>&nbsp;<?php echo $GetStDetail1['lastname']; ?>"></div>
						</div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Enter mobile No.</div><div class="col-md-4"><input type="text" class="form-control" required name="mobile"  placeholder="Enter Mobile No"  value=""></div>
						</div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Enter Father's Name</div><div class="col-md-4"><input type="text" class="form-control" required name="father_name"  placeholder="Enter Father's Name"  value="<?php echo $GetStDetail1['father_name']; ?>"></div>
						</div>
						
						
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Select Course</div><div class="col-md-4">
				<input type="text"  value="<?php 
				$GetCourseName=mysql_query("SELECT * FROM `sgvu_courses` WHERE `course_id` ='$GetStDetail1[program]'");
				$GetCourseName1=mysql_fetch_assoc($GetCourseName);
				echo $GetCourseName1['coursename'];
				
				 ?>" class="form-control" disabled="disabled"/>
				<input type="hidden" name="course" value="<?php echo $GetStDetail1['program']; ?>" />
				</div>
						</div>						
						
				<div id="detail"></div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Select Sem</div><div class="col-md-4">
				<input type="text" class="form-control" disabled="disabled" value="<?php
				$GetSem=mysql_query("SELECT * FROM `sgvu_stu_sem_allocate` WHERE `sid` ='$sid'");
				$GetSem1=mysql_fetch_assoc($GetSem);
				echo $GetSem1['sem'];
				?> Sem
				">
				<input type="hidden" name="sem" value="<?php echo $GetSem1['sem']; ?>" /></div>
						</div>
						
						
						
						
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Date</div><div class="col-md-4"><input type="text" class="form-control" disabled="disabled" value="<?php echo date('d-m-Y'); ?>"></div>
						</div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Fee Type</div><div class="col-md-6">

				
				
						    <script language="javascript">function addRow(tableID){var table=document.getElementById(tableID);var rowCount=table.rows.length;var row=table.insertRow(rowCount);var colCount=table.rows[0].cells.length;for(var i=0;i<colCount;i++){var newcell=row.insertCell(i);newcell.innerHTML=table.rows[0].cells[i].innerHTML;switch(newcell.childNodes[0].type){case"text":newcell.childNodes[0].value="";break;case"checkbox":newcell.childNodes[0].checked=false;break;case"select-one":newcell.childNodes[0].selectedIndex=0;break;}}}
function deleteRow(tableID){try{var table=document.getElementById(tableID);var rowCount=table.rows.length;for(var i=0;i<rowCount;i++){var row=table.rows[i];var chkbox=row.cells[0].childNodes[0];if(null!=chkbox&&true==chkbox.checked){if(rowCount<=1){alert("Cannot delete all the rows.");break;}
table.deleteRow(i);rowCount--;i--;}}}catch(e){alert(e);}}</script>

						<table id="dataTable"><tr><td><input type="checkbox" name="chk"></td><td><select class="form-control" id="fee" name="fee_type[]" required>
							<option value="">Select Fees</option>
							<?php
							$GetFeeType = mysql_query("SELECT * FROM `sgvu_fee_type` WHERE `finance_show` = 1 ORDER BY `sgvu_fee_type`.`fees_type` ASC");
							while($GetFeeType1 = mysql_fetch_assoc($GetFeeType))
							{
							?>
							<option value="<?php echo $GetFeeType1['id']; ?>"><?php echo $GetFeeType1['fees_type']; ?></option>
<?php
}
?>							
						</select></td><td><input type="text" name="fee_amount[]" id="box1" class="add form-control" value="0" onKeyUp="Calc('add')" onChange="updatesum()" onClick="this.focus();this.select();" required/></td></tr></table>
						<a onclick="addRow('dataTable')">Add</a>&nbsp;&nbsp; <a onclick="deleteRow('dataTable')">Delete</a>
 
				
		
						
						
						</div></div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4">Grand Total</div><div class="col-md-4"> <input type="text" style="color:red;" id="total" name="total" class="form-control"></div>
						</div>
						<div class="col-md-12" style="padding-top:10px">
				<div class="col-md-4"></div><div class="col-md-4"><button class="btn-primary btn" type="submit">Submit</button>&nbsp;&nbsp;<button class="btn-primary btn" type="reset">Reset</button></div>
						</div>
						
						
				</form>
					
						
					
					</div>