<?php
$sid=$_REQUEST['sid'];
$chk=mysql_query("SELECT * FROM `student_registration` WHERE `sid` = '$sid' AND `step` >= '8'");
$chk1=mysql_num_rows($chk);
if($chk1=='')
{
$page = $convert->encode("cash-desk");

header("Location:admin.php?page=$page&&chksid=1");
exit;

}
$sql=mysql_query("SELECT * FROM `step1_perosonal` WHERE `sid` ='$sid'") or die(mysql_error());
$sql1 = mysql_fetch_assoc($sql);

$GetContact=mysql_query("SELECT * FROM `step1_contact` WHERE `sid` = '$sid'");
$GetContact1=mysql_fetch_assoc($GetContact);

?>


<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="page-content">




<?php
include("common/sitemap-account.php");


?>                          


                            <div class="container-fluid">
                                

<div data-widget-group="group1">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h2>Cash Receipt Desk  - New Admission</h2>
					<div class="panel-ctrls"></div>
				</div>
				<div class="panel-body">
					<div class="col-md-12">
					<h4><b>Comment:</b> <small><a href="admin.php?page=<?php echo $convert->encode("view-profile-new-admission");?>&&id=<?php echo $convert->encode($sid);?>" target="_blank">View Profile</a></small></h4>
					<h5>Scruitnizer Desk: <font color="#990000"><?php
				$GetSidComment=mysql_query("SELECT * FROM `sgvu_form_comment_executive` WHERE `sid` = '$sid' AND `admin` = 2");
				$GetSidComment1=mysql_fetch_assoc($GetSidComment);
				echo $GetSidComment1['remark'];
				?></font></h5>
				<h5>Senior Desk: <font color="#990000"><?php
				$GetSidCommentsr=mysql_query("SELECT * FROM `sgvu_form_comment_executive` WHERE `sid` = '$sid' AND `admin` ='4'");
				$GetSidCommentsr1=mysql_fetch_assoc($GetSidCommentsr);
				echo $GetSidCommentsr1['remark'];
				?></font></h5>
                <?php
				$GetProgFee
				?>
                Program Fees: 
                
                
				<hr />
					
					
				
					</div>
				</div>
                <div class="panel-body">
				<form action="action-pages/finance/create-receipt-action.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/insert4-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" required name="sid" id="sid" placeholder="Enter SID" value="<?php echo $sid; ?>"></div>
						</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 $sql1['firstname']; ?> <?php echo $sql1['middlename']; ?> <?php echo $sql1['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="<?php echo $GetContact1['student_mobile']; ?>" ></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 $sql1['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">
				<select class="form-control" id="source" name="course" disabled="disabled">
				<option value="">SELECT COURSE</option>		
				<?php
				$GetCourse = mysql_query("SELECT * FROM `sgvu_courses` ORDER BY `sgvu_courses`.`coursename` ASC");
				while($GetCourse1 = mysql_fetch_assoc($GetCourse))
				{
				?>
				<option value="<?php echo $GetCourse1['course_id']; ?>"
				<?php
				if($GetCourse1['course_id']==$sql1['program'])
				{
				echo 'selected="selected"';
				}
				?>
				
				 ><?php echo $GetCourse1['coursename']; ?></option>
				<?php
				}
				?>
						</select>
                        <input type="hidden" name="course" value="<?php echo $sql1['program']; ?>" /></div>
						</div>
						</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" name="sem" value="<?php $GetSem=mysql_query("SELECT * 
FROM  `sgvu_stu_sem_allocate` 
WHERE  `sid` ='$sid'");
				  $GetSem1=mysql_fetch_assoc($GetSem);
				  echo $GetSem1['sem'];
				  ?> Sem" disabled="disabled"class="form-control" />
                </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 `new_admission_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>
					
					
					
					
					
					
					
				</div>
				<div class="panel-footer"></div>
			</div>
			
			
			
			
			
			
		</div>
	</div>
</div> <!-- .container-fluid -->
                        </div>
						
						<script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script> 							<!-- Load jQuery -->
<script type="text/javascript" src="assets/js/jqueryui-1.10.3.min.js"></script> 							<!-- Load jQueryUI -->
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script> 								<!-- Load Bootstrap -->
<script type="text/javascript" src="assets/js/enquire.min.js"></script> 									<!-- Load Enquire -->

<script type="text/javascript" src="assets/plugins/velocityjs/velocity.min.js"></script>					<!-- Load Velocity for Animated Content -->
<script type="text/javascript" src="assets/plugins/velocityjs/velocity.ui.min.js"></script>

<script type="text/javascript" src="assets/plugins/wijets/wijets.js"></script>     						<!-- Wijet -->

<script type="text/javascript" src="assets/plugins/codeprettifier/prettify.js"></script> 				<!-- Code Prettifier  -->
<script type="text/javascript" src="assets/plugins/bootstrap-switch/bootstrap-switch.js"></script> 		<!-- Swith/Toggle Button -->

<script type="text/javascript" src="assets/plugins/bootstrap-tabdrop/js/bootstrap-tabdrop.js"></script>  <!-- Bootstrap Tabdrop -->

<script type="text/javascript" src="assets/plugins/iCheck/icheck.min.js"></script>     					<!-- iCheck -->

<script type="text/javascript" src="assets/plugins/nanoScroller/js/jquery.nanoscroller.min.js"></script> <!-- nano scroller -->

<script type="text/javascript" src="assets/js/application.js"></script>
<script type="text/javascript" src="assets/demo/demo.js"></script>
<script type="text/javascript" src="assets/demo/demo-switcher.js"></script>

<script type="text/javascript" src="assets/plugins/datatables/jquery.dataTables.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="assets/demo/demo-datatables.js"></script>





