// include_once "admin/file_browser.php";
function dispAdminVideos () {
if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
return("T'es ouf");
}
get_time();
$result_prod = getVideosByType("eptvprod");
$result_bonus = getVideosByType("eptvbonus");
$result_adm = getVideosByType("eptv.adm");
$str = '
  a l l   v i d e o s
|
|
|
|
';
if (mysql_num_rows($result_prod)) {
$str .= dispAdminVideosByType($result_prod, " e p t v p r o d u c t i o n");
}
if (mysql_num_rows($result_bonus)) {
$str .= dispAdminVideosByType($result_bonus, " e p t v   b o n u s");
}
if (mysql_num_rows($result_adm)) {
$str .= dispAdminVideosByType($result_adm, " e p t v . a d m");
}
return $str;
}
function dispAdminVideosByType($result, $video_type) {
$str = '
'.$video_type.'
|
';
while ($video = mysql_fetch_array($result)) {
$vid_id = $video["video_id"];
$str .= dispWhenTendu($video["video_tendu"]);
$str .= '
'.$video["video_name"].'
';
if ($video["video_path_daily"]) {
$str .= '';
}
$str .= ' |
'.$video["video_date"].'
|
'.$video["video_size"].' Mo
|
';
if ($video["video_user_id"] == $_SESSION["user_id"] || $_SESSION["user_right"] == $GLOBALS["ROOT"]){
$str .= '
|
|
';
}
$str .= '';
}
$str .= '
|
|
|
';
return ($str);
}
function find_reccur_file($rep_def)
{
$rep = opendir($rep_def);
while( $file = readdir($rep))
{
if($file !='..' && $file !='.' && $file !='')
{
if (is_dir($rep_def.$file))
{
$tab_temp = find_reccur_file($rep_def.$file.'/');
$tab = array_merge($tab, $tab_temp);
}
else if (is_file($rep_def.$file))
{
$tab[] = $rep_def.$file;
}
}
}
closedir($rep);
return $tab;
}
function dispAdminVideosSolos () {
$rep_def = "videos/";
if ($_SESSION["user_right"] < $GLOBALS["REPORTER"] )
{
return("T'es ouf");
}
// Files on BDD
$result = getAllVideos();
while ($video = mysql_fetch_array($result)) {
$tab_path_bdd[] = $video["video_path"];
}
// Files on Serveur
$tab_path_local = find_reccur_file($rep_def);
for ($cpt_local = 0; $tab_path_local[$cpt_local]; $cpt_local++)
{
for ($cpt_bdd = 0; $tab_path_bdd[$cpt_bdd] && $tab_path_bdd[$cpt_bdd] != $tab_path_local[$cpt_local]; $cpt_bdd++)
{
;
}
if (!$tab_path_bdd[$cpt_bdd])
{
$tab_solo[] = $tab_path_local[$cpt_local];
}
}
$str = '
  v i d e o s s o l o s
|
';
for ($i = 0; $tab_solo[$i]; $i++)
{
$str .= '
'.$tab_solo[$i].'
|
|
';
}
$str .= '
|
|
|
';
return $str;
}
function dispAdminAddVideos () {
$date = get_date();
$vid_path = "";
if (isset($_GET['vid_path']))
{
$vid_path = $_GET['vid_path'];
}
$str = '
  a d d   v i d e o   t o   d a t a b a s e
|
|
';
return $str;
}
function dispAdminModifVideos () {
$vid_id =$_GET['vid_id'];
$result = getOneVideo($vid_id);
$str = '
  m o d i f y   v i d e o
|
';
if (mysql_num_rows($result)){
$video = mysql_fetch_array($result);
}
$str .= '
|
';
return $str;
}
function dispAdminDelVideos () {
$vid_id =$_GET['vid_id'];
$result = getOneVideo($vid_id);
$str = '
  d e l e t e   v i d e o
|
';
if (mysql_num_rows($result)){
$video = mysql_fetch_array($result);
}
$str .= '
|
';
return $str;
}
?>
| | |