<?php
	require "../commonincludefiles.php";
	
	
   	$objUploadMgmt = new cms_uploadMgmt();
	$i=0;
	$order_field=" branch_id";
	$order_type=" ASC ";
	$rs = $objUploadMgmt->getAllRecords($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["upload_id"]  = $row["upload_id"];
			$temparray["branch_id"]  = $row["branch_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["subject_id"]  = $row["subject_id"];
			$temparray["subject_name"]  = $row["subject_name"];
			$temparray["title"]  = $row["title"];
			$temparray["file_name"]  = $row["file_name"];
			$temparray["assignment_date"]  = ($row["assignment_date"]!='0000-00-00'?$row["assignment_date"]:'');
			$temparray["submission_date"]  = ($row["submission_date"]!='0000-00-00'?$row["submission_date"]:'');
			$temparray["description"]  = $row["description"];
			$temparray["active"]  = $row["active"];
			$SemesterData["data"][$i] = $temparray;   
			$i++;
		}
	}
	echo json_encode($SemesterData);	
?>