<?php
	require "../commonincludefiles.php";
   	$objUploadfilesMgmt = new UploadfilesMgmt();
	$i=0;
	$order_field=" branch_name ASC,up.semester_id ";
	$order_type=" ASC ";
	$rs = $objUploadfilesMgmt->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["branch_sem_name"]  = $row["branch_name"].'-'.$row["semester_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["upload_title"]  = $row["upload_title"];
			$temparray["title"]  = $row["title"];
			$temparray["description"]  = $row["description"];
			$temparray["active"]  = $row["active"];
			$temparray["file_name"]  = $row["file_name"];
			$temparray["file_title"]  = $row["file_title"];
			$temparray["upload_file_id"]  = $row["upload_file_id"];
			$temparray["assignment_date"]  = ($row["assignment_date"]!='0000-00-00'?$row["assignment_date"]:'');
			$temparray["submission_date"]  = ($row["submission_date"]!='0000-00-00'?$row["submission_date"]:'');
			$SemesterData["data"][$i] = $temparray;   
			$i++;
		}
	}
	echo json_encode($SemesterData);	
?>
