<?php

class shortlist
{
	function getList($listinginfo,$filterOptions)
	{
		$query="SELECT  * FROM bm_report_file_upload";
		
		if(strlen(trim($filterOptions["standard_name"]))>0)
			$query.=" WHERE report_type='".trim($filterOptions["standard_name"])."' ";

		/*if(strlen(trim($filterOptions["status"]))>0)
			$query.=" and status='".trim($filterOptions["status"])."' ";*/

		if(strlen(trim($listinginfo->orderby))>0)
			$query.=" ORDER BY ".trim($listinginfo->orderby)." ".$listinginfo->order;

		
		$rs=new RecordSet();
		if($listinginfo->paginate)
		{
			$rs->GetRecords($query,$listinginfo->no_of_records);

			if($rs->no_of_records>0)
				return $rs->pages[$listinginfo->page_id-1];
		}
		else
		{
			$rs->GetRecords($query);

			if($rs->no_of_records>0)
				return $rs->result_set;
		}

	}



	function assignDisplayOrder()
	{
		$query=" UPDATE bm_report_file_upload SET display_order='".$this->display_order."' WHERE id='".$this->id."' ";
		
	/*	$rs=new RecordSet();

		$rs->ExecuteQuery($query);*/

		if(!mysql_query($query))
			die(mysql_error());
	}

}

?>