<?php
	require "../commonincludefiles.php";
   	$objSemester = new LecMgmt();
	$i=0;
	$order_field=" lc.lec_id ";
	$order_type=" ASC ";
	$rs = $objSemester->getAllRecordssmesterallocate($limit,$start,$where,$order_field,$order_type);
	$total = dbRows($rs);
	$SemesterData = array("count" => $total, "data" => array());
	if(dbRows($rs) > 0){
		while($row = dbArray($rs)){
			$temparray["lecture_id"]  = $row["lec_id"];
			$temparray["branch_name"]  = $row["branch_name"];
			$temparray["year_id"]  = $row["year_id"];
			$temparray["year_name"]  = $row["year_name"];
			$temparray["branchyear_id"]  = $row["branchyear_id"];
			$temparray["branchyear_name"]  = $row["branchyear_name"];
			$temparray["semester_id"]  = $row["semester_id"];
			$temparray["semester_name"]  = $row["semester_name"];
			$temparray["time_start_name"]  = $row["time_start_name"];
			$temparray["time_end_name"]  = $row["time_end_name"];
			$temparray["lec_name"]  = $row["lec_name"];
			$temparray["semester_allocate_time_id"]  = $row["semester_allocate_time_id"];
			
			$SemesterData["data"][$i] = $temparray;   
			$i++;
		}
	}
	echo json_encode($SemesterData);	
?>