<?php
require "commonincludefiles.php";
$condition = "";
$objComboMgmt = new ComboMgmt();

$str1 = $str2 = $str3 = $str4 = $str5 = $str6 = $str7 = $str8 = $str11 = $str12 = $str13 = $str14 = $str15 = $str16 = $str17 = $str18 = $str19 = $str20 = $str21 = $str22 = $str23 = $str24 = $str25 = "";

$result = $objComboMgmt->getbranch($condition);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str1 .= "['" . $record['branch_id'] . "','" . $record['branch_name'] . "'],";
	}
}
if ($str1 != "") {
	$str4 .= "['All',':: All ::'],";
	$str4 .= $str1;
}


$result1 = $objComboMgmt->getbranch1($condition);
if (dbRows($result1) > 0) {
	while ($record = dbArray($result1)) {
		$str24 .= "['" . $record['branch_id'] . "','" . $record['branch_name'] . "'],";
	}
}
if ($str24 != "") {
	$str25 .= "['All','All'],";
	$str25 .= $str24;
}


$result2 = $objComboMgmt->getsemester($condition);
if (dbRows($result2) > 0) {
	while ($record = dbArray($result2)) {
		$str2 .= "['" . $record['branch_id'] . "','" . $record['semester_id'] . "','" . $record['semester_name'] . "'],";
	}
}



$result = $objComboMgmt->getdisplay($condition);
//$qry = "SELECT * FROM cms_displaytable WHERE displaytype = 'S' AND displayactive='1' ORDER BY displayorder ASC";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str6 .= "['" . $record['displayid'] . "','" . addslashes($record['displayname']) . "'],";
	}
}
if ($str1 != "") {
	$str7 .= $str1;
}


//division 
$result = $objComboMgmt->getbranchsemester($condition);
//$qry = "SELECT * FROM cms_branchsemester 	WHERE college_id   = '" . $_SESSION["VedantnrCollegeId"] . "' ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$div = $record['noofdiv'];
		for ($i = 0; $i < $div; $i++) {
			$key = chr(65 + $i);
			$str11 .= "['" . $record['branch_id'] . $record['semester_id'] . "','" . $key . "'],";
		}
	}
}

$result = $objComboMgmt->getcast($condition);
//$qry = "SELECT DISTINCT student_cast FROM cms_studentmaster WHERE student_cast != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_cast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str3 .= "['" . $record['student_cast'] . "'],";
	}
}


$result = $objComboMgmt->getsubcast($condition);
//$qry = "SELECT DISTINCT student_subcast FROM cms_studentmaster WHERE student_subcast != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_subcast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str17 .= "['" . $record['student_subcast'] . "'],";
	}
}


//year
$result = $objComboMgmt->getadmdate($condition);
//$qry = "SELECT DISTINCT YEAR(`student_admdate`) as AYEAR FROM `cms_studentmaster` WHERE YEAR(`student_admdate`) != 0;";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str12 .= "['" . $record['AYEAR'] . "'],";
	}
}


$result = $objComboMgmt->getemp($condition);
//$qry = "SELECT employee_id,employee_name,branch_id FROM cms_employeemaster WHERE employee_active='Yes'";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str13 .= "['" . $record['employee_id'] . "','" . $record['employee_name'] . "','" . $record['branch_id'] . "'],";
	}
}


$result = $objComboMgmt->gettime($condition);
//$qry = "SELECT * from cms_timemaster";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str14 .= "['" . $record['time_id'] . "','" . $record['time_start_name'] . "'],";
	}
}

$result = $objComboMgmt->gettime($condition);
//$qry = "SELECT * from cms_timemaster";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str15 .= "['" . $record['time_id'] . "','" . $record['time_end_name'] . "'],";
	}
}



$result = $objComboMgmt->getlec($condition);
//$qry = "SELECT * from cms_lecmaster";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str16 .= "['" . $record['lec_id'] . "','" . $record['lec_name'] . "'],";
	}
}



$result = $objComboMgmt->getbatch($condition);
//$qry = "SELECT * FROM cms_batchmaster WHERE 1=1 and college_id= '" . $_SESSION["VedantnrCollegeId"] . "' ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str18 .= "['" . $record['batch_id'] . "','" . $record['batch_name'] . "'],";
	}
}


$result = $objComboMgmt->gettaluko($condition);
//$qry = "SELECT DISTINCT taluko_nameeng FROM cms_studentmaster WHERE taluko_nameeng != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_cast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str19 .= "['" . $record['taluko_nameeng'] . "'],";
	}
}

$result = $objComboMgmt->getstate($condition);
//$qry = "SELECT DISTINCT state_nameeng FROM cms_studentmaster WHERE state_nameeng != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_cast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str20 .= "['" . $record['state_nameeng'] . "'],";
	}
}


$result = $objComboMgmt->gettaluko1($condition);
//$qry = "SELECT DISTINCT taluko_nameeng1 FROM cms_studentmaster WHERE taluko_nameeng1 != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_cast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str21 .= "['" . $record['taluko_nameeng1'] . "'],";
	}
}


$result = $objComboMgmt->getstate1($condition);
//$qry = "SELECT DISTINCT state_nameeng1 FROM cms_studentmaster WHERE state_nameeng1 != '' AND college_id = '" . $_SESSION["VedantnrCollegeId"] . "' order by student_cast ASC ";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str22 .= "['" . $record['state_nameeng1'] . "'],";
	}
}


$result = $objComboMgmt->getscholarship($condition);
//$qry = "SELECT * FROM scholarship_master WHERE 1=1";
//$result = dbQuery($qry);
if (dbRows($result) > 0) {
	while ($record = dbArray($result)) {
		$str23 .= "['" . $record['scholarship_id'] . "','" . $record['scholarship_name'] . "'],";
	}
}



$str1 = substr($str1, 0, strlen($str1) - 1);
$str2 = substr($str2, 0, strlen($str2) - 1);
$str3 = substr($str3, 0, strlen($str3) - 1);
$str4 = substr($str4, 0, strlen($str4) - 1);
$str6 = substr($str6, 0, strlen($str6) - 1);
$str8 = substr($str8, 0, strlen($str8) - 1);
$str11 = substr($str11, 0, strlen($str11) - 1);
$str12 = substr($str12, 0, strlen($str12) - 1);
$str13 = substr($str13, 0, strlen($str13) - 1);
$str14 = substr($str14, 0, strlen($str14) - 1);
$str15 = substr($str15, 0, strlen($str15) - 1);
$str16 = substr($str16, 0, strlen($str16) - 1);
$str17 = substr($str17, 0, strlen($str17) - 1);
$str18 = substr($str18, 0, strlen($str18) - 1);
$str23 = substr($str23, 0, strlen($str23) - 1);
$str24 = substr($str24, 0, strlen($str24) - 1);

?>
<script type="text/javascript" language="javascript">
	Ext.namespace('Ext.student');
	Ext.namespace('Ext.semester');
	Ext.student.branch = [<?php echo $str1; ?>];
	Ext.student.branch1 = [<?php echo $str4; ?>];
	Ext.student.branch2 = [<?php echo $str7; ?>]; // require in library module
	Ext.student.semester = [<?php echo $str2; ?>];
	Ext.student.cast = [<?php echo $str3; ?>];
	Ext.student.column = [<?php echo $str6; ?>];
	Ext.student.division = [<?php echo $str8; ?>];
	Ext.semester.division = [<?php echo $str11; ?>];
	Ext.student.admyear = [<?php echo $str12; ?>];
	Ext.student.employee = [<?php echo $str13; ?>];
	Ext.student.time = [<?php echo $str14; ?>];
	Ext.student.time1 = [<?php echo $str15; ?>];
	Ext.student.lec = [<?php echo $str16; ?>];
	Ext.student.subcast = [<?php echo $str17; ?>];
	Ext.student.batch = [<?php echo $str18; ?>];
	Ext.student.taluko = [<?php echo $str19; ?>];
	Ext.student.state = [<?php echo $str20; ?>];
	Ext.student.taluko1 = [<?php echo $str21; ?>];
	Ext.student.state1 = [<?php echo $str22; ?>];
	Ext.student.scholarship = [<?php echo $str23; ?>];
	Ext.student.document = [<?php echo $str25; ?>];	
</script>