// Service:slideshow
$mainframe = JFactory::getApplication();
$option = JRequest::getVar('option','com_jewebservices','','string');
$post = JRequest::get ('post');  

 global $HTTP_RAW_POST_DATA;
 
 $post = json_decode($HTTP_RAW_POST_DATA, true);

$uri = JURI::getInstance();
$url= $uri->root();
 

$query = "SELECT app_title,app_description,package_id FROM  #__je_slide_app  where published=1 ORDER BY ordering ASC"; 
$db->setQuery($query);
$slidedata =   $db->loadObjectList();


if($slidedata){
 $slidelist = array();
 for($d=0; $d<count($slidedata); $d++){
  $slidelistdata = array();
  if(strlen($slidedata[$d]->app_title)>21){
			$slidelistdata['slidename'] = substr($slidedata[$d]->app_title,0,21);
   }else{
  		$slidelistdata['slidename'] = $slidedata[$d]->app_title;
  }
  
  if(strlen($slidedata[$d]->app_description)>58){
			$slidelistdata['slidedescription'] = strip_tags(substr($slidedata[$d]->app_description,0,58));
	}else{
		$slidelistdata['slidedescription'] = strip_tags($slidedata[$d]->app_description);
	}
  
 $slidelistdata['package_id'] = $slidedata[$d]->package_id;
  
  $slidelist[] =$slidelistdata; 
 }
 $arr = array('success' => 1, 'slidelist' => $slidelist);
 echo json_encode($arr);exit;
}else{
 $arr = array('success' => 0, 'message' => "No Records Found" ); 
 echo json_encode($arr);exit;
}