$db = JFactory::getDbo();
$uri =JURI::getInstance();
$url= $uri->root();
$post=JRequest::get('post');

//$post['procedureid']=2;
		
		$imaga_path=$url.'components/com_naderapp/assets/news_image/';
		
	$query='SELECT * FROM #__naderapp_news WHERE published=1';
		$db->setQuery($query); 
		$parents=$db->loadObjectList();


		
		
		$news=array();
		
	if($parents)
	{	
		
		for($i=0;$i<count($parents);$i++)
		{
			$row=$parents[$i];
			
			$newsarray=array();
				
			$newsarray['id']=$parents[$i]->id;
			$newsarray['newsname']=$parents[$i]->name;
			$newsarray['description']=$parents[$i]->description;
			$newsarray['image']=$imaga_path.$parents[$i]->newsimage;
			
			$news[]=$newsarray;
		}
		
		
		
		 $arr = array('success' => '1','news' => $news);
   		 echo json_encode($arr);exit;
		
	}
	else
	{
		
		  $arr = array('success' => '0','news' => 'No Record Found');
 		  echo json_encode($arr);exit;
		
	}