<?php

function trackv($id) {
	$arr = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$id."' LIMIT 1"));
	
$req = mysql_query("SELECT * FROM `video` WHERE `id` = '".intval($_GET['id_video'])."'");
$file = mysql_fetch_array($req);
$file['name'] = str_replace('.mp4', '', $file['name']);
$file['name'] = str_replace('.flv', '', $file['name']);
$file['name'] = str_replace('.3gp', '', $file['name']);
$fil = 'http://'.$_SERVER['HTTP_HOST'].'/files/video/'.$file['dir'].'/'.$file['file'];
$screen = 'http://'.$_SERVER['HTTP_HOST'].'/files/screen/'.$file['dir'].'/'.$file['file'].'.jpg';

	$trackv = '<a href="/video/view.php?id_video='.$arr['id'].'"" onclick="Page.Go(this.href); return false"><img class="preview_mini" src="/files/screen/'.$arr['dir'].'/'.$arr['name'].'.jpg"></a>';
return $trackv;
}

function videopc($id) {
$arr = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$id."' LIMIT 1"));	
$req = mysql_query("SELECT * FROM `video` WHERE `id` = '".intval($_GET['id_video'])."'");
$file = mysql_fetch_array($req);
$file['name'] = str_replace('.mp4', '', $file['name']);
$file['name'] = str_replace('.flv', '', $file['name']);
$file['name'] = str_replace('.3gp', '', $file['name']);
$fil = 'http://'.$_SERVER['HTTP_HOST'].'/files/video/'.$file['dir'].'/'.$file['file'];
$screen = 'http://'.$_SERVER['HTTP_HOST'].'/files/screen/'.$file['dir'].'/'.$file['file'].'.jpg';

	$videopc = '</br>
	<video controls="controls" style="width:97%;"><source src="'.URL.'/files/video/'.$arr['dir'].'/'.$arr['file'].'"></video></br>
	'.$arr['name'].'</a>';
return $videopc;
}



function videomob($id) {
	$arr = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$id."' LIMIT 1"));
	
$req = mysql_query("SELECT * FROM `video` WHERE `id` = '".intval($_GET['id_video'])."'");
$file = mysql_fetch_array($req);
$file['name'] = str_replace('.mp4', '', $file['name']);
$file['name'] = str_replace('.flv', '', $file['name']);
$file['name'] = str_replace('.3gp', '', $file['name']);
$fil = 'http://'.$_SERVER['HTTP_HOST'].'/files/video/'.$file['dir'].'/'.$file['file'];
$screen = 'http://'.$_SERVER['HTTP_HOST'].'/files/screen/'.$file['dir'].'/'.$file['file'].'.jpg';

	$videomob = '<a href="/video/view.php?id_video='.$arr['id'].'"" onclick="Page.Go(this.href); return false"><img class="preview_mini" src="/files/screen/'.$arr['dir'].'/'.$arr['name'].'.jpg"></a>
	</br>
	'.$arr['name'].'
	';
return $videomob;
}














function trackv_playlist($id) {
	$arr = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$id."' LIMIT 1"));
	return '<a href="'.URL.'/files/video/'.$arr['dir'].'/'.$arr['file'].'"><b>'.$arr['name'].'</b> - '.$arr['name'].'</a>';
}

?>