<?php include "config.php"; 

$btnSave3=$_GET['btnSave3'];
					   if($btnSave3!=""){
					   
					   $fno=$_GET['fno'];
					   }

 $btnSave2=$_POST['btnSave2'];
					   if($btnSave2!=""){
					$class_std_ing=$_POST['class_std_ing'];
$class_std_ing_sig=$_POST['class_std_ing_sig'];
$CourseType=$_POST['CourseType'];
$Course=$_POST['Course'];
$Course_Details=$_POST['Course_Details'];
$Student_Type=$_POST['Student_Type'];
$StudentName=$_POST['StudentName'];
$FatherName=$_POST['FatherName'];
$MotherName=$_POST['MotherName'];
$txt_dob=$_POST['txt_dob'];
$Gender=$_POST['Gender'];
$Category=$_POST['Category'];
$SubCategory=$_POST['SubCategory'];
$Religion=$_POST['Religion'];
$MobileNO=$_POST['MobileNO'];
$txtEmailID=$_POST['txtEmailID'];
$college=$_POST['college'];
$class_app=$_POST['class_app'];
$cname=$_POST['cname'];
$cname2=$_POST['cname2'];
$cname3=$_POST['cname3'];
$cname4=$_POST['cname4'];
$cname5=$_POST['cname5'];
$cname6=$_POST['cname6'];
$cname7=$_POST['cname7'];
$cname8=$_POST['cname8'];
$b=$_POST['b'];
$b2=$_POST['b2'];
$b3=$_POST['b3'];
$b4=$_POST['b4'];
$b5=$_POST['b5'];
$b6=$_POST['b6'];
$b7=$_POST['b7'];
$b8=$_POST['b8'];
$y=$_POST['y'];
$y2=$_POST['y2'];
$y3=$_POST['y3'];
$y4=$_POST['y4'];
$y5=$_POST['y5'];
$y6=$_POST['y6'];
$y7=$_POST['y7'];
$y8=$_POST['y8'];
$y9=$_POST['y9'];
$r=$_POST['r'];
$r2=$_POST['r2'];
$r3=$_POST['r3'];
$r4=$_POST['r4'];
$r5=$_POST['r5'];
$r6=$_POST['r6'];
$r7=$_POST['r7'];
$r8=$_POST['r8'];
$r9=$_POST['r9'];
$tm=$_POST['tm'];
$tm2=$_POST['tm2'];
$tm3=$_POST['tm3'];
$tm4=$_POST['tm4'];
$tm5=$_POST['tm5'];
$tm6=$_POST['tm6'];
$tm7=$_POST['tm7'];
$tm8=$_POST['tm8'];
$tm9=$_POST['tm9'];
$mo=$_POST['mo'];
$mo2=$_POST['mo2'];
$mo3=$_POST['mo3'];
$mo4=$_POST['mo4'];
$mo5=$_POST['mo5'];
$mo6=$_POST['mo6'];
$mo7=$_POST['mo7'];
$mo8=$_POST['mo8'];
$mo9=$_POST['mo9'];
$g=$_POST['g'];
$g2=$_POST['g2'];
$g3=$_POST['g3'];
$g4=$_POST['g4'];
$g5=$_POST['g5'];
$g6=$_POST['g6'];
$g7=$_POST['g7'];
$g8=$_POST['g8'];
$g9=$_POST['g9'];
$s=$_POST['s'];
$s2=$_POST['s2'];
$s3=$_POST['s3'];
$s4=$_POST['s4'];
$s5=$_POST['s5'];
$s6=$_POST['s6'];
$s7=$_POST['s7'];
$s8=$_POST['s8'];
$s9=$_POST['s9'];
$txtHouseNo=$_POST['txtHouseNo'];
$txtStreet=$_POST['txtStreet'];
$txtPostOffice=$_POST['txtPostOffice'];
$txtState=$_POST['txtState'];
$txtDistrict0=$_POST['txtDistrict0'];
$txtPinCode=$_POST['txtPinCode'];
$datee=$_POST['datee'];
$time=$_POST['time'];
$status=$_POST['status'];
$college_roll=$_POST['college_roll'];
$total_fees=$_POST['total_fees'];
$pay_fee=$_POST['pay_fee'];
$pay_date=$_POST['pay_date'];
$checked_by=$_POST['checked_by'];
$fno=$_POST['fno']; //echo $fno.'***';
$session=$_POST['session'];
$acard=$_POST['acard'];



}else{

$college=$_GET['college'];
							$CourseType=$_GET['CourseType'];
							$Course=$_GET['Course'];
							$Course_Details=$_GET['Course_Details'];
							$session=$_GET['session'];
							$Student_Type=$_GET['Student_Type'];
							$btnSave=$_GET['btnSave'];
}
?>
                   
                     <?php
					 $check_exist_qry2="select * from class2 where fno='$fno' and session='$session' and code='$code'";
$run_qry2=mysql_query($check_exist_qry2);
$total_found2=mysql_num_rows($run_qry2);
$row = mysql_fetch_array($run_qry2, MYSQL_BOTH);
$check_exist_qryb="select * from class2 where fno='$fno'";
$run_qryb=mysql_query($check_exist_qryb);
$total_foundb=mysql_num_rows($run_qryb);
$my_value=mysql_fetch_assoc($run_qryb);
	$my_stored_game=explode(",",$my_value['class_app']);
				//echo $row['id'].'*******************';	 
					 $btnSave2=$_POST['btnSave2'];
					   if($btnSave2=="Save"){
					
if($total_foundb>0)
{
$upd_qry="UPDATE `class2` SET CourseType='$CourseType',Course='$Course',Course_Details='$Course_Details',Student_Type='$Student_Type',StudentName='$StudentName',FatherName='$FatherName',MotherName='$MotherName',txt_dob='$txt_dob',Gender='$Gender',Category='$Category',SubCategory='$SubCategory',Religion='$Religion',MobileNO='$MobileNO',txtEmailID='$txtEmailID',college='$college',class_app='$class_app',cname='$cname',cname2='$cname2',cname3='$cname3',cname4='$cname4',cname5='$cname5',cname6='$cname6',cname7='$cname7',cname8='$cname8',b='$b',b2='$b2',b3='$b3',b4='$b4',b5='$b5',b6='$b6',b7='$b7',b8='$b8',y='$y',y2='$y2',y3='$y3',y4='$y4',y5='$y5',y6='$y6',y7='$y7',y8='$y8',y9='$y9',r='$r',r2='$r2',r3='$r3',r4='$r4',r5='$r5',r6='$r6',r7='$r7',r8='$r8',r9='$r9',tm='$tm',tm2='$tm2',tm3='$tm3',tm4='$tm4',tm5='$tm5',tm6='$tm6',tm7='$tm7',tm8='$tm8',tm9='$tm9',mo='$mo',mo2='$mo2',mo3='$mo3',mo4='$mo4',mo5='$mo5',mo6='$mo6',mo7='$mo7',mo8='$mo8',mo9='$mo9',g='$g',g2='$g2',g3='$g3',g4='$g4',g5='$g5',g6='$g6',g7='$g7',g8='$g8',g9='$g9',s='$s',s2='$s2',s3='$s3',s4='$s4',s5='$s5',s6='$s6',s7='$s7',s8='$s8',s9='$s9',txtHouseNo='$txtHouseNo',txtStreet='$txtStreet',txtPostOffice='$txtPostOffice',txtState='$txtState',txtDistrict0='$txtDistrict0',txtPinCode='$txtPinCode',datee='$datee',time='$time',status='$status',college_roll='$college_roll',total_fees='$total_fees',pay_fee='$pay_fee',pay_date='$pay_date',checked_by='$checked_by',fno='$fno',session='$session',acard='$acard' where fno='$fno' and session='$session' and code='$code'";
		//$upd_qry="UPDATE class2 SET class2=$all_game_value WHERE user_name='$user_name'";
		mysql_query($upd_qry,$link);
		
		

}else{

					  $ins_qry="INSERT INTO `class2` (`class_std_ing`, `class_std_ing_sig`, `CourseType`, `Course`, `Course_Details`, `Student_Type`, `StudentName`, `FatherName`, `MotherName`, `txt_dob`, `Gender`, `Category`, `SubCategory`, `Religion`, `MobileNO`, `txtEmailID`, `college`, `class_app`, `cname`, `cname2`, `cname3`, `cname4`, `cname5`, `cname6`, `cname7`, `cname8`, `b`, `b2`, `b3`, `b4`, `b5`, `b6`, `b7`, `b8`, `y`, `y2`, `y3`, `y4`, `y5`, `y6`, `y7`, `y8`, `y9`, `r`, `r2`, `r3`, `r4`, `r5`, `r6`, `r7`, `r8`, `r9`, `tm`, `tm2`, `tm3`, `tm4`, `tm5`, `tm6`, `tm7`, `tm8`, `tm9`, `mo`, `mo2`, `mo3`, `mo4`, `mo5`, `mo6`, `mo7`, `mo8`, `mo9`, `g`, `g2`, `g3`, `g4`, `g5`, `g6`, `g7`, `g8`, `g9`, `s`, `s2`, `s3`, `s4`, `s5`, `s6`, `s7`, `s8`, `s9`, `txtHouseNo`, `txtStreet`, `txtPostOffice`, `txtState`, `txtDistrict0`, `txtPinCode`, `datee`, `time`, `status`, `college_roll`, `total_fees`, `pay_fee`, `pay_date`, `checked_by`, `fno`, `session`,`acard`,`code`,`session`) VALUES ('$class_std_ing', '$class_std_ing_sig', '$CourseType', '$Course', '$Course_Details', '$Student_Type', '$StudentName', '$FatherName', '$MotherName', '$txt_dob', '$Gender', '$Category', '$SubCategory', '$Religion', '$MobileNO', '$txtEmailID', '$college', '$class_app', '$cname', '$cname2', '$cname3', '$cname4', '$cname5', '$cname6', '$cname7', '$cname8', '$b', '$b2', '$b3', '$b4', '$b5', '$b6', '$b7', '$b8', '$y', '$y2', '$y3', '$y4', '$y5', '$y6', '$y7', '$y8', '$y9', '$r', '$r2', '$r3', '$r4', '$r5', '$r6', '$r7', '$r8', '$r9', '$tm', '$tm2', '$tm3', '$tm4', '$tm5', '$tm6', '$tm7', '$tm8', '$tm9', '$mo', '$mo2', '$mo3', '$mo4', '$mo5', '$mo6', '$mo7', '$mo8', '$mo9', '$g', '$g2', '$g3', '$g4', '$g5', '$g6', '$g7', '$g8', '$g9', '$s', '$s2', '$s3', '$s4', '$s5', '$s6', '$s7', '$s8', '$s9', '$txtHouseNo', '$txtStreet', '$txtPostOffice', '$txtState', '$txtDistrict0', '$txtPinCode', '$datee', '$time', '$status', '$college_roll', '$total_fees', '$pay_fee', '$pay_date', '$checked_by', '$fno','$session','$acard','$code','$session')";
		mysql_query($ins_qry,$link) or die("Insertion Failed:" . mysql_error()); 
}		

 if($btnSave2=="Save"){
{
	$all_game_valueb = implode(",",$_POST['ckb']);
	
		//update
		$upd_qryb="UPDATE class2 SET class_app='".$all_game_valueb."' where fno='$fno' and session='$session' and code='$code'";
		mysql_query($upd_qryb,$link);
		}
		 
		}}
		?>
        <?php
if(isset($btnSave2)){
							
?>
    
  
	
    <script type="text/javascript">
   	// Javascript URL redirection
    window.location.replace("print_form.php?fno=<?php echo $fno; ?>&&btnSave2=<?php echo $btnSave2; ?>&&all_game_valueb=<?php echo $all_game_valueb; ?>&&CourseType=<?php echo $CourseType; ?>&&Course=<?php echo $Course; ?>&&Course_Details=<?php echo $Course_Details; ?>&&session=<?php echo $session; ?>&&Student_Type=<?php echo $Student_Type; ?>&&college=<?php echo $college; ?>");
</script>
<?php	}
?>

<!DOCTYPE html>
<!-- saved from url=(0051)http://registration.rmlauexams.in/Registration.aspx -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		
		<title>Advance College Management System - Developed By MD SOFTWARE - Faizabad</title>

		
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="./reg_1_files/bootstrap.min.css">
		<link rel="stylesheet" href="./reg_1_files/font-awesome.min.css">

		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="./reg_1_files/jquery-ui.custom.min.css">
		<link rel="stylesheet" href="./reg_1_files/chosen.min.css">
		<link rel="stylesheet" href="./reg_1_files/datepicker.min.css">
		<link rel="stylesheet" href="./reg_1_files/bootstrap-timepicker.min.css">
		<link rel="stylesheet" href="./reg_1_files/daterangepicker.min.css">
		<link rel="stylesheet" href="./reg_1_files/bootstrap-datetimepicker.min.css">
		<link rel="stylesheet" href="./reg_1_files/colorpicker.min.css">

		<!-- text fonts -->
		<link rel="stylesheet" href="./reg_1_files/fonts.googleapis.com.css">

		<!-- ace styles -->
		<link rel="stylesheet" href="./reg_1_files/ace.min.css" class="ace-main-stylesheet" id="main-ace-style">

		
	</head>

	<body class="no-skin" style="text-transform: uppercase;">
    
  <?php
		 if($college!=""){
							
$queryyo = "SELECT * FROM college_info where code='$college'";
$numresultsyo=mysql_query($queryyo);
$resultyo= mysql_query($queryyo) or die("Couldn't execute query");
$a_rowwo = mysql_fetch_row( $resultyo );

?><table width="800" border="0" cellspacing="2" cellpadding="2" align="center">
  <tr>
    
    <td align="center"> <div align="left" style="float:left; width:90px;"><img src="<?php echo $a_rowwo['4']; ?>" height="80" width="80" align="right"></div><div align="center" style="font-family:'Times New Roman', Times, serif; font-size:36px; font-weight:bold; margin:0px; padding:0px; width:860px;"><?php echo $a_rowwo['2']; ?> ( <?php echo $a_rowwo['1']; ?>)<br><p align="center" style="font:'Times New Roman', Times, serif; font-size:16px;"><?php echo $a_rowwo['3']; ?></p></div>
       </td>
  </tr>
</table><?php } ?>

         
                            
        	<form name="form1" method="post" action="reg_form.php" id="form1" class="form-horizontal" role="form" enctype="multipart/form-data">
            
            <input name="session" type="hidden" value="<?php echo $session; ?>">

<input name="datee" type="hidden" value="<?php 
	if (function_exists('date_default_timezone_set'))
{
  date_default_timezone_set('Asia/Kolkata');
}

echo date('Y-m-d');
	?>"   style="width:80px;"  />
    <input name="time" type="hidden" value="<?php $t=$row["time_c"];
	
	if (function_exists('date_default_timezone_set'))
{
  date_default_timezone_set('Asia/Kolkata');
}

echo date('h-i-s A');
	?>"  style="width:80px;"  />
    
    <input name="fno" type="text" value="<?php
	
	if($fno!="")
{

echo $fno;

}else{ 
	if (function_exists('date_default_timezone_set'))
{
  date_default_timezone_set('Asia/Kolkata');
}

echo date('Ymdhis');
}
	?>"   style="width:80px;" readonly  />


							
		<div id="navbar" class="navbar navbar-default">
			

			<div class="navbar-container" id="navbar-container">
				 

				

				<div class="navbar-buttons navbar-header pull-right" role="navigation">
					 
				</div>
			</div><!-- /.navbar-container -->
		</div>

		<div class="main-container" id="main-container">
		 
			<div class="main-content">
				<div class="main-content-inner">
					<div class="breadcrumbs" id="breadcrumbs">
						 

						<ul class="breadcrumb">
							

							<li>
								 <a href="index.php?college=<?php echo $college; ?>&session=<?php echo $session; ?>&CourseType=<?php echo $CourseType; ?>&Course=<?php echo $Course; ?>&Course_Details=<?php echo $Course_Details; ?>&Student_Type=<?php echo $Student_Type; ?>">Registration</a>
							</li>
							<li class="active">
                             <?php 
							 
							 
							 $queryy = "SELECT * FROM course_name where id='$Course' and session='$session' and code='$code'";
$numresultsy=mysql_query($queryy);
$resulty= mysql_query($queryy) or die("Couldn't execute query");
$a_roww = mysql_fetch_row( $resulty ) ;
$cname=$a_roww[1]; echo $cname;
 ?>
	      
               
                            
                            
                           अभ्यर्थी परीक्षा  फार्म वर्ष – <?php echo $session; ?> </li>
						</ul><!-- /.breadcrumb -->

						 <!-- /.nav-search -->
					</div>

					<div class="page-content">

                     
                        
						<div class="page-header">
							<h1>
								Registration form
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									Course Details
								</small>
							</h1>
						</div><!-- /.page-header -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Course Type</label>

										<div class="col-sm-4">
											 <label class="col-xs-12 col-sm-4 control-label no-padding-left" for="form-field-1">
                                             
                                              <select name="CourseType" title="Select Course Name/ Class" required >
	<?php if($CourseType=='UG'){
				  ?>
	<option value="UG">UNDER GRADUATE</option><?php } ?>
    <?php if($CourseType=='PG'){
				  ?>
	<option value="PG">POST GRADUATE</option><?php } ?>

</select>
                                             
                                             </label>

                                            
										</div>
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Course Name/ Class </label>

										<div class="col-sm-4">
											<select name="Course" title="Select Course Name/ Class" required  class="chosen-select form-control" required>
                                            
                                            <?php $queryy = "SELECT * FROM course_name where id='$Course' and session='$session' and code='$code'";
$numresultsy=mysql_query($queryy);
$resulty= mysql_query($queryy) or die("Couldn't execute query");
 ?>
	 <?php
while ( $a_roww = mysql_fetch_row( $resulty ) )
 {?>
                  <option
                 <?php 
				 $Course_id=$a_roww[0];
				 if($Course_id==$Course){
				  ?>selected<?php } ?>
                  
                   value="<?php echo $a_roww[0];?>" ><?php echo $a_roww[1];?></option>
                  <?php } ?>

</select>
										</div>
									</div>
                                    <div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Year/Semester</label>

										<div class="col-sm-4">
											<select name="Course_Details" title="Select  Year/Semester" class="chosen-select form-control" required>
	
     
	<option value="<?php echo $Course_Details; ?>"><?php echo $Course_Details; ?></option>
	  
    
    
</select>
                                           
										</div>
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Student Type</label>

										<div class="col-sm-4">
											<select name="Student_Type"  class="chosen-select form-control" data-placeholder="Choose a State..." required>
	<option selected="selected" value<?php echo $Student_Type; ?>="1"><?php echo $Student_Type; ?></option>

</select>  
										</div>
									</div>
                                    
                                    <div class="page-header">
							<h1>
								Fill Student Information 
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									(Please, Do not write Shri / Smt./ Km/Ms)
								</small>
							</h1>
						</div>
                                    <div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Student Name</label>

										<div class="col-sm-4">
											    <input name="StudentName" type="text" value="<?php echo $row['StudentName']; ?>" id="txt_StudentName" class="form-control" placeholder="Student Name" title="Tooltip for Student Name" required>
 
										</div>
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Father Name </label>

										<div class="col-sm-4">
											     <input name="FatherName" type="text" value="<?php echo $row['FatherName']; ?>" id="txtFatherName" class="form-control" placeholder="Father Name" title="Tooltip for Father Name" required>
 
										</div>
									</div>
                                    <div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Mother Name</label>

										<div class="col-sm-4">
											   <input name="MotherName" type="text" value="<?php echo $row['MotherName']; ?>" id="txtMotherName" class="form-control" placeholder="Mother Name" title="Tooltip for Mother Name" required>
 
										</div>
                                        
                                        
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Aadhar Card No</label>

										<div class="col-sm-4">
											   <input name="acard" type="text" value="<?php echo $row['acard']; ?>" id="acard" class="form-control" placeholder="Aadhar Card" title="Aadhar Card">
 
										</div>
                                      
									</div>
                                    
                                    <div class="form-group">
										  <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Date of Birth </label>

										<div class="col-sm-1">
											    <input name="txt_dob" type="text" value="<?php echo $row['txt_dob']; ?>" id="txt_dob" placeholder="DD/MM/YYYY" data-toggle="tooltip" class="form-control date-picker" data-date-format="dd/mm/yyyy" data-placement="bottom" required>
 
										</div><label class="col-sm-1 control-label no-padding-right" for="form-field-1"> Gender</label>

										<div class="col-sm-1">
											  <select name="Gender" id="Gender" title="Select Student Gender" class="chosen-select form-control" required>
                                              <?php $Gender=$row['Gender']; ?>
	<option value="">Select</option>
	<option <?php if($Gender=='Male'){ ?> selected <?php } ?> value="Male">Male</option>
	<option <?php if($Gender=='Female'){ ?> selected <?php } ?>value="Female">Female</option>

</select>
										</div>
                                        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> Category  </label>

										<div class="col-sm-2">
											 <select name="Category" id="Category" title="Select Student Category" class="chosen-select form-control" required>
                                              <?php $Category=$row['Category']; ?>
	<option value="">Select</option>
	<option  <?php if($Category=='Gen'){ ?> selected <?php } ?>  value="Gen">Gen</option>
	<option <?php if($Category=='OBC'){ ?> selected <?php } ?>value="OBC">OBC</option>
	<option <?php if($Category=='SC'){ ?> selected <?php } ?>value="SC">SC</option>
	<option <?php if($Category=='ST'){ ?> selected <?php } ?>value="ST">ST</option>

</select>
										</div>

                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Sub Category </label>

										<div class="col-sm-2">
											 <select name="SubCategory" id="SubCategory" title="Select  Student Subcategory" class="chosen-select form-control" required>
                                             <?php $SubCategory=$row['SubCategory']; ?>
	<option value="">Select</option>
	<option <?php if($SubCategory=='Freedom Fighters'){ ?> selected <?php } ?> value="Freedom Fighters">Freedom Fighters</option>
	<option <?php if($SubCategory=='Ex. Service Man'){ ?> selected <?php } ?>value="Ex. Service Man">Ex. Service Man</option>
	<option <?php if($SubCategory=='Kashmiri Migrane'){ ?> selected <?php } ?>value="Kashmiri Migrane">Kashmiri Migrane</option>
	<option <?php if($SubCategory=='Military Personel'){ ?> selected <?php } ?>value="Military Personel">Military Personel</option>
	<option <?php if($SubCategory=='Physically handicaped'){ ?> selected <?php } ?>value="Physically handicaped">Physically handicaped</option>
	<option  <?php if($SubCategory=='Not Applicable'){ ?> selected <?php } ?>value="Not Applicable">Not Applicable</option>

</select>
										</div>
                                        
									</div>
                                    <div class="form-group">
										
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Religion  </label>

										<div class="col-sm-2">
											<select name="Religion" id="Religion" title="Select  Student Religion" class="chosen-select form-control" required>
                                            <?php $Religion=$row['Religion']; ?>
	<option value="">Select</option>
	<option <?php if($Religion=='Hinduism'){ ?> selected <?php } ?>value="Hinduism">Hinduism</option>
	<option <?php if($Religion=='Islam'){ ?> selected <?php } ?>value="Islam">Islam</option>
	<option <?php if($Religion=='Christianity'){ ?> selected <?php } ?>value="Christianity">Christianity</option>
	<option <?php if($Religion=='Sikhism'){ ?> selected <?php } ?>value="Sikhism">Sikhism</option>
	<option <?php if($Religion=='Buddhism'){ ?> selected <?php } ?>value="Buddhism">Buddhism</option>
	<option <?php if($Religion=='Jainism'){ ?> selected <?php } ?>value="Jainism">Jainism</option>
	<option <?php if($Religion=='Zoroastrianism'){ ?> selected <?php } ?>value="Zoroastrianism">Zoroastrianism</option>

</select>
										</div>

                                        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> Mobile No </label>

										<div class="col-sm-2">
											  <input name="MobileNO" type="text" value="<?php echo $row['MobileNO'];?>" maxlength="10" id="txtMobileNO" class="col-xs-12 col-sm-12" placeholder="Student Mobile Number" onChange="return aaa(this.value)" onKeyPress="return onlyNos(event,this);" title="Enter Student Mobile Number" required>
 
                                         
										</div>


                                         <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> Email ID </label>

										<div class="col-sm-4">
										 <input name="txtEmailID" type="text" value="<?php echo $row['txtEmailID'];?>" id="txtEmailID" class="col-xs-12 col-sm-12" placeholder="Student Email ID" data-toggle="tooltip" data-placement="bottom" title="Enter Student Email ID" required>
 
										</div>
									</div>
                                    
                                  
                                     <div class="page-header">
							<h1>
								Please Select Your Subject 
								
							</h1>
						</div>
                                    <div class="form-group">
										

								
                                        
                                     </div>   <div class="form-group">  <label class="col-sm-2 control-label no-padding-right" for="form-field-1">College Name </label>

										<div class="col-sm-10">
											  <?php
							if($btnSave3!=""){
					   
					   $college=$row['college'];
					   }
$queryy = "SELECT * FROM college_name where code='$college' and session='$session' and code='$code'";
$numresultsy=mysql_query($queryy);
$resulty= mysql_query($queryy) or die("Couldn't execute query");
?>
<select name="college" id="college"  onchange='this.form.submit()' class="chosen-select form-control" required> 


      
                                  <?php
while ( $a_roww = mysql_fetch_row( $resulty ) )
 {?>
                  <option
                 <?php 
				 $cn_id=$a_roww[2];
				 if($cn_id==$college){
				  ?>selected<?php } ?>
                  
                   value="<?php echo $a_roww[2];?>" ><?php echo $a_roww[1];?></option>
                  <?php } ?>
                </select>
										</div>
                                         
									</div>
                                    
                                    <div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Subject Name</label>
                                        </div> 
                                
                                
                             
                                
                                <div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1">  </label>
										<div class="col-sm-10">

                                            <div class="checkbox">
                                            <?php  
											
											
											$course_name=$a_row[2];
											$queryy = "SELECT * FROM subject where college_code='$college' and college_type='$CourseType' and course_name='$Course' and session='$session' and code='$code'";
$numresultsy=mysql_query($queryy);
$resulty= mysql_query($queryy) or die("Couldn't execute query");

//////////////////////////////////

$queryyn = "SELECT * FROM seme_year where college_id='$college' and college_type='$CourseType' and course_name='$Course' and sem_yer='$Course_Details' and session='$session' and code='$code'";
$numresultsyn=mysql_query($queryyn);
$resultyn= mysql_query($queryyn) or die("Couldn't execute query");
$a_rown = mysql_fetch_row( $resultyn );
$cv=$a_rown[3];
 ?>
 <script type="text/javascript">
function chkcontrol(j) {
var total=0;
for(var i=0; i < document.form1.ckb.length; i++){
if(document.form1.ckb[i].checked){
total =total +1;}
if(total > <?php echo $cv; ?>){
alert("Please Select only <?php echo $cv; ?>") 
document.form1.ckb[j].checked = false ;
return false;
}
}
} </script>
<style>
.tu li{ float:left; width:250px;}
</style>
												 
<ul class="tu">
	 <?php
	 $c=0;
while ( $a_roww = mysql_fetch_row( $resulty ) )
 {
 $s=$a_roww[1];
 ?>
                 <li><input type='checkbox' name='ckb[]' id="ckb" value='<?php echo $a_roww[1]; ?>' <?php if(in_array($s,$my_stored_game, true)){print "checked";}?> onclick='chkcontrol(<?php echo $c;?>)';><?php echo $a_roww[1];?></li>

                  <?php 
				  
				  $c++;
				  } ?>
				  

</ul>
											
						
		</div></div>
                                       
									</div>

                                
                                

                               	<div class="space-4"></div>
                                     

	
                                    
                                    <div class="page-header">
							<h1>
								Details of Previous Year  Examination
								
							</h1>
						</div>
                                    
                                    <div class="form-group">
										<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td>examination name</td>
    <td>school / college name</td>
    <td>board</td>
    <td>year</td>
    <td>roll no</td>
    <td>total marks</td>
    <td><strong>Marks Obtained</strong></td>
    <td>% or Grade</td>
    <td>subject</td>
  </tr>
  <tr>
    <td>high school</td>
    <td>
        <input type="text" name="cname" id="cname" placeholder='School / college name' value="<?php echo $row['cname'];?>" required>
   </td>
    <td><label>
      <input type="text" name="b" id="b" placeholder='Board' value="<?php echo $row['b'];?>" required>
    </label></td>
    <td><label>
      <input type="text" name="y" id="y" style="width:80px;"  placeholder='Passing Year' value="<?php echo $row['y'];?>" required>
    </label></td>
    <td><label>
      <input type="text" name="r" id="r" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r'];?>" required>
    </label></td>
    <td><label>
      <input type="text" name="tm" id="tm" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm'];?>" required>
    </label></td>
    <td><label>
      <input type="text" name="mo" id="mo" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo'];?>" required>
    </label></td>
    <td><label>
      <input type="text" name="g" id="g" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g'];?>">
    </label></td>
    <td><label>
      <textarea name="s" id="s" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s'];?></textarea>
    </label></td>
  </tr><?php if(($CourseType=='UG')&&($Course_Details=='I')||($CourseType=='UG')&&($Course_Details=='II')||($CourseType=='UG')&&($Course_Details=='III')||($CourseType=='PG')&&($Course_Details=='I')||($CourseType=='PG')&&($Course_Details=='II')){ ?>
  <tr>
    <td>inter</td>
    <td><input type="text" name="cname2" id="cname2" placeholder='School / college name' value="<?php echo $row['cname2'];?>" required></td>
    <td><input type="text" name="b2" id="b2"  placeholder='Board' value="<?php echo $row['b2'];?>" required></td>
    <td><input type="text" name="y2" id="y2" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y2'];?>" required></td>
    <td><input type="text" name="r2" id="r2" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r2'];?>" required></td>
    <td><input type="text" name="tm2" id="tm2" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm2'];?>" required></td>
    <td><input type="text" name="mo2" id="mo2" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo2'];?>" required></td>
    <td><input type="text" name="g2" id="g2" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g2'];?>" required></td>
    <td><textarea name="s2" id="s2" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s2'];?></textarea></td>
  </tr> <?php }
  
  if(($CourseType=='UG')&&($Course_Details=='II')||($CourseType=='UG')&&($Course_Details=='III')||($CourseType=='PG')&&($Course_Details=='I')||($CourseType=='PG')&&($Course_Details=='II')){ ?>
  
  <tr>
    <td>ug-i</td>
    <td><input type="text" name="cname3" id="cname3" placeholder='School / college name' value="<?php echo $row['cname3'];?>" required></td>
    <td><input type="text" name="b3" id="b3"  placeholder='Board' value="<?php echo $row['b3'];?>" required></td>
    <td><input type="text" name="y3" id="y3" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y3'];?>" required></td>
    <td><input type="text" name="r3" id="r3" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r3'];?>" required></td>
    <td><input type="text" name="tm3" id="tm3" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm3'];?>" required></td>
    <td><input type="text" name="mo3" id="mo3" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo3'];?>" required></td>
    <td><input type="text" name="g3" id="g3" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g3'];?>" required></td>
    <td><textarea name="s3" id="s3" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s3'];?></textarea></td>
  </tr>
 
  <?php }
  
  if(($CourseType=='UG')&&($Course_Details=='III')||($CourseType=='PG')&&($Course_Details=='I')||($CourseType=='PG')&&($Course_Details=='II')){ ?>
  <tr>
    <td>ug-ii</td>
    <td><input type="text" name="cname4" id="cname4" placeholder='School / college name' value="<?php echo $row['cname4'];?>" required></td>
    <td><input type="text" name="b4" id="b4"  placeholder='Board' value="<?php echo $row['b4'];?>" required></td>
    <td><input type="text" name="y4" id="y4" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y4'];?>" required></td>
    <td><input type="text" name="r4" id="r4" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r4'];?>" required></td>
    <td><input type="text" name="tm4" id="tm4" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm4'];?>"></td>
    <td><input type="text" name="mo4" id="mo4" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo4'];?>" required></td>
    <td><input type="text" name="g4" id="g4" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g4'];?>" required></td>
    <td><textarea name="s4" id="s4" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s4'];?></textarea></td>
  </tr>
   <?php }
  
  if(($CourseType=='PG')&&($Course_Details=='I')||($CourseType=='PG')&&($Course_Details=='II')){ ?>
  <tr>
    <td>ug-iii</td>
    <td><input type="text" name="cname5" id="cname5" placeholder='School / college name' value="<?php echo $row['cname5'];?>" required></td>
    <td><input type="text" name="b5" id="b5"  placeholder='Board' value="<?php echo $row['b5'];?>" required></td>
    <td><input type="text" name="y5" id="y5" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y5'];?>" required></td>
    <td><input type="text" name="r5" id="r5" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r5'];?>" required></td>
    <td><input type="text" name="tm5" id="tm5" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm5'];?>"></td>
    <td><input type="text" name="mo5" id="mo5" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo5'];?>" required></td>
    <td><input type="text" name="g5" id="g5" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g5'];?>" required></td>
    <td><textarea name="s5" id="s5" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s5'];?></textarea></td>
  </tr>
   <?php }
  
  if(($CourseType=='PG')&&($Course_Details=='II')){ ?>
  <tr>
    <td>pg-i</td>
    <td><input type="text" name="cname6" id="cname6" placeholder='School / college name' value="<?php echo $row['cname6'];?>" required></td>
    <td><input type="text" name="b6" id="b6"  placeholder='Board' value="<?php echo $row['b6'];?>" required></td>
    <td><input type="text" name="y6" id="y6" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y6'];?>" required></td>
    <td><input type="text" name="r6" id="r6" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r6'];?>" required></td>
    <td><input type="text" name="tm6" id="tm6" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm6'];?>" required></td>
    <td><input type="text" name="mo6" id="mo6" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo6'];?>"></td>
    <td><input type="text" name="g6" id="g6" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g6'];?>" required></td>
    <td><textarea name="s6" id="s6" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' required><?php echo $row['s6'];?></textarea></td>
  </tr>
    <?php } ?>
  <tr>
    <td>pg-ii</td>
    <td><input type="text" name="cname7" id="cname7" placeholder='School / college name' value="<?php echo $row['cname2'];?>" ></td>
    <td><input type="text" name="b7" id="b7"  placeholder='Board' value="<?php echo $row['b7'];?>" required></td>
    <td><input type="text" name="y7" id="y7" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y7'];?>" ></td>
    <td><input type="text" name="r7" id="r7" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r7'];?>" ></td>
    <td><input type="text" name="tm7" id="tm7" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm7'];?>" ></td>
    <td><input type="text" name="mo7" id="mo7" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo7'];?>" ></td>
    <td><input type="text" name="g7" id="g7" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g7'];?>" ></td>
    <td><textarea name="s7" id="s7" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' ><?php echo $row['s7'];?></textarea></td>
  </tr>
 
  <tr>
    <td>other</td>
    <td><input type="text" name="cname8" id="cname8" placeholder='School / college name' value="<?php echo $row['cname8'];?>" ></td>
    <td><input type="text" name="b8" id="b8"  placeholder='Board' value="<?php echo $row['b8'];?>" ></td>
    <td><input type="text" name="y8" id="y8" style="width:80px;" placeholder='Passing Year' value="<?php echo $row['y8'];?>" ></td>
    <td><input type="text" name="r8" id="r8" style="width:80px;" placeholder='Roll No' value="<?php echo $row['r8'];?>" ></td>
    <td><input type="text" name="tm8" id="tm8" style="width:80px;" placeholder='total marks' value="<?php echo $row['tm8'];?>" ></td>
    <td><input type="text" name="mo8" id="mo8" style="width:80px;" placeholder='MARKS OBTAINED' value="<?php echo $row['mo8'];?>" ></td>
    <td><input type="text" name="g8" id="g8" style="width:80px;" placeholder='% or Grade' value="<?php echo $row['g8'];?>" ></td>
    <td><textarea name="s8" id="s8" cols="25" rows="2" placeholder='Subject1,Subject2,Subject3...' ><?php echo $row['s8'];?></textarea></td>
  </tr>
</table>

									</div>
                                    
                                   

                                    
                                    <div class="page-header">
							<h1>
							Name and Mailing Address of Candidate  
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
								  (अभ्यर्थी का नाम व पत्राचार का पूरा पता)
								</small>
							</h1>
						</div>



                                      <div class="form-group">

                                         <label class="col-sm-2 control-label no-padding-right" for="form-field-1">  House No.</label>

										<div class="col-sm-2">
											     <input name="txtHouseNo" type="text" value="<?php echo $row['txtHouseNo'];?>" maxlength="100" id="txtHouseNo" placeholder="House No" class="col-xs-12 col-sm-12" required>
										</div>
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1">  Street/Village</label>

										<div class="col-sm-2">
											 <input name="txtStreet" type="text" value="<?php echo $row['txtStreet'];?>" maxlength="100" id="txtStreet" placeholder="Street/Village" class="col-xs-12 col-sm-12" required>
										</div>
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> Post Office</label>

										<div class="col-sm-2">
											     <input name="txtPostOffice" type="text" value="<?php echo $row['txtPostOffice'];?>" maxlength="100" id="txtPostOffice" placeholder=" Post Office" class="col-xs-12 col-sm-12" required>
										</div>
									</div>
                                       <div class="form-group">

                                         <label class="col-sm-2 control-label no-padding-right" for="form-field-1">  State</label>

										<div class="col-sm-2">
											    <input name="txtState" type="text" value="<?php echo $row['txtState'];?>" maxlength="15" id="txtState" placeholder="State" class="col-xs-12 col-sm-12" required>
										</div>
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1">  District/City </label>

										<div class="col-sm-2">
										<input name="txtDistrict0" type="text" value="<?php echo $row['txtDistrict0'];?>" maxlength="20" id="txtDistrict0" placeholder="District/City" class="col-xs-12 col-sm-12" required>	 
										</div>
                                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1">      Pin Code </label>

										<div class="col-sm-2">
											 <input name="txtPinCode" type="text" value="<?php echo $row['txtPinCode'];?>" maxlength="6" id="txtPinCode" placeholder="Pin Code" onKeyPress="return onlyNos(event,this);" class="col-xs-12 col-sm-12" required>   
										</div>
									</div>
                              
                                      <div class="page-header">
							<h1>
								Student Upload  Photo and Signature 
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
								  
								</small>
							</h1>
						</div>
                                    

                                    <div class="form-group">
										<label class="col-sm-4 control-label no-padding-right" for="form-field-1">  </label>

										<div class="col-sm-4">
											 <table width="50%" style="text-align:center;" class="table table-striped table-bordered table-hover">
                                                                                <tbody><tr>
                                                                                    <td width="45%">
        

                                                                                    
                                                                                    
                                                                                    
                                                                                        <strong><span lang="en-us" xml:lang="en-us"><span lang="en-us" xml:lang="en-us">Candidate
                                                                                            Photograph</span></span></strong> <span style="font-size: 12px; color: Red">*
                                                                                        </span>
                                                                                    </td>
                                                                                    <td width="55%">
                                                                                    
                                                                                   
                                                                                        <strong><span lang="en-us" xml:lang="en-us">Candidate Signature</span></strong>
                                                                                        <span style="font-size: 12px; color: Red">* </span>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td>
                                                                                     
                                                                                       <?php 

	class Uploader{
	public function photoUpload(){
		$path = 'uploads/';
		$file_ext   = array('jpg','png','gif','bmp','JPG');
		$post_ext   = end(explode('.',$_FILES['photo']['name']));
		$photo_name = $_FILES['photo']['name'];
		$photo_type = $_FILES['photo']['type'];
		$photo_size = $_FILES['photo']['size'];
		$photo_tmp  = $_FILES['photo']['tmp_name'];
		$photo_error= $_FILES['photo']['error'];
		//move_uploaded_file($photo_tmp,"uploads/".$photo_name);
		if((($photo_type == 'image/jpeg') || ($photo_type == 'image/gif')   ||
		   ($photo_type == 'image/png') || ($photo_type == 'image/pjpeg')) &&
		   ($photo_size < 5000000000) && in_array($post_ext,$file_ext)){
			if($photo_error > 0 ){
				echo 'Error '.$photo_error;
								exit;
			}else{
				//echo $photo_name.' Uploaded !';
				echo "$photo_name Uploaded!";
					
			}
			if(file_exists($path.$photo_name)){
				//echo 'There is '.$photo_name;
				echo "There is $photo_name!";
			}else{
				//new photo name and encryption
				$new_name = explode('.',$photo_name);
				$daten=date("YmdHis");
				$photo_imge=$daten."img".rand(10000,9999999);
				$photo_name = $photo_imge.md5($new_name[0]).'.'.$new_name[1];
				
				$fno=$_POST['fno'];
				$photo=$_POST['photo'];
				if($post_ext!=''){
$upd_qryc="UPDATE class2 SET class_std_ing='$photo_name' where fno='$fno' and session='$session' and code='$code'";
					mysql_query($upd_qryc); 
					}
				//move to directory
				
				
				if(move_uploaded_file($photo_tmp,$path.$photo_name)){

					return $photo_name;
				}
			}
		}
		elseif(isset($Register)){
					echo "The uploaded file has Over Size";
		}
	}

	public function resizejpeg($dir, $newdir, $img, $max_w, $max_h, $th_w, $th_h){
	    // set destination directory
	    if (!$newdir) $newdir = $dir;

	    // get original images width and height
	    list($or_w, $or_h, $or_t) = getimagesize($dir.$img);

	    // make sure image is a jpeg
	    if ($or_t == 2) {

	        // obtain the image's ratio
	        $ratio = ($or_h / $or_w);

	        // original image
	        $or_image = imagecreatefromjpeg($dir.$img);

	        // resize image?
	        if ($or_w > $max_w || $or_h > $max_h) {

	            // resize by height, then width (height dominant)
	            if ($max_h < $max_w) {
	                $rs_h = $max_h;
	                $rs_w = $rs_h / $ratio;
	            }
	            // resize by width, then height (width dominant)
	            else {
	                $rs_w = $max_w;
	                $rs_h = $ratio * $rs_w;
	            }

	            // copy old image to new image
	            $rs_image = imagecreatetruecolor($rs_w, $rs_h);
	            imagecopyresampled($rs_image, $or_image, 0, 0, 0, 0, $rs_w, $rs_h, $or_w, $or_h);
	        }
	        // image requires no resizing
	        else {
	            $rs_w = $or_w;
	            $rs_h = $or_h;

	            $rs_image = $or_image;
	        }

	        // generate resized image
	        imagejpeg($rs_image, $newdir.$img, 100);

	        $th_image = imagecreatetruecolor($th_w, $th_h);

	        // cut out a rectangle from the resized image and store in thumbnail
	        $new_w = (($rs_w / 2) - ($th_w / 2));
	        $new_h = (($rs_h / 2) - ($th_h / 2));

	        imagecopyresized($th_image, $rs_image, 0, 0, $new_w, $new_h, $rs_w, $rs_h, $rs_w, $rs_h);

	        // generate thumbnail
	        imagejpeg($th_image, $newdir.''.$img, 100);

	        return true;
	    } 

	    // Image type was not jpeg!
	    else {
	        return false;
	    }
     }
  public function dumpPhoto($thumb,$dir){
  	$thumb = ''.$thumb;
		$img   = $dir.$thumb;
		$dump  = "<img src='$img' height='100' width='100' />";
		return $dump;
	}
}	
$upload = new Uploader();
		$size    = 5000000000;
	$dir =   'uploads/';
	$newdir= 'resized/';
	$img = $upload->photoUpload();
	$max_w = 150;
	$max_h = 150;
	$th_w = 100;
	$th_h = 100;
	$upload->resizejpeg($dir, $newdir, $img, $max_w, $max_h, $th_w, $th_h);
 
	
	
?><?php $class_std_ing=$row["class_std_ing"]; if($class_std_ing!=""){ echo '<div class="thumb" style="float:left;">';?><img src='uploads/<?php echo $class_std_ing; ?>' height='100' width='100' /> <?php echo '</div>'; }else{  echo '<div class="thumb" style="float:left;">';
		echo $upload->dumpPhoto($img,$newdir);
		echo '</div>';
		}?>

<script src="jquery.min.js"></script>
   <div style="float:left; text-align:left "><div id='form1_photo_errorloc' class="error_strings"></div><strong> Upload Pasport Size Photograph : <br /> <p style="color:#FF0000"><strong>Max File Size : 50 KB</strong></p> </strong><input type="file" name="photo" value="browse" id="photo" /></div>
                                                                                    </td>
                                                                                    <td>
                                                                                      <?php 
	
	class Uploader_sig{
	public function photoUpload_sig(){
		$path_sig = 'uploads_sig/';
		$file_ext_sig   = array('jpg','png','gif','bmp','JPG');
		$post_ext_sig   = end(explode('.',$_FILES['photo_sign']['name']));
		$photo_name_sig = $_FILES['photo_sign']['name'];
		$photo_type_sig = $_FILES['photo_sign']['type'];
		$photo_size_sig = $_FILES['photo_sign']['size'];
		$photo_tmp_sig  = $_FILES['photo_sign']['tmp_name'];
		$photo_error_sig= $_FILES['photo_sign']['error'];
		//move_uploaded_file($photo_tmp,"uploads/".$photo_name);
		if((($photo_type_sig == 'image/jpeg') || ($photo_type_sig == 'image/gif')   ||
		   ($photo_type_sig == 'image/png') || ($photo_type_sig == 'image/pjpeg')) &&
		   ($photo_size_sig < 5000000000) && in_array($post_ext_sig,$file_ext_sig)){
			if($photo_error_sig > 0 ){
				echo 'Error '.$photo_error_sig;
				exit;
			}else{
				//echo $photo_name_sig.' Uploaded !';
				echo "$photo_name_sig Uploaded!";
					
			}
			if(file_exists($path_sig.$photo_name_sig)){
				echo 'There is '.$photo_name_sig;
			}else{
				//new photo name and encryption
				$new_name_sig = explode('.',$photo_name_sig);
				$datens=date("YmdHis");
				$photo_imgs=$datens."img".rand(10000,9999999);
				$photo_name_sig = $photo_imgs.md5($new_name_sig[0]).'.'.$new_name_sig[1];
				$fno=$_POST['fno'];
				$photo_sign=$_POST['photo_sign'];
				if($post_ext_sig!=''){
				
$upd_qryc_sig="UPDATE class2 SET class_std_ing_sig='$photo_name_sig' where fno='$fno' and session='$session' and code='$code'";
					mysql_query($upd_qryc_sig); 
					}
					
				//move to directory
				if(move_uploaded_file($photo_tmp_sig,$path_sig.$photo_name_sig)){

					return $photo_name_sig;
				}
			}
		}
		elseif(isset($Register))
{
			echo "The uploaded file has Over Size";
		}
	}

	public function resizejpeg_sig($dir_sig, $newdir_sig, $img_sig, $max_w_sig, $max_h_sig, $th_w_sig, $th_h_sig){
	    // set destination directory
	    if (!$newdir_sig) $newdir_sig = $dir_sig;

	    // get original images width and height
	    list($or_w_sig, $or_h_sig, $or_t_sig) = getimagesize($dir_sig.$img_sig);

	    // make sure image is a jpeg
	    if ($or_t_sig == 2) {

	        // obtain the image's ratio
	        $ratio_sig = ($or_h_sig / $or_w_sig);

	        // original image
	        $or_image_sig = imagecreatefromjpeg($dir_sig.$img_sig);

	        // resize image?
	        if ($or_w_sig > $max_w_sig || $or_h_sig > $max_h_sig) {

	            // resize by height, then width (height dominant)
	            if ($max_h_sig < $max_w_sig) {
	                $rs_h_sig = $max_h_sig;
	                $rs_w_sig = $rs_h_sig / $ratio_sig;
	            }
	            // resize by width, then height (width dominant)
	            else {
	                $rs_w_sig = $max_w_sig;
	                $rs_h_sig = $ratio_sig * $rs_w_sig;
	            }

	            // copy old image to new image
	            $rs_image_sig = imagecreatetruecolor($rs_w_sig, $rs_h_sig);
	            imagecopyresampled($rs_image_sig, $or_image_sig, 0, 0, 0, 0, $rs_w_sig, $rs_h_sig, $or_w_sig, $or_h_sig);
	        }
	        // image requires no resizing
	        else {
	            $rs_w_sig = $or_w_sig;
	            $rs_h_sig = $or_h_sig;

	            $rs_image_sig = $or_image_sig;
	        }

	        // generate resized image
	        imagejpeg($rs_image_sig, $newdir_sig.$img_sig, 100);

	        $th_image = imagecreatetruecolor($th_w_sig, $th_h_sig);

	        // cut out a rectangle from the resized image and store in thumbnail
	        $new_w_sig = (($rs_w_sig / 2) - ($th_w_sig / 2));
	        $new_h_sig = (($rs_h_sig / 2) - ($th_h_sig / 2));

	        imagecopyresized($th_image_sig, $rs_image_sig, 0, 0, $new_w_sig, $new_h_sig, $rs_w_sig, $rs_h_sig, $rs_w_sig, $rs_h_sig);

	        // generate thumbnail
	        imagejpeg($th_image_sig, $newdir_sig.''.$img_sig, 100);

	        return true;
	    } 

	    // Image type was not jpeg!
	    else {
	        return false;
	    }

     }
  public function dumpPhoto_sig($thumb_sig,$dir_sig){
  	$thumb_sig = ''.$thumb_sig;
		$img_sig   = $dir_sig.$thumb_sig;
		$dump_sig  = "<img src='$img_sig' height=100 width=100/>";
		return $dump_sig;
	}
}	
$upload_sig = new Uploader_sig();
		$size_sig    = 5000000000;
	$dir_sig =   'uploads_sig/';
	$newdir_sig= 'resized_sig/';
	$img_sig = $upload_sig->photoUpload_sig();
	$max_w_sig = 250;
	$max_h_sig = 250;
	$th_w_sig = 200;
	$th_h_sig = 200;
	$upload_sig->resizejpeg_sig($dir_sig, $newdir_sig, $img_sig, $max_w_sig, $max_h_sig, $th_w_sig, $th_h_sig);
 

	
?><?php $class_std_ing_sig=$row["class_std_ing_sig"]; if($class_std_ing_sig!=""){ echo '<div class="thumb" style="float:left;">';?><img src='uploads_sig/<?php echo $class_std_ing_sig; ?>' height='100' width='100' /> <?php echo '</div>'; }else{  echo '<div class="thumb" style="float:left;">';
	echo $upload_sig->dumpPhoto_sig($img_sig,$newdir_sig);
		echo '</div>';
		}?>

<script src="jquery.min.js"></script><div id='form1_photo_sign_errorloc' class="error_strings"></div>
  <div style="float:left; height:200px; "> <strong> Upload Your Signature Photograph : <br /><p style="color:#FF0000"><strong>Max File Size : 50 KB</strong></p> </strong><input type="file" name="photo_sign" value="browse_sign" id="photo_sign" > 

                                                                                    </td>
                                                                                </tr>
                                                                            </tbody></table>
										</div>
                                     
									</div>


                                

                                     

									<div class="space-4"></div>
                                     

									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">

                                                        <input type="submit" name="btnSave2" value="Save" style="font-size:28px;margin-left:30%">

                                          
										</div>
									</div>

									 
							

								 
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

			

		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="./reg_2_files/jquery.2.1.1.min.js.download"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="assets/js/jquery.1.11.1.min.js"></script>
<![endif]-->

		<!--[if !IE]> -->
		<script type="text/javascript">
		    window.jQuery || document.write("<script src='assets/js/jquery.min.js'>" + "<" + "/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
		<script type="text/javascript">
		    if ('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script><script src="./reg_2_files/jquery.mobile.custom.min.js.download"></script>
		<script src="./reg_2_files/bootstrap.min.js.download"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="./reg_2_files/jquery-ui.custom.min.js.download"></script>
		<script src="./reg_2_files/jquery.ui.touch-punch.min.js.download"></script>
		<script src="./reg_2_files/chosen.jquery.min.js.download"></script>
		<script src="./reg_2_files/fuelux.spinner.min.js.download"></script>
		<script src="./reg_2_files/bootstrap-datepicker.min.js.download"></script>
		<script src="./reg_2_files/bootstrap-timepicker.min.js.download"></script>
		<script src="./reg_2_files/moment.min.js.download"></script>
		<script src="./reg_2_files/daterangepicker.min.js.download"></script>
		<script src="./reg_2_files/bootstrap-datetimepicker.min.js.download"></script>
		<script src="./reg_2_files/bootstrap-colorpicker.min.js.download"></script>
		<script src="./reg_2_files/jquery.knob.min.js.download"></script>
		<script src="./reg_2_files/jquery.autosize.min.js.download"></script>
		<script src="./reg_2_files/jquery.inputlimiter.1.3.1.min.js.download"></script>
		<script src="./reg_2_files/jquery.maskedinput.min.js.download"></script>
		<script src="./reg_2_files/bootstrap-tag.min.js.download"></script>

		<!-- ace scripts -->
		<script src="./reg_2_files/ace-elements.min.js.download"></script>
		<script src="./reg_2_files/ace.min.js.download"></script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
		    jQuery(function ($) {
		        $('#id-disable-check').on('click', function () {
		            var inp = $('#form-input-readonly').get(0);
		            if (inp.hasAttribute('disabled')) {
		                inp.setAttribute('readonly', 'true');
		                inp.removeAttribute('disabled');
		                inp.value = "This text field is readonly!";
		            }
		            else {
		                inp.setAttribute('disabled', 'disabled');
		                inp.removeAttribute('readonly');
		                inp.value = "This text field is disabled!";
		            }
		        });


		        if (!ace.vars['touch']) {
		            $('.chosen-select').chosen({ allow_single_deselect: true });
		            //resize the chosen on window resize

		            $(window)
					.off('resize.chosen')
					.on('resize.chosen', function () {
					    $('.chosen-select').each(function () {
					        var $this = $(this);
					        $this.next().css({ 'width': $this.parent().width() });
					    })
					}).trigger('resize.chosen');
		            //resize chosen on sidebar collapse/expand
		            $(document).on('settings.ace.chosen', function (e, event_name, event_val) {
		                if (event_name != 'sidebar_collapsed') return;
		                $('.chosen-select').each(function () {
		                    var $this = $(this);
		                    $this.next().css({ 'width': $this.parent().width() });
		                })
		            });


		            $('#chosen-multiple-style .btn').on('click', function (e) {
		                var target = $(this).find('input[type=radio]');
		                var which = parseInt(target.val());
		                if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
		                else $('#form-field-select-4').removeClass('tag-input-style');
		            });
		        }


		        $('[data-rel=tooltip]').tooltip({ container: 'body' });
		        $('[data-rel=popover]').popover({ container: 'body' });

		        $('textarea[class*=autosize]').autosize({ append: "\n" });
		        $('textarea.limited').inputlimiter({
		            remText: '%n character%s remaining...',
		            limitText: 'max allowed : %n.'
		        });

		        $.mask.definitions['~'] = '[+-]';
		        $('.input-mask-date').mask('99/99/9999');
		        $('.input-mask-phone').mask('(999) 999-9999');
		        $('.input-mask-eyescript').mask('~9.99 ~9.99 999');
		        $(".input-mask-product").mask("a*-999-a999", { placeholder: " ", completed: function () { alert("You typed the following: " + this.val()); } });



		        $("#input-size-slider").css('width', '200px').slider({
		            value: 1,
		            range: "min",
		            min: 1,
		            max: 8,
		            step: 1,
		            slide: function (event, ui) {
		                var sizing = ['', 'input-sm', 'input-lg', 'input-mini', 'input-small', 'input-medium', 'input-large', 'input-xlarge', 'input-xxlarge'];
		                var val = parseInt(ui.value);
		                $('#form-field-4').attr('class', sizing[val]).val('.' + sizing[val]);
		            }
		        });

		        $("#input-span-slider").slider({
		            value: 1,
		            range: "min",
		            min: 1,
		            max: 12,
		            step: 1,
		            slide: function (event, ui) {
		                var val = parseInt(ui.value);
		                $('#form-field-5').attr('class', 'col-xs-' + val).val('.col-xs-' + val);
		            }
		        });



		        //"jQuery UI Slider"
		        //range slider tooltip example
		        $("#slider-range").css('height', '200px').slider({
		            orientation: "vertical",
		            range: true,
		            min: 0,
		            max: 100,
		            values: [17, 67],
		            slide: function (event, ui) {
		                var val = ui.values[$(ui.handle).index() - 1] + "";

		                if (!ui.handle.firstChild) {
		                    $("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
							.prependTo(ui.handle);
		                }
		                $(ui.handle.firstChild).show().children().eq(1).text(val);
		            }
		        }).find('span.ui-slider-handle').on('blur', function () {
		            $(this.firstChild).hide();
		        });


		        $("#slider-range-max").slider({
		            range: "max",
		            min: 1,
		            max: 10,
		            value: 2
		        });

		        $("#slider-eq > span").css({ width: '90%', 'float': 'left', margin: '15px' }).each(function () {
		            // read initial values from markup and remove that
		            var value = parseInt($(this).text(), 10);
		            $(this).empty().slider({
		                value: value,
		                range: "min",
		                animate: true

		            });
		        });

		        $("#slider-eq > span.ui-slider-purple").slider('disable');//disable third item


		        $('#id-input-file-1 , #id-input-file-2').ace_file_input({
		            no_file: 'No File ...',
		            btn_choose: 'Choose',
		            btn_change: 'Change',
		            droppable: false,
		            onchange: null,
		            thumbnail: false //| true | large
		            //whitelist:'gif|png|jpg|jpeg'
		            //blacklist:'exe|php'
		            //onchange:''
		            //
		        });
		        //pre-show a file name, for example a previously selected file
		        //$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])


		        $('#id-input-file-3').ace_file_input({
		            style: 'well',
		            btn_choose: 'Drop files here or click to choose',
		            btn_change: null,
		            no_icon: 'ace-icon fa fa-cloud-upload',
		            droppable: true,
		            thumbnail: 'small'//large | fit
		            //,icon_remove:null//set null, to hide remove/reset button
		            /**,before_change:function(files, dropped) {
						//Check an example below
						//or examples/file-upload.html
						return true;
					}*/
		            /**,before_remove : function() {
						return true;
					}*/
					,
		            preview_error: function (filename, error_code) {
		                //name of the file that failed
		                //error_code values
		                //1 = 'FILE_LOAD_FAILED',
		                //2 = 'IMAGE_LOAD_FAILED',
		                //3 = 'THUMBNAIL_FAILED'
		                //alert(error_code);
		            }

		        }).on('change', function () {
		            //console.log($(this).data('ace_input_files'));
		            //console.log($(this).data('ace_input_method'));
		        });


		        //$('#id-input-file-3')
		        //.ace_file_input('show_file_list', [
		        //{type: 'image', name: 'name of image', path: 'http://path/to/image/for/preview'},
		        //{type: 'file', name: 'hello.txt'}
		        //]);




		        //dynamically change allowed formats by changing allowExt && allowMime function
		        $('#id-file-format').removeAttr('checked').on('change', function () {
		            var whitelist_ext, whitelist_mime;
		            var btn_choose
		            var no_icon
		            if (this.checked) {
		                btn_choose = "Drop images here or click to choose";
		                no_icon = "ace-icon fa fa-picture-o";

		                whitelist_ext = ["jpeg", "jpg", "png", "gif", "bmp"];
		                whitelist_mime = ["image/jpg", "image/jpeg", "image/png", "image/gif", "image/bmp"];
		            }
		            else {
		                btn_choose = "Drop files here or click to choose";
		                no_icon = "ace-icon fa fa-cloud-upload";

		                whitelist_ext = null;//all extensions are acceptable
		                whitelist_mime = null;//all mimes are acceptable
		            }
		            var file_input = $('#id-input-file-3');
		            file_input
					.ace_file_input('update_settings',
					{
					    'btn_choose': btn_choose,
					    'no_icon': no_icon,
					    'allowExt': whitelist_ext,
					    'allowMime': whitelist_mime
					})
		            file_input.ace_file_input('reset_input');

		            file_input
					.off('file.error.ace')
					.on('file.error.ace', function (e, info) {
					    //console.log(info.file_count);//number of selected files
					    //console.log(info.invalid_count);//number of invalid files
					    //console.log(info.error_list);//a list of errors in the following format

					    //info.error_count['ext']
					    //info.error_count['mime']
					    //info.error_count['size']

					    //info.error_list['ext']  = [list of file names with invalid extension]
					    //info.error_list['mime'] = [list of file names with invalid mimetype]
					    //info.error_list['size'] = [list of file names with invalid size]


					    /**
						if( !info.dropped ) {
							//perhapse reset file field if files have been selected, and there are invalid files among them
							//when files are dropped, only valid files will be added to our file array
							e.preventDefault();//it will rest input
						}
						*/


					    //if files have been selected (not dropped), you can choose to reset input
					    //because browser keeps all selected files anyway and this cannot be changed
					    //we can only reset file field to become empty again
					    //on any case you still should check files with your server side script
					    //because any arbitrary file can be uploaded by user and it's not safe to rely on browser-side measures
					});

		        });

		        $('#spinner1').ace_spinner({ value: 0, min: 0, max: 200, step: 10, btn_up_class: 'btn-info', btn_down_class: 'btn-info' })
				.closest('.ace-spinner')
				.on('changed.fu.spinbox', function () {
				    //alert($('#spinner1').val())
				});
		        $('#spinner2').ace_spinner({ value: 0, min: 0, max: 10000, step: 100, touch_spinner: true, icon_up: 'ace-icon fa fa-caret-up bigger-110', icon_down: 'ace-icon fa fa-caret-down bigger-110' });
		        $('#spinner3').ace_spinner({ value: 0, min: -100, max: 100, step: 10, on_sides: true, icon_up: 'ace-icon fa fa-plus bigger-110', icon_down: 'ace-icon fa fa-minus bigger-110', btn_up_class: 'btn-success', btn_down_class: 'btn-danger' });
		        $('#spinner4').ace_spinner({ value: 0, min: -100, max: 100, step: 10, on_sides: true, icon_up: 'ace-icon fa fa-plus', icon_down: 'ace-icon fa fa-minus', btn_up_class: 'btn-purple', btn_down_class: 'btn-purple' });

		        //$('#spinner1').ace_spinner('disable').ace_spinner('value', 11);
		        //or
		        //$('#spinner1').closest('.ace-spinner').spinner('disable').spinner('enable').spinner('value', 11);//disable, enable or change value
		        //$('#spinner1').closest('.ace-spinner').spinner('value', 0);//reset to 0


		        //datepicker plugin
		        //link
		        $('.date-picker').datepicker({
		            autoclose: true,
		            todayHighlight: true
		        })
				//show datepicker when clicking on the icon
				.next().on(ace.click_event, function () {
				    $(this).prev().focus();
				});

		        //or change it into a date range picker
		        $('.input-daterange').datepicker({ autoclose: true });


		        //to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization
		        $('input[name=date-range-picker]').daterangepicker({
		            'applyClass': 'btn-sm btn-success',
		            'cancelClass': 'btn-sm btn-default',
		            locale: {
		                applyLabel: 'Apply',
		                cancelLabel: 'Cancel',
		            }
		        })
				.prev().on(ace.click_event, function () {
				    $(this).next().focus();
				});


		        $('#timepicker1').timepicker({
		            minuteStep: 1,
		            showSeconds: true,
		            showMeridian: false
		        }).next().on(ace.click_event, function () {
		            $(this).prev().focus();
		        });

		        $('#date-timepicker1').datetimepicker().next().on(ace.click_event, function () {
		            $(this).prev().focus();
		        });


		        $('#colorpicker1').colorpicker();

		        $('#simple-colorpicker-1').ace_colorpicker();
		        //$('#simple-colorpicker-1').ace_colorpicker('pick', 2);//select 2nd color
		        //$('#simple-colorpicker-1').ace_colorpicker('pick', '#fbe983');//select #fbe983 color
		        //var picker = $('#simple-colorpicker-1').data('ace_colorpicker')
		        //picker.pick('red', true);//insert the color if it doesn't exist


		        $(".knob").knob();


		        var tag_input = $('#form-field-tags');
		        try {
		            tag_input.tag(
					  {
					      placeholder: tag_input.attr('placeholder'),
					      //enable typeahead by specifying the source array
					      source: ace.vars['US_STATES'],//defined in ace.js >> ace.enable_search_ahead
					      /**
                          //or fetch data from database, fetch those that match "query"
                          source: function(query, process) {
                            $.ajax({url: 'remote_source.php?q='+encodeURIComponent(query)})
                            .done(function(result_items){
                              process(result_items);
                            });
                          }
                          */
					  }
					)

		            //programmatically add a new
		            var $tag_obj = $('#form-field-tags').data('tag');
		            $tag_obj.add('Programmatically Added');
		        }
		        catch (e) {
		            //display a textarea for old IE, because it doesn't support this plugin or another one I tried!
		            tag_input.after('<textarea id="' + tag_input.attr('id') + '" name="' + tag_input.attr('name') + '" rows="3">' + tag_input.val() + '</textarea>').remove();
		            //$('#form-field-tags').autosize({append: "\n"});
		        }


		        /////////
		        $('#modal-form input[type=file]').ace_file_input({
		            style: 'well',
		            btn_choose: 'Drop files here or click to choose',
		            btn_change: null,
		            no_icon: 'ace-icon fa fa-cloud-upload',
		            droppable: true,
		            thumbnail: 'large'
		        })

		        //chosen plugin inside a modal will have a zero width because the select element is originally hidden
		        //and its width cannot be determined.
		        //so we set the width after modal is show
		        $('#modal-form').on('shown.bs.modal', function () {
		            if (!ace.vars['touch']) {
		                $(this).find('.chosen-container').each(function () {
		                    $(this).find('a:first-child').css('width', '210px');
		                    $(this).find('.chosen-drop').css('width', '210px');
		                    $(this).find('.chosen-search input').css('width', '200px');
		                });
		            }
		        })
		        /**
				//or you can activate the chosen plugin after modal is shown
				//this way select element becomes visible with dimensions and chosen works as expected
				$('#modal-form').on('shown', function () {
					$(this).find('.modal-chosen').chosen();
				})
				*/



		        $(document).one('ajaxloadstart.page', function (e) {
		            $('textarea[class*=autosize]').trigger('autosize.destroy');
		            $('.limiterBox,.autosizejs').remove();
		            $('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu').remove();
		        });

		    });
		</script>
                <script type="text/javascript">
                    function totmarks(tot) {
                        var year = $('#ddlYear').find(":selected").text();
                        var type = $('#ddl_StudentType').find(":selected").text();
                     
                        var totmarks = $("#txtMarks").val();
                        if ((year == 'B.A. (Part-Three)' && type == 'Regular')  || (year == 'B.A. (Part-Three)' && type == 'Private')) {
                            if (totmarks != '1200') {
                                $('#txtMarks').val('');
                                alert("Maximum Marks must be 1200");
                                $("#txtMarks").focus();
                            }
                        }
                        if ((year == 'B.A. (Part-Two)' && type == 'Regular')  || (year == 'B.A. (Part-Two)' && type == 'Private')) {
                            if (totmarks != '600') {
                                $('#txtMarks').val('');
                                alert("Maximum Marks must be 600");
                                $("#txtMarks").focus();
                            }
                        }



                    }
                </script>
                <script type="text/javascript">
                    function fcalPercenatge(src) {
                        var year = $('#ddlYear').find(":selected").text();
                        var type = $('#ddl_StudentType').find(":selected").text();
                        var totmarks =parseInt($("#txtMarks").val());
                        var obtMarks =parseInt($("#txtObtained").val());
                        if (src == 1) {
                            if ((year == 'B.A. (Part-Three)' && type == 'Regular') || (year == 'B.A. (Part-Three)' && type == 'Private')) {
                                if (obtMarks > totmarks) {
                                    alert("Obtain Marks can not be greater than Total Marks")
                                    $('#txtObtained').val('');
                                    $("#txtObtained").focus();
                                }
                                if (obtMarks <='395') {
                                    alert("Obtain Marks must be greater than 395")
                                    $('#txtObtained').val('');
                                    $("#txtObtained").focus();
                                }
                            }
                            if ((year == 'B.A. (Part-Two)' && type == 'Regular') || (year == 'B.A. (Part-Two)' && type == 'Private')) {
                                if (obtMarks > totmarks) {
                                    alert("Obtain Marks can not be greater than Total Marks")
                                    $('#txtObtained').val('');
                                    $("#txtObtained").focus();
                                }
                                if (obtMarks <= '197') {
                                    alert("Obtain Marks must be greater than 197")
                                    $('#txtObtained').val('');
                                    $("#txtObtained").focus();
                                }
                            }

                        }

                    }
                </script>

                <script type="text/javascript">
                    function aaa(tot) {
                        var mob = /^[7-9]{1}[0-9]{9}$/;
                        var txtMobile = document.getElementById("txtMobileNO");
                        if (mob.test(txtMobile.value) == false) {
                            alert("Please enter valid mobile number.");
                            $('#txtMobileNO').val('');
                            txtMobile.focus();
                            return false;
                        }
                        else {
                            return true;
                        }



                    }
                </script>
                 
  <script language="Javascript" type="text/javascript">

      function CheckYear() {


          if (document.getElementById("txtYear").value != "") {

              var OBT = parseInt(txtYear.value);

              var x = new Date();
              var n = x.getFullYear();


              if (OBT > n) {
                  alert("You have enter current Year");
                  return false;
              }


          }
      }

      function IsMobileNumber(mob) {
          debugger
          var mob = /^[7-9]{1}[0-9]{9}$/;
          var txtMobile = document.getElementById("txtMobileNO");
                               if (mob.test(txtMobile.value) == false) {
                                   alert("Please enter valid mobile number.");
                                   txtMobile.focus();
                                   return false;
                               }
                               else {
                                   return true;
                               }
                           }

      function onlyNos(e, t) {

          try {

              if (window.event) {

                  var charCode = window.event.keyCode;

              }

              else if (e) {

                  var charCode = e.which;

              }

              else { return true; }

              if (charCode > 31 && (charCode < 48 || charCode > 57)) {

                  return false;

              }

              return true;

          }

          catch (err) {

              alert(err.Description);

          }

      }


      function checkEmail() {

          var email = document.getElementById('txtEmail');
          var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

          if (!filter.test(email.value)) {
              alert('Please provide a valid email address');
              email.focus;
              return false;
          }
      }

      







    </script>

        <script language="Javascript" type="text/javascript">
        

      function fvalidateSubjectCount() {
          var chk_Subect_List = document.getElementById("chk_Subect_List");
          var chkArr = chk_Subect_List.getElementsByTagName('input');
          var maxCount = 3;///document.getElementById("hndSubjectCount");
          var maxCount1 = document.getElementById("ddlYear").value
          var maxCount1 = document.getElementById("ddlYear").value
          var maxCount2 = document.getElementById("ddl_StudentType").value

          if (maxCount1 == 4)
          { maxCount = 2; }
          if (maxCount2 == 3)
          { maxCount = 1; }

         
          var Count = 0;
          for (var i = 0; i < chkArr.length; i++) {
              if (chkArr[i].type == "checkbox" && chkArr[i].checked == true) {
                  Count++;
              }
          }

          if (Count > maxCount) {
              alert('Youc can select only ' + maxCount.toString() + ' subject');
              Count = 0;
              for (var i = 0; i < chkArr.length; i++) {
                  if (chkArr[i].type == "checkbox" && chkArr[i].checked == true) {
                      Count++;
                      if (Count > maxCount) {
                          chkArr[i].checked = false;
                      }

                  }
              }

          }
      } </script>


                   <script language="Javascript" type="text/javascript">
                       function validate() {

                         
                         
                if (document.getElementById("ddlYear").value == "0") {
               alert("Please Select Couser Year(Part)");
               document.getElementById("ddlYear").focus();
                    return false;


                }

                if (document.getElementById("ddl_StudentType").value == "0") {
               alert("Please Select Candidate Type");
               document.getElementById("ddl_StudentType").focus();
                    return false;
                }
                if (document.getElementById("txt_StudentName").value == "") {
               alert("Please Enter Candidate Name");
               document.getElementById("txt_StudentName").focus();
                    return false;
                }
                if (document.getElementById("txtFatherName").value == "") {
               alert("Please Enter Candidate Father Name");
               document.getElementById("txtFatherName").focus();
                    return false;
                }
                if (document.getElementById("txtMotherName").value == "") {
               alert("Please Enter Candidate Mother Name");
               document.getElementById("txtMotherName").focus();
                    return false;
                }
                if (document.getElementById("ddlCollegeName").value == "0") {
               alert("Please Select Collge Name Type");
               document.getElementById("ddlCollegeName").focus();
                    return false;
                }
                if (document.getElementById("txt_dob").value == "") {
               alert("Please Enter Candidate Date Of Brith");
               document.getElementById("txt_dob").focus();
                    return false;

                }








                if (document.getElementById("ddl_Gender").value == "0") {
               alert("Please Select Candidate Gender");
               document.getElementById("ddl_Gender").focus();
                    return false;
                }
                if (document.getElementById("ddlCategory").value == "0") {
               alert("Please Select Candidate Category");
               document.getElementById("ddlCategory").focus();
                    return false;
                }


                           if (document.getElementById("ddlSubCategory").value == "0") {
                               alert("Please Select Candidate Subcategory");
                               document.getElementById("ddlSubCategory").focus();
               return false;
                           }



                           if (document.getElementById("ddlReligion").value == "0") {
                               alert("Please Select Candidate Religoin");
                               document.getElementById("ddlReligion").focus();
               return false;
           }
                       
                           if (document.getElementById("txtMobileNO").value == "") {
                               alert("Please Enter Candidate Mobile Number");
                               document.getElementById("txtMobileNO").focus();
               return false;
                           }
                           else if (document.getElementById("txtMobileNO").value != "") {
                               debugger
                               var mob = document.getElementById("txtMobileNO").value;
                               if (mob != "") {
                                   return IsMobileNumber(mob);
                               }
                           }
           if (document.getElementById("txtMobileNO").value != "") {

               var textField = document.getElementById("txtMobileNO");
                    var length = textField.value.length;
                    if (length != 10) {
                        alert("Mobile No is Invaild.");
                        document.getElementById("txtMobileNO").focus();

                        return false;
                    }
                }
                if (document.getElementById("txtEmailID").value != "") {
               //        var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
               var emailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
               var emailid = document.getElementById("txtEmailID").value;
                    var matchArray = emailid.match(emailPat);
                    if (matchArray == null) {
                        alert("Your email address seems incorrect. Please try again.");
                        document.getElementById("txtEmailID").focus();
                        return false;
                    }
                }


                           if (document.getElementById("ddlCollegeName").value == "0") {
                               alert("Please Select College Name");
                               document.getElementById("ddlCollegeName").focus();
               return false;
           }


                if (document.getElementById("txtExamination").value == "") {
               alert("Candidate Please Fill Previous Year  Examination Details");
               document.getElementById("txtExamination").focus();
                    return false;
                }
                if (document.getElementById("txtYear").value == "") {
               alert("Candidate Please Fill Previous Year  Examination Details");
               document.getElementById("txtYear").focus();
                    return false;
                }

                           if (document.getElementById("txtCollegeName").value == "") {
                               alert("Candidate Please Fill Previous BOARD / UNIVERSITY NAME  ExaminationDetails");
                               document.getElementById("txtCollegeName").focus();
               return false;
           }
                if (document.getElementById("txtRollNo").value == "") {
               alert("Candidate Please Fill Previous Roll Number  ExaminationDetails");
               document.getElementById("txtRollNo").focus();
                    return false;
                }
               
                if (document.getElementById("txtObtained").value == "") {
                    alert("Candidate Please Fill Previous Obtained Marks  ExaminationDetails");
               document.getElementById("txtObtained").focus();
                    return false;
                }
                if (document.getElementById("txtMarks").value == "") {
               alert("Candidate Please Fill Previous Total Marks  ExaminationDetails");
               document.getElementById("txtMarks").focus();
                    return false;
                }

                           if ((document.getElementById("txtObtained").value != "") &&(document.getElementById("txtMarks").value != "")) {

                               var Obtained = document.getElementById("txtObtained").value;

                               var Marks = document.getElementById("txtMarks").value;


                               if (parseInt(txtObtained.value) > parseInt(txtMarks.value)) {
                                   alert("Candidate Please Fill Previous Correct Marks  ExaminationDetails");
                                   document.getElementById("txtObtained").focus();
                                   document.getElementById("txtMarks").focus();
                                   return false;
                               }
                           }


                if ((document.getElementById("txtObtained").value != "") && (document.getElementById("txtMarks").value != "")) {


                    var Obtained = document.getElementById("txtObtained").value;

                    var Marks = document.getElementById("txtMarks").value;


                    var Per = (parseInt(txtObtained.value) / parseInt(txtMarks.value)) * 100;

                    if (parseInt(Per) < parseInt("33")) {

                        alert("Candidate percentage should  greater 33%");
                        return false;
                    }

                }

                if (document.getElementById("hndImage").value == "") {
               alert("Candidate Please Upload the Photograrph");
               return false;
           }
           if (document.getElementById("hndImage1").value == "") {
               alert("Candidate Please Upload the Signature");
               return false;
           }

           if (document.getElementById("ddlReligion").value == "Select") {
               alert("Please Select Candidate Religion");
               document.getElementById("ddlReligion").focus();
                    return false;
                }



                 

                           if (document.getElementById("txtStreet").value == "") {
                               alert("Candidate Please Fill Address of Street");
                               document.getElementById("txtStreet").focus();
               return false;
                           }

                           if (document.getElementById("txtPostOffice").value == "") {
                               alert("Candidate Please Fill Address of  Post Office");
                               document.getElementById("txtPostOffice").focus();
               return false;
                           }

                           if (document.getElementById("txtState").value == "") {
                               alert("Candidate Please Fill State");
                               document.getElementById("txtState").focus();
               return false;
                           }

                           if (document.getElementById("txtDistrict0").value == "") {
                               alert("Candidate Please Fill  District");
                               document.getElementById("txtDistrict0").focus();
               return false;
                           }

                           if (document.getElementById("txtPinCode").value == "") {
                               alert("Candidate Please Fill Pincode");
                               document.getElementById("txtPinCode").focus();
               return false;
                           }

         

           if (document.getElementById("txtYear").value != "") {

               var OBT = parseInt(txtYear.value);

               var x = new Date();
               var n = x.getFullYear();


               if (OBT > n) {
                   txtYear.value = "";
                   alert("You have enter current Year");
                   return false;
               }


           }


          

        
           





            

          


           return true;
       }
                    </script>



                <script type="text/javascript">


                    function checkSelect() {
                        if (document.getElementById('ddlYear').value != '0' && document.getElementById('ddlYear').value != '1') {

                    document.getElementById('enrollment').style.display = "none";

                }
                else {
                            document.getElementById('enrollment').style.display = "block";

                }
                    }    </script>
                	</form>
                   
</body></html>