<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'";
  $numresultsy=mysql_query($queryy);$resulty= mysql_query($queryy) or die("Couldn't execute query1");
  //////////////////////////////////
  $queryyn = "SELECT * FROM seme_year where college_id='$college' and college_type='$CourseType' and course_name='$Course' and sem_yer='$Course_Details'  and college_id='$college'  and session='$session'";
  $numresultsyn=mysql_query($queryyn);
  $resultyn= mysql_query($queryyn) or die("Couldn't execute query2");
  $a_rown = mysql_fetch_row( $resultyn ); echo $cv=$a_rown[3]; $opt=$a_rown[9]; ?>
  <input name="cv" type="hidden" value="<?php echo $cv; ?>"/>
<table width="100%" border="1">
  <tr>    <?php if($opt=='Y'){ ?>

   

    <td width="16%">Miner Subjects</td>

    <td width="16%">Vocational Subjects</td>

    <td width="10%">Compulsury Paper's</td>

    
    <?php } ?><td width="43%"><?php if($opt=='Y'){ ?>Major Subjects<?php } ?></td>
  </tr>

  <tr>

    <?php if($opt=='Y'){ ?>

    
    <td style="color:#0000FF; font-weight:bold">उपलब्ध विषयों में से किसी 01 विषय का चयन चतुर्थ विषय के रूप में अनिवार्य होगा जो किसी अन्य संकाय से लेना होगा</td>

    <td style="color:#0000FF; font-weight:bold">दिये गये विषयों में कौशल विकास विषय/प्रश्नपत्र के रूप में किन्ही 01 विषय का चयन करें</td>

    <td style="color:#0000FF; font-weight:bold">अनिवार्य प्रश्नपत्र</td>

   
     <td style="color:#0000FF; font-weight:bold"><?php if($opt=='Y'){ ?>किन्ही 03 विषयों का चयन करें<?php } ?></td>
     <?php } ?>
  </tr>

  <tr>

    <?php if($opt=='Y'){ ?>

   

    <td><?php if($_POST['minorsubject']!=""){

$minorsubject=$_POST['minorsubject'];

$minorsubject2=$_POST['minorsubject'];

}else{

$minorsubject=$row['minorsubject'];

$minorsubject2=$row['minorsubject'];

} ?><?php
if((in_array($minorsubject,$my_stored_game, true))||(in_array($minorsubject,$all_game_valueb, true))||($major_subject2==$minorsubject)){
?><div style="color:#FF0000; font-weight:bold">आपने पहले ही ये सब्जेक्ट चुन लिया है कोई और सब्जेक्ट चुनें !</div>
<?php }?>

<select name="minorsubject"  required style="width:200px;" onchange='this.form.submit()'>

<option value="" <?php if($minorsubject==""){ ?>selected<?php } ?>></option>
<option value="GEOGRAPHY" <?php if($minorsubject=="GEOGRAPHY"){ ?>selected<?php } ?>>GEOGRAPHY</option>
<option value="HOME SCIENCE" <?php if($minorsubject=="HOME SCIENCE"){ ?>selected<?php } ?>>HOME SCIENCE</option>
<option value="HINDI" <?php if($minorsubject=="HINDI"){ ?>selected<?php } ?>>HINDI</option>
<option value="ENGLISH" <?php if($minorsubject=="ENGLISH"){ ?>selected<?php } ?>>ENGLISH</option>
<option value="SOCIOLOGY" <?php if($minorsubject=="SOCIOLOGY"){ ?>selected<?php } ?>>SOCIOLOGY</option>
<option value="ANCIENT HISTORY" <?php if($minorsubject=="ANCIENT HISTORY"){ ?>selected<?php } ?>>ANCIENT HISTORY</option>
<option value="SANSKRIT" <?php if($minorsubject=="SANSKRIT"){ ?>selected<?php } ?>>SANSKRIT</option>
<option value="POLITICAL SCIENCE" <?php if($minorsubject=="POLITICAL SCIENCE"){ ?>selected<?php } ?>>POLITICAL SCIENCE</option>
<option value="EDUCATION" <?php if($minorsubject=="EDUCATION"){ ?>selected<?php } ?>>EDUCATION</option>
  </select></td>

    <td><?php if($_POST['vcourse']!=""){

$vcourse=$_POST['vcourse'];

}else{

$vcourse=$row['vcourse'];

} ?><?php
if((in_array($vcourse,$my_stored_game, true))||(in_array($vcourse,$all_game_valueb, true))||($vcourse==$minorsubject)||($vcourse==$major_subject2)){
?><div style="color:#FF0000; font-weight:bold">आपने पहले ही ये सब्जेक्ट चुन लिया है कोई और सब्जेक्ट चुनें !</div>
<?php }?>

<select name="vcourse" style="width:200px;" required onchange='this.form.submit()'>

 <option value="" ></option>

<option value="Food Nutrition and Hygiene" <?php if($vcourse=="Food Nutrition and Hygiene"){ ?>selected<?php } ?>>Food Nutrition and Hygiene</option>


  </select></td>

    <td><input type="text" name='cccourse' value='Yoga & Fiteness'/></td>

    
    <?php } ?><td><?php if($opt=='Y'){ ?>

               
 
 <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 ) )

 {

 $sx=$a_roww[1];

 ?>

                 <li><input type='checkbox' name='ckb[]' id="ckb" value='<?php echo $a_roww[1]; ?>' <?php if(in_array($sx,$my_stored_game, true)){print "checked";}?> onclick='chkcontrol(<?php echo $c;?>)';><?php echo $a_roww[1];?></li>
                  <?php 

				  

				  $c++;

				  } ?>
</ul>
				<?php }else{ ?>							
 
 <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 ) )

 {

 $sx=$a_roww[1];

 ?>

                 <li><input type='checkbox' name='ckb[]' id="ckb" value='<?php echo $a_roww[1]; ?>' <?php if(in_array($sx,$my_stored_game, true)){print "checked";}?> onclick='chkcontrol(<?php echo $c;?>)';><?php echo $a_roww[1];?></li>
                  <?php 

				  

				  $c++;

				  } ?>
</ul>
						<?php } ?></td>
  </tr>
</table>
</div>
