<?php 







function get_category($id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from lms_category where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}





function get_instructor_documents($id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from lms_instructor_documents where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}




function get_inst_course($id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from lms_instructor_courses where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}



function get_course_master($id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from lms_course_master where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}


function get_grade($id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from  lms_grade_master where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}




function get_module($id,$course_id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
		if($course_id!='')
	$qr.=" and course_id='".$course_id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from  lms_instructor_modules where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}





function get_lesson($id,$course_id,$module_id,$status,$ordby,$lmt)//4
{
	$qr='';$limit='';$ord ='';
	if($id!='')
	$qr.=" and id='".$id."'";
	
	if($course_id!='')
	$qr.=" and course_id='".$course_id."'";
	
	if($module_id!='')
	$qr.=" and module_id='".$module_id."'";
	
	
	if($status!='')
	$qr.=" and status='".$status."'";
	if($ordby !='')
	$ord = " and order by '".$ordby."'";
	
	
	
	if($lmt!='')
	$limit.=" limit ".$lmt;
	
	$sel=executework("select * from  lms_instructor_lessons where id<>''".$qr.$ord.$limit);
	$cnt=@mysqli_num_rows($sel);
	$arr=array();
	while($row=@mysqli_fetch_array($sel))
	{
		if($row['status']==1)
		{
			$row['st']='Active';
			$row['st1']='Deactivate';
		}
		else
		{
			$row['st']='Disabled';
			$row['st1']='Activate';
		}
		$arr[]=$row;
	}
	return $arr;
}






?>
