include("/var/www/vhosts/melbar.eu/html/globalsources/define.php");
$GET_KEYS=array_keys($_GET);
$ALLOWED_VALUES=array("intern","Intern","Tool","Warenkorb");
foreach($_POST as $key => $val)
$$key=$val;
if(!in_array($GET_KEYS[0],$ALLOWED_VALUES) AND !empty($_GET)){
header("Location: http://www.tools-profi.de/html/ERROR.html?ERROR=404");
}
include("php/session_.php");
if(isset($_GET['Warenkorb'])){
$_SESSION['Warenkorb']=1;
session_start();
}
if($_SESSION['Warenkorb']==1){
$_GET['Warenkorb']=1;
}
include("php/config.cfg.php");
include($incl_pfad."/php/count.php");
include($incl_pfad.'/php/func_im_size.php');
include($incl_pfad.'/php/get_bot.php');
include($incl_pfad."/php/con_02.inc.php");
$metaKw='Tool,Tools,Messer,Zange,Zangen,Werkzeug,Multitool,Multitol,Multitools,Shop,Toolshop,Onlineshop,Gerber Tool, Leatherman Tool, Wenger Tool, Herbertz Tool';
$metaTitle=" Tools Tool Shop ";
$metaDesc="Tool Shop. Gerber, Wenger, Leatherman, Herberts ...";
if(isset($preview)){
$verzeichnis = dir("arts/".$preview."/");
$endung = ".txt";
while($datei = $verzeichnis->read()) {
if(substr($datei,strlen($endung)*(-1)) == $endung) {
$artC=str_replace(".txt","",$datei);
$tempL=@file("arts/".$preview."/".$datei);
$artI=trim($tempL[0]);
// erstellt artikel array
$previewList[$preview][$artC]['artNr']=trim($artC);
$previewList[$preview][$artC]['thumb']="http://www.tools-profi.de/arts/".$preview."/t".$artC.".jpg";
$previewList[$preview][$artC]['image']="http://www.tools-profi.de/arts/".$preview."/".$artC.".jpg";
$previewList[$preview][$artC]['text'] ="http://www.tools-profi.de/arts/".$preview."/".$artC.".txt";
//prüft, ob preview = gruppe im array existiert
if(!array_key_exists($preview,$previewList)){
$_GET['Intern']='errorGruppe';
unset($_GET['Tool']);
unset($_GET['detail']);
$textURL=$incl_pfad."/content/html/errorGruppe.inc.html";
unset($preview);
}
}
}
}
if(isset($_GET['detail'])){
// prüft, ob detail im artikle array existiert
if(!$previewList[$preview][$_GET['detail']])
{
unset($_GET['Tool']);
unset($_GET['detail']);
unset($preview);
$textURL=$incl_pfad."/content/html/errorDetail.inc.html";
}
}
if(isset($preview)){
// generiert detail anzeige
if(isset($_GET['detail'])){
$detailTextURL=$previewList[$preview][$_GET['detail']]['text'];
//.$_GET['detail'].".txt";
//einlesen artikle beschreibung
if(!@fopen($detailTextURL,"r"))
$detailFile=array("Für Artikelx ".$_GET['detail']," zur zeit keine Inforamtionen zur Verfügung ");
$detailFile=@file($detailTextURL);
$metaTitle=trim(strip_tags($detailFile[0]));
$metaKw=$metaTitle.",".$metaKw;
$detailFile[0]="
".trim($detailFile[0])."
";
foreach($detailFile as $zeile)
$detailText.=trim($zeile)."
";
$metaDesc=strip_tags($detailText);
$suche=$_GET['detail'];
$orderFile=implode(" ",@file("/var/www/vhosts/web126/html/tools-profi/php/order/call.inc.php"));
ob_start();
eval($orderFile);
$orderLine=ob_get_contents();
ob_end_clean();
$detailText="".$detailText."\n".$orderLine."\n
";
$detailImage=$previewList[$preview][$_GET['detail']]['image'];
$new_size=im_siz(str_replace("http://www.tools-profi.de/","",$detailImage),340,250);
$detailImage="
";
$previewContantText=implode(" ",@file('content/html/detail.inc.html'));
} // ende Detail
else{
$previewContantText=implode(" ",@file('content/html/preview.inc.html'));
$metaTitle=$preview." Tools Tool Shop ";
$metaDesc=$preview." im Tool Shop. Tool Shop. Gerber, Wenger, Leatherman, Herberts ... ";
$metaKw=$preview." Tools, Multitools,".$metaKw;
} // else detail
// Baut Vorschauliste
$previewContent="\n\n".$preview." Tool
\n
\n";
$zeilenCounter=0;
foreach($previewList[$preview] as $article){
$zeilenCounter++;
$new_size=im_siz($article['thumb'],80,120);
$tempFile=$article['text'];
if(!@fopen($tempFile,"r"))
$tempFile=array("Für Artikel ".$article['artNR']." zur Zeit keine Inforamtionen zur Verfügung ");
else
$tempFile=file($tempFile);
$tempTitle=trim(strip_tags($tempFile[0]));
include($incl_pfad."/php/con_02.inc.php");
$query="SELECT ARTI,DM,aktion FROM preis01 WHERE ARTC = '".$article['artNr']."' ";
$previewRes=mysql_query($query);
echo mysql_error();
$zusatz=mysql_fetch_row($previewRes);
if(($zusatz[2]==0))
$preis=$zusatz[1]." €";
else
$preis="SP: ".$zusatz[2]." € - ".$zusatz[1]."";
$previewSet="
".$zusatz[0]."
".$preis."
";
if($zeilenCounter==2){
$previewSet=str_replace("single","singleR",$previewSet);
$zeilenCounter=0;
$previewSet.="
";
}
$previewContent.=$previewSet;
// $zeilenCounter++;
}//ende foreach
$previewContent="".$previewContent."
";
}// ende if preview
else{
ob_start();
include($textURL);
$welcom=ob_get_contents();
ob_end_clean();
$metaTitle=$subTitle.$metaTitle;
$metaDesc=$subDesc.$metaDesc;
}
if($_GET['Intern']=="Bestellung erstellen"){
$css="order.css";
$_SESSION['Warenkorb']=0;
unset($_POST['Warenkorb'],$_GET['Warenkorb']);;
}else{
$css="basis.css";
}
if($_POST['order']=='Warenkorb' OR $_GET[Warenkorb]=='1'){
ob_start();
include($orderURL);
$orderContent=ob_get_contents();
ob_end_clean();
}
$previewContantText=str_replace("<*hl*>",$preview,$previewContantText);
$previewContantText=str_replace('Tactical','Tactical Daggers / Taktische ', $previewContantText);
$resource=implode(" ",@file('content/html/index.inc.html'));
// austauschen META Informationen
$resource=str_replace('<*metatitle*>',$metaTitle,$resource);
$resource=str_replace('<*metadesc*>',$metaDesc,$resource);
$resource=str_replace('<*metakw*>',$metaKw,$resource);
if(empty($QUERY_STRING))
$sub_STRING='?Warenkorb=1';
elseif(strstr($QUERY_STRING,'Warenkorb'))
$sub_STRING='?'.$QUERY_STRING;
else
$sub_STRING='?'.$QUERY_STRING.'&Warenkorb=1';
// austauschen inhalt
$resource=str_replace('<*preview*>',$previewContent,$resource);
$resource=str_replace('<*image*>',$detailImage,$resource);
$resource=str_replace('<*text*>',$detailText,$resource);
$resource=str_replace('<*welcome*>',$welcom,$resource);
$resource=str_replace('<*previewTextContant*>',$previewContantText,$resource);
$resource=str_replace('<*referer*>',$HTTP_REFERER,$resource);
$resource=str_replace('<*order*>',$orderContent,$resource);
$resource=str_replace('<*wki*>',$sub_STRING,$resource);
$resource=str_replace('<*css*>',$css,$resource);
echo $resource;
?>