<?php include('database-connection.php');?>  
<?php include('function.php');?>  
<?php include('meta-tag.php');?>  
	<!-- Header -->
	<?php include('header.php')?>
	<style>
	.search-text {

		width:130px;

	}
	.search-button {
		background-color: #fae042;
		color: #ffffff;
		font-size:22px;
		padding: 10px 20px;
		
		font-family: Raleway;
		cursor: pointer;
		border-image: linear-gradient(to left, #008f68 0%, #fae042 100%);
		border-image-slice: 1;
		border-width: 3px;
		width:130px;

	}
	.center-align
	{
		text-align:center;
	}
#NewData {
  background-color: #ffffff;
  margin: 100px auto;
  font-family: Raleway;
  padding: 40px;
  width: 90%;
  min-width: 300px;
  border: 10px solid;
  border-image: linear-gradient(45deg, rgb(0,143,104), rgb(250,224,66)) 1;
}
table #cusTop  {
  border: 1px solid #ddd;
  padding: 8px;
  height:auto;
}

#customers {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#customers td, #customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}

#customers tr:hover {background-color: #ddd;}

#customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #04AA6D;
  color: white;
}	
	
	</style>
		<!-- Start main-content -->
		<div class="main-content">


			<!-- Section: inner-header -->
			<section class="inner-header divider layer-overlay overlay-theme-colored-7" data-bg-img="<?php echo ThemeSetting()[2]?>/assets/images/bg/bg1.jpg">
			  <div class="container pt-120 pb-60">
				<!-- Section Content -->
				<div class="section-content">
				  <div class="row"> 
					<div class="col-md-6">
					  <h2 class="text-theme-colored2 font-36">Ntt Student Verification</h2>
					  <ol class="breadcrumb text-left mt-10 white">
						<li><a href="#">Home</a></li>
						<li><a href="#">Usefull Links</a></li>
						<li class="active">Ntt Student Verification</li>
					  </ol>
					</div>
				  </div>
				</div>
			  </div>
			</section>

	<section>
      <div class="container">
        <div class="row">
          <div class="col-md-12 ">
            <div class="border-1px p-25">
              <h4 class="text-theme-colored text-uppercase m-0">Ntt Student Verification</h4>
              <div class="line-bottom mb-30"></div>
             
				<form id="search11" method="post" action="ntt-student-verification.html"  name="mySearch" >
                <div class="row">			
					<div class="form-group col-md-6">
						<label>Enrollment Number</label>
						<input type="text" name="search_enrolnumber"  placeholder="Enter Enrollment Number" class="form-control">
					</div>
					<div class="form-group col-md-6">
						<label>Date of Birth</label>
						<input type="date" name="dateofbirth"  placeholder="Date of Birth (DD/MM/YYYY)" class="form-control">
					</div>					   
                </div>
				
                <div class="form-group mb-0 mt-20">
                  <input name="form_botcheck" class="form-control" type="hidden" value="">
                  <button type="submit" class="btn btn-dark btn-theme-colored" data-loading-text="Please wait..." id="btn_add">Search</button>
                </div>
             </form>
              <!-- Appointment Form Validation-->
				
            </div>
          </div>
        </div>
      </div>
    </section>
<?Php	
$query_general_setting=mysqli_fetch_array(mysqli_query($connexam,"select * from general_setting where id=1 and g_id=1"));
$URLEXam=$query_general_setting['g_url'];

if(!empty($_POST['search_enrolnumber']) and !empty($_POST['dateofbirth']))
{	
	if(is_numeric($_POST['search_enrolnumber']) and !empty($_POST['dateofbirth']))
	{
		   		
		$query_student=mysqli_query($connexam,"select * from ntt_student where package_epin='".$_POST['search_enrolnumber']."' and student_dob='".date("d-m-Y", strtotime($_POST['dateofbirth']))."'");
		$NUM_ROWS=mysqli_num_rows($query_student);
		
		if($NUM_ROWS >0 )
		{?>
			<section>
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<div class="border-1px ">
							<?php											
							$studentResult=mysqli_fetch_array($query_student);
							$studentId=$studentResult['student_id'];
							$centerId=$studentResult['center_id'];	
							if(!empty($studentResult['studentlogo']))
							{
								$avatar_student='<img src="'.$URLEXam.'images/logo/ntt-student-avtar/'.$studentResult['studentlogo'].'" height="160">';
							}
							else
							{
								$avatar_student='<img src="'.$URLEXam.'images/logo/ntt-student-avtar/demo/male-dom_image.jpg" height="160">'; 
							}	
							if(!empty($query_general_setting['g_logo']))
							{		

								$avatar_logo_admin='<img src="'.$URLEXam.'images/logo/'. $query_general_setting['g_logo'].'"  height="160px">'; 
							}
							else
							{

								$avatar_logo_admin='<img src="'.$URLEXam.'images/logo/defaultlogo/your-logo.png" height="160px"/>';				
							}

							$queryCenter=mysqli_fetch_array(mysqli_query($connexam,"SELECT * FROM center where c_id='".$centerId."'"));
								
							$queryCategory=mysqli_fetch_array(mysqli_query($connexam,"SELECT * FROM ntt_category where c_id='".$studentResult['category_id']."'"));

							$querySubCategory=mysqli_fetch_array(mysqli_query($connexam,"SELECT * FROM ntt_sub_category where scid='".$studentResult['subcategory_id']."'"));
							?>	
	<div class="table-responsive">						
	<table border="0" width="100%" >
		<tr> 
			<td>
				<table border="0" width="100%" id="cusTop" style="text-align:center">
					<tr>
						<td><img src="<?php echo $URLEXam;?>images/logo/ntt-search-logo/ntt-bottom.jpeg" height="150px"/></td>
						<td style="text-align:center">
							<table>
								<tr>
									<td style="line-height:35px;font-size:21px;text-align:center"><b><?php echo $queryCenter['centername']?></b></td>
								</tr>
								<tr>
									<td style="line-height:35px;font-size:21px;text-align:center"><?php echo 'An ISO 9001:2015 Certified Institution'?></td>
								</tr>
								<tr>
									<td style="line-height:35px;font-size:18px;text-align:center"><?php echo 'Registered Under Govt. of West Bengal Trust Registration Act 1882'?></td>
								</tr>
							
							</table>
						</td>
						<td><?php echo $avatar_student;?></td>
				
					</tr>
					<tr>
						<td colspan="3" style="line-height:35px;font-size:18px;text-align:center">Registered under Ministry of Human Resource Development [MHRD] [NCT,Delhi] Govt. of India</td>		
					</tr>
					
				</table>
			
			
			</td>
		</tr>
		
		<tr>
			<td>
				<table border="0" width="100%" id="customers" style="overflow-x:auto;">
				<tr>
					<td width="30%">Student Name</td>
					<td><?php echo $studentResult['student_name'];?></td>
				</tr>
				<tr>
					<td>Father Name</td>
					<td><?php echo $studentResult['student_father'];?></td>
				</tr>
				<tr>
					<td>Gender</td>
					<td><?php 
					if($studentResult['gender']=='F')
					{
						echo 'Fe-male';
					}
					else if($studentResult['gender']=='M')
					{
						echo 'Male';
					}
					else{
						echo '';
					}
					
					?></td>
				</tr>
				<tr>
					<td>D.O.B</td>
					<td><?php echo $studentResult['student_dob'];?></td>
				</tr>
				<tr>
					<td>Enrollment Number</td>
					<td><?php echo $studentResult['package_epin'];?></td>
				</tr>
				<tr>
					<td>Session</td>
					<td><?php echo $studentResult['session'];?></td>
				</tr>
				
				<tr>
					<td>Study Centre Name</td>
					<td><?php echo $queryCenter['centername'];?></td>
				</tr>
				<tr>
					<td>Course Name</td>
					<td><?php echo $querySubCategory['subcategory_name'];?></td>
				</tr>						
				</table>
			
			</td>
		</tr>
	<?php	
	$scid=$studentResult['subcategory_id'];	
	$cid=$studentResult['category_id'];	
	$sid=$studentResult['student_id'];		
	$Query=mysqli_query($connexam, "SELECT * FROM ntt_sub_category_subject where category_id='".$cid."' and scid='".$scid."' ORDER BY year_semester ASC ");
	$SubjectNameStirng='';
	while($Result=mysqli_fetch_array($Query))
	{	



		$queryCheck=mysqli_query($connexam,"select * from ntt_marksheet_marks where sid='".$sid."' and cid='".$cid."' and scid='".$scid."' and ys='".$Result['year_semester']."'");
		
		?>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td style="font-size:22px;text-align:center;font-weight:bold"><?php echo $Result['year_semester'];?> year/Semester</td>
		</tr>		
		<?php 
		
		if(mysqli_num_rows($queryCheck)>0)
		{
			$resutlMyChecj=mysqli_fetch_array($queryCheck);
		?>
		<tr>
			<td>
		<table border="1" width="100%"   id="customers" style="overflow-x:auto;">
		<tr>
		<td rowspan="2">Subject</td>
		<td rowspan="2">Full marks</td>
		<td rowspan="2">Min %</td>
		<td colspan="3">Marks Obtaind</td>

		</tr>
		<tr>
		<td>Theory</td>
		<td>Practical</td>
		<td>Total</td>		
		</tr>
		<?php 		
		$queryNttMarksheetSubjectMarks=mysqli_query($connexam,"select * from ntt_marksheet_subject_marks where ntt_marksheet_info_id='".$resutlMyChecj['id']."'");
		while($ResultNMSSM=mysqli_fetch_array($queryNttMarksheetSubjectMarks))
		{?>
			<tr>
				<td class="topBorder topLeft topRight textSize9"><?php echo $ResultNMSSM['subjectName'];?></td>
				<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($ResultNMSSM['fullmarks']);?></td>
				<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($ResultNMSSM['minmarks']);?></td>
				<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($ResultNMSSM['usermarks']);?></td>
				<td class="topBorder topRight alignCenter textSize9"></td>
				<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($ResultNMSSM['usermarks']);?></td>
			</tr>
		<?php }
		
		$queryNttMarksheetPracticalMarks=mysqli_query($connexam,"select * from ntt_marksheet_practical_marks where ntt_marksheet_info_id='".$resutlMyChecj['id']."'");
		while($ResultNMSPM=mysqli_fetch_array($queryNttMarksheetPracticalMarks))
		{?>
			<tr>
				<td><?php echo $ResultNMSPM['subjectName'];?></td>
				<td><?php echo floatval($ResultNMSPM['fullmarks']);?></td>
				<td><?php echo floatval($ResultNMSPM['minmarks']);?></td>
				<td></td>
				<td><?php echo floatval($ResultNMSPM['usermarks']);?></td>
				<td><?php echo floatval($ResultNMSPM['usermarks']);?></td>
			</tr>
		<?php }	?>
		<tr>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		</tr>
		<tr>
		<td class="textBold topBorder topLeft topRight textSize9">Grand Total</td>
		<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($resutlMyChecj['grandTotalFullmarks']);?></td>
		<td class="topBorder topRight textSize9"></td>
		<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($resutlMyChecj['grandTotalSubjectmarks']);?></td>
		<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($resutlMyChecj['grandTotalPracticalmarks']);?></td>
		<td class="topBorder topRight alignCenter textSize9"><?php echo floatval($resutlMyChecj['grandTotalTotalmarks']);?></td>
	</tr>
	<tr>
		<td class="topBorder topLeft topBottom textSize8"><span class="textBold topRight textSize8">Exam Date: </span><?php echo $resutlMyChecj['examDate'];?></td>
		<td colspan="3" class="topBorder topBottom topRight textSize8"><span class="textBold textSize8">Percentage of Marks: </span><?php echo floatval($resutlMyChecj['percentageOfmarks']);?>%</td>
		<td colspan="2" class="topBorder topBottom topRight textSize8"><span class="textBold textSize8">Overall Grade: </span><?php echo $resutlMyChecj['OverAllgrade'];?></td>		
	</tr>
		
		
		</table>
		</td>
		</tr>	
		
		


		
		<?php 
		}
		else{?>
			<tr>
				<td>
				<table border="0" width="100%" id="customers" style="overflow-x:auto;">
				<tr>
					<td width="30%">Marks sheet and certificate was not genrated</td>
					
				</tr>
				</table>
				
				</td>
			</tr>
		<?php }
	}
	?>
		
	</table>							
	</div>						
							
							
							
							
							
							
							
							
							
								
							</div>
						</div>
					</div>
				</div>
			</section>
				
		<?php }
		else
		{?>
			
			<section>
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<div class="">
								<div class="alert alert-danger" role="alert">Please check Your Enrollment Number & date of birth</div>
							</div>
						</div>
					</div>
				</div>
			</section>
		<?php }
	}
	else
	{?>		
		<section>
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="">
							<div class="alert alert-danger" role="alert">Please Enter Numeric Enrollment Number</div>
						</div>
					</div>
				</div>
			</div>
		</section>
	<?php }
	
}
else
{	?>
	
	<section>
		<div class="container">
			<div class="row">
				<div class="col-md-12 ">
					<div class="">
						<div class="alert alert-info" role="alert">Please Enter Enrollment number and Date of Birth</div>
					</div>
				</div>
			</div>
		</div>
	</section>
<?php
}
?>

		</div>
		<!-- end main-content -->
	<!-- Footer -->
	<?php include('footer.php')?>
</div>
<!-- end wrapper -->

<!-- Footer Scripts -->
<!-- JS | Custom script for all pages -->
<?php include('script.php')?>