<?php
class Flashreel extends Controller
{
	function Flashreel()
	{
		parent::Controller();
		$this->load->model('mflashreel');
	}
	
	function index()
	{
		//print $this->muser->user['lang'];
		
		$adatok = $this->mflashreel->get_allnext();
		//print_r($adatok);
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			//print $adat->position."<br />";
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print $adat->link."\r\n";
		}
		
		
	}
	
	function hun2(){
		$adatok = $this->mflashreel->get_allnext('hun');
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print $adat->link."\r\n";
		}
	}
	
	function eng2(){
		$adatok = $this->mflashreel->get_allnext('eng');
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print $adat->link."\r\n";
		}
	}
	
	function uj(){
		
	}
	
	function vf(){
		$lang = $this->uri->segment(3);
		if( !$lang ) $lang = "eng";
		
		$adatok = $this->db->query('SELECT * FROM `cadline2`.`service_flash` WHERE service = "vf" AND position > 0 AND lang = "'.$lang.'" ORDER BY position ASC')->result();
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print "http://www.archlinexp.com"."\r\n";
		}
	}
	
	function re(){
		$lang = $this->uri->segment(3);
		if( !$lang ) $lang = "eng";
		
		$adatok = $this->db->query('SELECT * FROM `cadline2`.`service_flash` WHERE service = "re" AND position > 0 AND lang = "'.$lang.'" ORDER BY position ASC')->result();
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print "http://www.archlinexp.com"."\r\n";
		}
	}
	
	function sk(){
		$lang = $this->uri->segment(3);
		if( !$lang ) $lang = "eng";
		
		$adatok = $this->db->query('SELECT * FROM `cadline2`.`service_flash` WHERE service = "sk" AND position > 0 AND lang = "'.$lang.'" ORDER BY position ASC')->result();
		print count($adatok)."\r\n";
		foreach($adatok as $adat){
			print $adat->filename."\r\n";
			print $adat->runtime."\r\n";
			print "http://www.archlinexp.com"."\r\n";
		}
	}
}
?>
