// include_once "admin/file_browser.php";
function dispAdminPhotos () {
if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
return("T'es ouf");
}
get_time();
$result_prod = getPhotosByType("eptvprod");
$result_bonus = getPhotosByType("eptvbonus");
$result_adm = getPhotosByType("eptv.adm");
$str = '
  a l l   p h o t o s
|
|
|
|
';
if (mysql_num_rows($result_prod)) {
$str .= dispAdminPhotosByType($result_prod, " e p t v p r o d u c t i o n");
}
if (mysql_num_rows($result_bonus)) {
$str .= dispAdminPhotosByType($result_bonus, " e p t v   b o n u s");
}
if (mysql_num_rows($result_adm)) {
$str .= dispAdminPhotosByType($result_adm, " e p t v . a d m");
}
return $str;
}
function dispAdminPhotosByType($result, $photo_type) {
$str = '
'.$photo_type.'
|
';
while ($photo = mysql_fetch_array($result)) {
$vid_id = $photo["photo_id"];
$str .= dispWhenTendu($photo["photo_tendu"]);
$str .= '
'.$photo["photo_name"].'
'.$photo["photo_date"].'
|
'.$photo["photo_size"].' Img
|
';
if ($photo["photo_user_id"] == $_SESSION["user_id"] || $_SESSION["user_right"] == $GLOBALS["ROOT"]){
$str .= '
|
|
';
}
$str .= '';
}
$str .= '
|
|
|
';
return ($str);
}
function dispAdminPhotosSolos () {
$rep_def = "photos/";
if ($_SESSION["user_right"] < $GLOBALS["REPORTER"] )
{
return("T'es ouf");
}
// Files on BDD
$result = getAllphotos();
while ($photo = mysql_fetch_array($result)) {
$tab_path_bdd[] = $photo["photo_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 = '
  p h o t o s s o l o s
|
';
for ($i = 0; $tab_solo[$i]; $i++)
{
$str .= '
'.$tab_solo[$i].'
|
|
';
}
$str .= '
|
|
|
';
return $str;
}
function dispAdminAddPhotos () {
$date = get_date();
$vid_path = "";
if (isset($_GET['vid_path']))
{
$vid_path = $_GET['vid_path'];
}
$str = '
  a d d   p h o t o   a l b u m   t o   d a t a b a s e
|
|
';
return $str;
}
function dispAdminModifPhotos () {
$vid_id =$_GET['vid_id'];
$result = getOnePhoto($vid_id);
$str = '
  m o d i f y   a l b u m   p h o t o
|
';
if (mysql_num_rows($result)){
$photo = mysql_fetch_array($result);
}
$str .= '
|
';
return $str;
}
function dispAdminDelPhotos () {
$vid_id =$_GET['vid_id'];
$result = getOnePhoto($vid_id);
$str = '
  d e l e t e   a l b u m   p h o t o
|
';
if (mysql_num_rows($result)){
$photo = mysql_fetch_array($result);
}
$str .= '
|
';
return $str;
}
?> | | |