
<form action="action-pages/senior/academic-update-action.php" method="post">
<?php
$GetStep2Academic = mysql_query("SELECT * FROM `step2_education` WHERE `sid` = '$id'");
while($GetStep2Academic1 = mysql_fetch_assoc($GetStep2Academic))
{
?>
<input type="hidden" name="id[]" value="<?php echo $GetStep2Academic1['id']; ?>" />
<input type="hidden" name="sid" value="<?php echo $id; ?>" />

<table class="table m-n" width="100%">

									
									<tbody>
										  <tr>
										    <td width="20%"><strong>Education Level</strong></td>
										    <td width="30%"><?php 
											$GetEduLevel = mysql_query("SELECT * FROM `student_edu` WHERE `id` = '$GetStep2Academic1[education_level]'");
											$GetEduLevel1 = mysql_fetch_assoc($GetEduLevel);
											if($edit == 'academic')
											{
											?>
											<input type="text" name="" value="<?php echo $GetEduLevel1['education_level']; ?>" disabled="disabled" class="form-control"/>
											<?php
											}
											else
											{
											echo $GetEduLevel1['education_level'];
											
											}
											 ?></td>
										    <td width="20%"><strong>Board/University</strong></td>
										    <td width="30%"><?php 
											if($edit == 'academic')
											{
											?>
											<input type="text" name="board[]" value="<?php echo $GetStep2Academic1['board_university']; ?>"  class="form-control"/>
											<?php
											}
											else
											{
											echo $GetStep2Academic1['board_university'];											
											}
											 ?></td>
									      </tr>
										  <tr>
										    <td><strong>Institute Name  </strong></td>
										    <td><?php 
											if($edit == 'academic')
											{
											?>
											<input type="text" name="inst_name[]" value="<?php echo $GetStep2Academic1['inst_name']; ?>"  class="form-control"/>
											<?php
											}
											else
											{
											echo $GetStep2Academic1['inst_name'];											
											}
											?></td>
										    <td><strong>Max Marks  </strong></td>
										    <td><?php if($edit == 'academic')
											{
											?>
											<input type="text" name="max_marks[]" value="<?php echo $GetStep2Academic1['max_marks']; ?>"  class="form-control"/>
											<?php
											}
											else
											{
											echo $m=$GetStep2Academic1['max_marks'];											
											}?></td>
									      </tr>
										  <tr>
										    <td><strong>Obtained Marks  </strong></td>
										    <td><?php
											 if($edit == 'academic')
											{
											?>
											<input type="text" name="obtained[]" value="<?php echo $GetStep2Academic1['obtained_marks']; ?>"  class="form-control"/>
											<?php
											}
											else
											{
											echo $b=$GetStep2Academic1['obtained_marks'];											
											}
											?></td>
										    <td><strong>Grade  </strong></td>
										    <td><?php
											 if($edit == 'academic')
											{
											?>
											<input type="text" name="grade[]" value="<?php echo $GetStep2Academic1['grade']; ?>"  class="form-control"/>
											<?php
											}
											else
											{
											echo $GetStep2Academic1['grade'];											
											}
											?><div align="right" style="padding-right:50px">
											
											</div></td>
									      </tr>
										  <tr>
										    <td><strong>Percentage</strong></td>
										    <td><?php $per=($b*100/$m);
											echo round($per, 2); 
											 ?>%</td>
										    <td><strong></strong></td>
										    <td><a href="admin.php?page=<?php echo $convert->encode("student-profile-senior");?>&&id=<?php echo $convert->encode($id); ?>&&edit=<?php echo $convert->encode("academic"); ?>"><span class="ti ti-pencil"></span> Edit</a> &nbsp;&nbsp;&nbsp;<a href="action-pages/senior/delete-academic-senior.php?id=<?php echo $id; ?>&&edit=<?php echo 'academic'; ?>&&accid=<?php echo $GetStep2Academic1['id']; ?>"><span class="ti ti-trash"></span> Delete</a></td>
									      </tr>
										  
										  
									</tbody>
									
									
								</table>
<?php
									}
									?>
							<?php
						if($edit == 'academic')
											{
							?>
							<div align="center"><input type="submit" class="btn-primary btn" id="submit" name="submit" value="Update"></div>
							<?php
							}
							?>
							
							</form>		
								<hr />


<form action="action-pages/senior/academic-action.php" method="post">	

 					<input type="hidden" name="sid" value="<?php echo $id; ?>" />

    <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 cellpadding="0" cellspacing="0" width="100%" id="dataTable" class="">
                                                       <tr style="height:50px">
                                                       <td width="2%"><input type="checkbox" name="chk"></td>
                                                       <td width="15%" style="; " class="center"><select class="form-control" name="education_level[]" style="width:150px" required>
														<option value="">Education Level</option>
														<?php
														$GetBoard = mysql_query("SELECT * FROM `student_edu` WHERE `type` = '0' ORDER BY `id` ASC");
														while($GetBoard1 = mysql_fetch_assoc($GetBoard))
														{
														?>
                                                        <option value="<?php echo $GetBoard1['id']; ?>"><?php echo $GetBoard1['education_level']; ?></option>
                                                        <?php
														}
														?>
													</select></td><td width="17%" style="">
                                                    <input type="text" name="board[]" placeholder="Board/University" class="form-control" style="width:150px" required/>
                                                   </td>
												   <td width="19%" style="">
                                                    <input type="text" name="inst_name[]" placeholder="Institute Name" class="form-control" style="width:150px" required/>
                                                   </td><td width="15%"><input type="text" name="max_marks[]" placeholder="Enter Max Marks" class="form-control" style="width:100px" required/></td><td width="15%"><input type="text" name="obtained[]" placeholder="Enter Obtained Marks" class="form-control" style="width:60px" required/></td><td width="17%"><input type="text" name="grade[]" placeholder="Enter Your Grade" class="form-control" style="width:150px" required/></td></tr>
                                                       
                                                       </table>    <input type="button" value="Add Row" onclick="addRow('dataTable')">
 
    <input type="button" value="Delete Row" onclick="deleteRow('dataTable')">
	<br /><br />
	<input type="submit" class="btn-primary btn" id="submit" name="submit" value="Submit">
	<br /><br />
	
	</form>									
									