<?php
include_once '../session/admin-session.php';
include_once '../classes/class_admin.php';
include_once '../classes/validation.php';
include_once '../classes/common.php';
include_once 'read-configration.php';

$log = new common();
$objadm = new class_admin();
$val = new validation();

$issuedate = $val->ValidateString($_REQUEST["issuedate"]);
?>

<style>
td.this {font-size:12px; color:black; border-left:1px lightsteelblue solid; border-top:1px lightsteelblue solid; text-align:center;}
td.this2 {font-size:12px; color:black; border-left:1px lightsteelblue solid; border-top:1px lightsteelblue solid; text-align:left;} 

td.this3 {font-size:10px; color:black; border-left:1px lightsteelblue solid; border-top:1px lightsteelblue solid; text-align:center;}

table.this {border-right:1px lightsteelblue solid; border-bottom:1px lightsteelblue solid;}
H2 {color:#B92921; padding:0px; margin:0px;}
H3 {color:#B92921; padding:0px; margin:0px;}
td {font-family:arial; font-size:12px; color:#000000;}
td.summarey {font-family:arial; font-size:12px; color:#000000; text-align:center;}

td.left {font-family:arial; font-size:14px; color:#000000; text-align:left; border-top:1px gray solid; border-right:1px gray solid;}
td.noborder {font-family:arial; font-size:12px; color:#000000; border-top:0px gray solid; border-right:0px gray solid;}
table.noborder {border-bottom:0px gray solid; border-left:0px gray solid;}
</style>
<?php
$stu_roll = $val->ValidateString($_REQUEST["rollno"]);
// if(substr($stu_roll,0,4) > '2016') { die("Inadmissible Roll Number");}

  $objadm->roll_number = $stu_roll;
  $res_StudentDet = $objadm->GetStudentDetailsbyRollNumber();

$num = mysqli_num_rows($res_StudentDet);


if ($num != 1) die ("Incorrect Roll Number");
$row = mysqli_fetch_array($res_StudentDet);
$stu_name = $row["name"] ; 
$batch = $row["batch"] ; 

include "sub-list-finder.php";
// echo $sub_list;

$sem_now = $val->ValidateString($_REQUEST["sem_now"]);
$roll_year= substr($stu_roll, 0,4);
$batch_no = $roll_year - 2005;
$exam_year = $roll_year + floor($sem_now/2);
$reg_file = "isr_reg_".$batch."_tbl";

$queryb1 = "SELECT * FROM isr_result_date_b12_tbl where abs_sem = '$sem_now' and batch = '$batch'";
$ObjDB->sproc_name = $queryb1;
$res_queryb1 = $ObjDB->SelectQuery();

$rowb1 = mysqli_fetch_array($res_queryb1);
$approval_date = $rowb1["approval_date"];

if ($batch == 'b1') { $complition_year = "2011";}
else if ($batch == 'b2') { $complition_year = "2012";}
else if ($batch == 'b3') { $complition_year = "2013";}
else if ($batch == 'b4') { $complition_year = "2014";}
else if ($batch == 'b5') { $complition_year = "2015";}
else if ($batch == 'b6') { $complition_year = "2016";}
else if ($batch == 'b7') { $complition_year = "2017";}
else if ($batch == 'b8') { $complition_year = "2018";}
else { $complition_year = "ongoing";}

if ($stu_roll == '20111002' or $stu_roll == '20111003' or $stu_roll == '20111028' or $stu_roll == '20111041' ) {
	$complition_year = '2017';
}
if ($stu_roll == '20121042' or $stu_roll == '20121050' or $stu_roll == '20121059' or $stu_roll == '20111041' ) {
	$complition_year = '2018';
}



$curr_file = "isr_curriculum_tbl";

if(substr($batch,0,1) == 'b') {
	$queryF= "SELECT * FROM isr_failed_tbl where stu_roll = '$stu_roll'";
	$ObjDB->sproc_name = $queryF;
        $res_queryF = $ObjDB->SelectQuery();
        $numF = mysqli_num_rows($res_queryF);
        
	if ($numF == 1) {
//		echo "Failed Case";
		$rowF = mysqli_fetch_array($res_queryF);
		$flist[1] = $rowF["csem1"];
		$flist[2] = $rowF["csem2"];
		$flist[3] = $rowF["csem3"];
		$flist[4] = $rowF["csem4"];
		$flist[5] = $rowF["csem5"];
		$flist[6] = $rowF["csem6"];
		$flist[7] = $rowF["csem7"];
		$flist[8] = $rowF["csem8"];
		include ("sem_BSMSF.php");
	} else {
		if($batch == 'b13' or $batch == 'b14' or $batch == 'b15') {
			die("Semester Transcript is not available for this roll number.");
		} else {
			include ("sem_BSMS.php");
		}
	}
} else {
	include ("sem_IPHD.php");
}
?>