| Current Path : /var/www/html/venkat/electiveaug22/ |
| Current File : //var/www/html/venkat/electiveaug22/spreference.php |
<?php
include("sdesign.php");
//$truncated = substr($s, 1, 2);
$truncated = strtolower($truncated);
//echo $s.$truncated;
include("condition.php");
/*if($truncated =='it' || $truncated =='ri' || $truncated =='ec') {
if($truncated == 'ri') {
$truncated1= 'itelectivesubmit';
}
else {
$truncated1= $truncated.'electivesubmit';
}
}
else {
$truncated1= 'melectivesubmit';
}*/
$quer1=mysql_query("select cgpa from cgp where rollno='$s'") or die("Invalid Access !!!");
if ($row = mysql_fetch_array( $quer1 )) {
$cgpa = $row['cgpa'];
}
else {
header("location:sdesign.php");
}
if($ndate < $my_t)// for date comparison
{
$quer1=mysql_query("select rollno from $truncated1 where rollno='$s'") or die("Invalid Access !!!");
if ($row = mysql_fetch_array( $quer1 )) {
$quer1=mysql_query("select * from cgp where rollno='$s'") or die("Invalid Access !!!");
if ($row = mysql_fetch_array( $quer1 )) {
$cgpa=$row['cgpa'];
}
?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Submitted Preferences for confirmation. Your CGPI: <font color ="green"> <?php echo($cgpa); ?> </font></strong></td>
</tr>
<?php
$quer1=mysql_query("select basket from matrix where discipline='$truncated'group by basket") or die("Invalid Access !!!");
$b=0;
while ($row = mysql_fetch_array( $quer1 )) {
$n[$b]=$row['basket'];
$b++;
}
for ( $p = 0; $p <= $b-1; $p++) {
$quer1=mysql_query("select subject from matrix where semester = '$semester' and discipline='$truncated' and basket='$n[$p]'") or die("Invalid Access !!!");
$i=0;
while ($row = mysql_fetch_array( $quer1 )) {
$i++;
}
$quer1=mysql_query("select * from $truncated1 where rollno='$s' and basket='$n[$p]'") or die("Invalid Accesss !!!");
echo("<tr><td colspan='3'> <font color='red'> Basket $n[$p] </font> </td></tr>");
if ($row = mysql_fetch_array( $quer1 )) {
for ( $p1 = 1; $p1 <= $i; $p1++) {
$pre=$row['p'.$p1];
if($pre == "null") { break;}
$quer3 = mysql_query("select subject,coursedept from matrix where semester = '$semester' and discipline='$truncated' and coursecode = '$pre' and basket='$n[$p]'") or die("Invalid Access21 !!!");
if ($row1 = mysql_fetch_array( $quer3 )) {
$subject = $row1['subject'];
}
echo("<tr><td width='10'> Preference $p1</td> <td width='150'>$pre - $subject</td></tr>");
//echo("<tr><td width='10'> Preference $p1</td> <td width='150'>$pre - $subject</td></tr>");
}
}
}
?>
</tr>
</table>
</table>
<?php
}
echo "<center><font color='red'> Last date is Over. You Cannot submit your preference </font></center>";
}
else {
$ip=$_SERVER['REMOTE_ADDR'];
$quer1=mysql_query("select rollno from $truncated1 where rollno='$s'") or die("Invalid Access !!!");
if ($row = mysql_fetch_array( $quer1 )) {
$quer1=mysql_query("select * from cgp where rollno='$s'") or die("Invalid Access !!!");
if ($row = mysql_fetch_array( $quer1 )) {
$cgpa=$row['cgpa'];
}
?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Submitted Preferences for confirmation. Your CGPI: <font color ="green"> <?php echo($cgpa); ?> </font></strong></td>
</tr>
<?php
$quer1=mysql_query("select basket from matrix where discipline='$truncated'group by basket") or die("Invalid Access !!!");
$b=0;
while ($row = mysql_fetch_array( $quer1 )) {
$n[$b]=$row['basket'];
$b++;
}
for ( $p = 0; $p <= $b-1; $p++) {
$quer1=mysql_query("select subject from matrix where semester = '$semester' and discipline='$truncated' and basket='$n[$p]'") or die("Invalid Access !!!");
$i=0;
while ($row = mysql_fetch_array( $quer1 )) {
$i++;
}
$quer1=mysql_query("select * from $truncated1 where rollno='$s' and basket='$n[$p]'") or die("Invalid Accesss !!!");
echo("<tr><td colspan='3'> <font color='red'> Basket $n[$p] </font> </td></tr>");
if ($row = mysql_fetch_array( $quer1 )) {
for ( $p1 = 1; $p1 <= $i; $p1++) {
$pre=$row['p'.$p1];
$priority = $row['priority'];
if($pre == "null") { break;}
$quer3 = mysql_query("select subject from matrix where semester = '$semester' and discipline='$truncated' and coursecode = '$pre' and basket='$n[$p]'") or die("Invalid Access21 !!!");
if ($row1 = mysql_fetch_array( $quer3 )) {
$subject = $row1['subject'];
}
echo("<tr><td width='10'> Preference $p1</td> <td width='150'>$pre - $subject</td></tr>");
}
}
if($priority == 1) { ?> <tr><td width='10'> <br> Priority Basket</td> <td width='150'> <br> <?php echo $p+1; ?></td></tr> <?php }
}
?>
</tr>
</table>
</table>
<?php
}
else {
?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="spreferencestore.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Choose your Preferences for All Baskets </strong></td>
</tr>
<?php
$quer1=mysql_query("select basket from matrix where discipline='$truncated' and semester = '$semester' group by basket") or die("Invalid Access !!!");
$b=0;
while ($row = mysql_fetch_array( $quer1 )) {
$n[$b]=$row['basket'];
$b++;
}
$truncatedold = $truncated1."jan21";
if($truncated1 == "bmelectivesubmit") {
$truncatedold = "melectivesubmitjan21";
}
$count = 0;
for ( $p = 0; $p <= $b-1; $p++) {
$quer1=mysql_query("select basket, coursecode, subject from matrix where discipline='$truncated' and semester = '$semester' and basket='$n[$p]'") or die("Invalid Access !!!");
$i=0;
echo("<tr> <td colspan='3'> <font color='red'> Choose Your Preference for Basket $n[$p] </font> </td></tr><tr><td> </td></tr> <tr>");
while ($row = mysql_fetch_array( $quer1 )) {
$m[$i]=$row['subject'];
$coursecode[$i] = $row['coursecode'];
$basket[$i] = $row['basket'];
$quertoold = mysql_query("select name from $truncatedold where rollno='$s' and fes='$m[$i]'") or die("a-Invalid Accessee !!!");
$querdualdegreeres = mysql_query("select * from subjectrestriction where basket = '$basket[$i]' and discipline = '$dualdegree'") or die("Invalid Access !!!");
$querdualdegree = mysql_query("select * from dualdegree where course = '$coursecode[$i]' and semester = $semester and discipline = '$dualdegree'") or die("Invalid Access !!!");
if(mysql_fetch_array($quertoold) || mysql_fetch_array($querdualdegree)) {
//if(mysql_fetch_array($querdualdegree)) {
// echo "hi";
}
else {
$querconstraint = mysql_query("select * from matrix where coursecode = '$coursecode[$i]' and basket = $basket[$i] and semester = $semester and discipline = '$truncated'") or die("Invalid Accessmatrix !!!");
while ($row = mysql_fetch_array( $querconstraint )) {
$coursedept = $row['coursedept'];
if($coursedept != $truncated) {
$querconstraint1 = mysql_query("select * from ecstat where rollno = '$s'") or die("Invalid Accessstat !!!");
if(mysql_num_rows($querconstraint1)== 0){
//$queryec ="insert into ecstat(rollno, constcount, count) VALUES ('$s', 0, 0)";
//mysql_query($queryec) or die(mysql_error());
//mysql_insert_id();
$querconstraint1 = mysql_query("select * from ecstat where rollno = '$s'") or die("Invalid Accessstat !!!");
}
while ($row = mysql_fetch_array( $querconstraint1 )) {
$count = $row['count'];
if($count <= 1) {
$i++;
}
}
}
else {
$i++;
}
}
}
}
$ij = 0;
while($rowres = mysql_fetch_array($querdualdegreeres)){
$m[$ij] = $rowres['subject'];
$coursecode[$ij] = $rowres['coursecode'];
$ij++;
$i = $ij;
}
$depart = substr($s, 1, 2);
$ik = 0;
for ( $j = 0; $j <= $i-1; $j++) {
$sj = $j;
$sj = $sj+1;
$ii = $i-1;
//if($j == $i-3 && $ik == 1) { $i = $i-1; }
echo("<td width='200'> Preference $sj</td> <td width='30'>:</td>");
echo("<td width='370'><select name=$n[$p]$sj id='subject' />");
echo("<option value='#'>-Select-</option>");
for ( $k = 0; $k <= $ii; $k++) {
// if($depart == 'en' && $m[$k] == 'Robotics_&_Industrial_Automation') {
// $ik = 1;
// }
// else {
echo("<option value=$coursecode[$k]-$m[$k]>$coursecode[$k]-$m[$k]</option>");
// }
}
echo("</select></td> </tr> <tr>");
echo("<center>");
}
}
if($count == 1) {
echo("<td width='200'> <br> <br> Priority</td> <td width='30'><br><br>:</td>");
echo("<td width='370'><br> <br><select name='priority' id='priority' />");
echo("<option value='#'>-Select-</option>");
echo("<option value='basket1'>Basket 1</option>");
echo("<option value='basket2'>Basket 2</option>");
echo("</select></td> </tr> <tr>");
echo("<center>");
}
if(($truncated == "it" && $semester == 7) || ($truncated == "ec" && $semester == 7) || ($truncated == "bu" && $semester == 7)) {
if($truncated == "bu") {
echo("</tr><tr> <td> </td> <td> <input type='checkbox' id='drop' name='drop' value='2'> </td> ");
echo("<td><label for='drop'> Willing to take the 2nd elective basket in 8th semester </label><br></td> </tr>");
} else {
echo("</tr><tr> <td> </td> <td> <input type='checkbox' id='drop' name='drop' value='3'> </td> ");
echo("<td><label for='drop'> Willing to take the 3rd elective basket in 8th semester </label><br></td> </tr>");
}
}
?>
</tr>
<tr>
<td colspan = "3"><br><input type="submit" value="Submit"><font color ="red"> If you opt an elective more than once/not opt any subject then you cannot submit. </font></td>
</tr>
</table>
</form>
</table>
<?php
}
}// for date comparison
?>