<?php
if(!defined("FORMS")){
	echo "<pre>Access denied!";
	exit();
}
$tmpl->assign('e_date_top', date("d.m.Y", $row->end_top));
$tmpl->assign('e_date_top_hour', date("H", $row->end_top));
$tmpl->assign('e_date_top_minute', date("i", $row->end_top));

$tmpl->assign('e_date', date("d.m.Y", $row->time_end));
$tmpl->assign('e_hour', date("H", $row->time_end));
$tmpl->assign('e_minute', date("i", $row->time_end));

$tmpl->assign('s_date', date("d.m.Y", $row->time_start));
$tmpl->assign('s_hour', date("H", $row->time_start));
$tmpl->assign('s_minute', date("i", $row->time_start));

// <<-- PRODUKTE -->>
$sql = new dbc("SELECT title,id  FROM ".PREFIX."_products  WHERE area='$area'  order by title asc");
$products = array();
while( $row_pro=$sql->fetchrow()){
	array_push($products,$row_pro);
}
$tmpl->assign('products', $products);

// <<-- PLATFORM -->>
$dbtable = ($_REQUEST['fillform']==1) ?  "products" : "articles";
$rowid = ($_REQUEST['fillform']==1) ?  $_REQUEST['fill_id'] : $_REQUEST['id'];

$sql = new dbc("SELECT id,platform FROM " . PREFIX . "_".$dbtable." WHERE id = '". $rowid . "'" );
$linked_platforms = $sql->fetchrow();
$linked_platforms->id = explode(";", $linked_platforms->platform);
$tmpl->assign("pforms", $linked_platforms);


// <<-- VERKNÜPFTE GALERIEN -->>
$r_navi = new dbc("SELECT id,gallery,inline_screens FROM " . PREFIX . "_".$dbtable." WHERE id = '". $rowid . "'" );
$row_linked_gals = $r_navi->fetchrow();
$row_linked_gals->id = explode(";", $row_linked_gals->gallery);
$tmpl->assign("linkedgals", $row_linked_gals);

// <<-- INLINESHOTS -->>
if($row_linked_gals->inline_screens){
	$tmpl->assign("inlineshots", base64_encode(serialize($row_linked_gals->inline_screens)));
}
// <<-- LINKS -->>
$tmpl->assign("links", str_replace(";", "\n", $row->links));

// <<-- VOTING DIVERSE -->>
$tmpl->assign('artvotes', str_replace(";", "\n", $row->artvotes));

// <<-- MEINUNG DER REDAKTION -->>
$langadmin['pvoting'] = ",".$langadmin['pvoting'];
$langpvote = explode(",",$langadmin['pvoting']);
while (list($key, $value) = each ($langpvote)) {
	if($value){
		$pvote[$value]['val'] = $value;
		$pvote[$value]['key'] = $key;
	}
}

$tmpl->assign("pvote",$pvote);

$cat_sel= array();
getArticlecat(0, "", $cat_sel, $area);
$tmpl->assign('cat_sel', $cat_sel);


// <<-- BILD -->>
if($_REQUEST['fillform']==1){
	$sql = new dbc("SELECT boxshot FROM ".PREFIX."_products WHERE id='".$_REQUEST['fill_id']."'");
	$row_img = $sql->fetchrow();
	$imgpath = $row_img->boxshot;
	$std = "uploads/products/".$imgpath;
	} else {
	$imgpath = $row->boxshot;
	$std  = $imgpath;
}

if ($std=="") {
	$stdimage = "templates/".ADMINTHEME."/image/pixel.gif"; 
	} else {
	$stdimage = "../" . $std; 
} 
if(is_file($stdimage)){
	$tmpl->assign('std',$std);
	$dyn = '<img src="'.$stdimage.'" border="0" id="pic">';
}

$imgpath_top = $row->image_top;
$std_top  = $imgpath_top;
if ($std_top=="") { $stdimage_top = "templates/".ADMINTHEME."/image/pixel.gif"; } else {
	$stdimage_top = "../" . $std_top;
} 
$dyn_top = '<img src="'.$stdimage_top.'" border="0" id="pic_top">';


$tmpl->assign('dyn',$dyn);
$tmpl->assign('dyn_top',$dyn_top);
?>