DEFINE(_ROOT,"/var/www/vhosts/melbar.eu/dolche/");
DEFINE(_BASE,"/var/www/vhosts/melbar.eu/");
include(_BASE."melbar/Djin/session_.php");
include(_BASE."globalsources/con_02.inc.php");
include(_BASE."globalsources/define.php");
$GET_KEYS=array_keys($_GET);
$ALLOWED_VALUES=array("intern","Intern","Dolche","Warenkorb");
if(!in_array($GET_KEYS[0],$ALLOWED_VALUES) AND !empty($_GET)){
echo "ERROR";exit;
header("Location: https://www.dolche.de/html/ERROR.php?ERROR=404");
}
if(isset($_GET['Warenkorb'])){
$_SESSION['Warenkorb']=1;
session_start();
}
if($_SESSION['Warenkorb']==1){
$_GET['Warenkorb']=1;
}
if($_GET){
foreach($_GET as $key => $val){
$$key=$val;
}
}
if($_POST){
foreach($_POST as $key => $val){
$$key=$val;
}
}
include(_BASE."melbar/count/count.php");
include(_BASE.'melbar/funktionen/func_im_size.php');
include(_BASE.'melbar/funktionen/get_bot.php');
include(_ROOT.'php/config.cfg.php');
$metaKw='Dolche,Dolch,Shop,Dolchshop,Onlineshop,Mittelalterdolch,Mittelalter,Renaissance,Kelten,keltisch,mittelalterlich,taktisch,tactical,Stiefeldolche';
$metaTitle.=" Dolche Shop, Dolche im Onlineshop ";
$metaDesc="Dolche Shop. Tactical, Mittelalter, Renaissance, Folder und Bootdagger und mehr im Dolche Online Shop ";
$previewTemp=file('data/articleList2.dat');
foreach($previewTemp as $data){
$temp=explode("::",$data);
$MenueList[]=$temp[0];
}
if(isset($preview)){
// erstellt artikel array
foreach($previewTemp as $data){
$temp=explode("::",$data);
$previewList[$temp[0]][$temp[1]]['artNr']=trim($temp[1]);
$previewList[$temp[0]][$temp[1]]['thumb']=trim($temp[2]);
$previewList[$temp[0]][$temp[1]]['image']=trim($temp[3]);
$previewList[$temp[0]][$temp[1]]['text']=trim($temp[4]);
} // foreach previewtemp
//prüft, ob preview = gruppe im array existiert
if(!array_key_exists($preview,$previewList)){
$_GET['Intern']='errorGruppe';
unset($_GET['Dolche']);
unset($_GET['detail']);
$textURL="dolche/content/html/errorGruppe.inc.php";
unset($preview);
}
}
if(isset($_GET['detail'])){
// prüft, ob detail im artikle array existiert
if(!$previewList[$preview][$_GET['detail']]){
unset($_GET['Dolche']);
unset($_GET['detail']);
unset($preview);
$textURL="dolche/content/html/errorDetail.inc.php";
}
}
if(isset($preview)){
// generiert detail anzeige
if(isset($_GET['detail'])){
$detailTextURL=$previewList[$preview][$_GET['detail']]['text'];
//einlesen artikle beschreibung
if(!file_exists($detailTextURL)){
$detailFile=array("Für Artikel ".$_GET['detail']," zur zeit keine Informationen zur Verfügung ");
}else{
$detailFile=file($detailTextURL);
}
$artC=$previewList[$preview][$_GET['detail']]['artNr'];
$uri=$_SERVER['REQUEST_URI'];
$locationtxt=$previewList[$preview][$_GET['detail']]['text'];
$locationth=$previewList[$preview][$_GET['detail']]['thumb'];
$locationimg=$previewList[$preview][$_GET['detail']]['image'];
// include(_BASE.'dolche/php/sql_hit.php');
$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'];
include(_ROOT."dolche/php/order/callart2.inc");
include (_ROOT."dolche/php/order/tokorb_01.inc");
$orderLine=$form.$meldung_korb;
$detailText="".$detailText."\n".$orderLine."\n
";
$detailImage=$previewList[$preview][$_GET['detail']]['image'];
if(file_exists(str_replace('https://www.melbar.de/',_BASE.'melbar/',$detailImage))){
$new_size=img_size(str_replace('https://www.melbar.de/',_BASE.'melbar/',$detailImage),340,250);
$detailImage="
";
}else{
$detailImage="
";
}
$previewContantText=implode(" ",file(_ROOT.'content/html/detail.inc.php'));
} // ende Detail
else{
$previewContantText=implode(" ",file(_ROOT.'content/html/preview.inc.php'));
If($preview=='BootDagger')
$metaPreview='BootDagger Stiefeldolche';
else
$metaPreview=$preview;
$metaTitle=$metaPreview." Dolche im Dolch Shop ";
$metaDesc=$metaPreview." Dolche im Dolch Shop. Dolche OnlineShop";
$metaKw=str_replace(" ",",",$metaPreview).", Dolche,".$metaKw;
} // else detail
// Baut Vorschauliste
$previewContent="\n\n".$preview." Dolche
\n
\n";
if(strstr($preview,'Tactical')){
$previewContent=str_replace('Tactical','Tactical Daggers / Taktische Dolche ',$previewContent);
}
if(strstr($preview,'Boot')){
$previewContent=str_replace('BootDagger Dolche','BootDagger - Siefeldolche',$previewContent);
}
$zeilenCounter=0;
// echo '',var_dump($previewList),'
';
foreach($previewList[$preview] as $article){
$zeilenCounter++;
if(!file_exists(str_replace('https://www.melbar.de/',_BASE.'melbar/',$article['thumb']))){
$article['thumb']="https://www.dolche.de/content/images/tnoimage.png";
}
$new_size=img_size(str_replace('https://www.melbar.de/',_BASE.'melbar/',$article['thumb']),80,120);
$tempFile=$article['text'];
if(!file_exists($tempFile))
$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(_BASE."melbar/Djin/con_02.inc");
$query="SELECT ARTI,DM,aktion, nml FROM preis01 WHERE ARTC = '".$article['artNr']."' ";
$previewRes=mysqli_query($_CNID, $query);
echo mysqli_error($_CNID);
$zusatz=mysqli_fetch_row($previewRes);
if($zusatz[1]==0 OR $zusatz[3]==1){
$zeilenCounter=$zeilenCounter-1;
CONTINUE;
}
if(($zusatz[2]==0)){
if(!empty($zusatz[1]))
$preis=$zusatz[1]." €
";
else
$preis="n.n.
";
}else{
$preis="SP: ".$zusatz[2]." € - ".$zusatz[1]."
";
}
if(empty($zusatz[0]))
$zusatz[0]='Dolch n.a.';
$previewSet="
".str_replace("-","",$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(_BASE.$textURL);
$welcom=ob_get_contents();
ob_end_clean();
}
//create Menue
$MenueList=array_unique($MenueList);
$M_Item=file('content/html/meune-line.inc.php');
$MenueListing='';
foreach($MenueList as $M_item_put){
$temp_Line=str_replace('<*Mtitle*>',$M_item_put.' Dolche',$M_Item[0]);
$temp_Line=str_replace('BootDagger','BootDagger Stiefeldolche',$temp_Line);
$temp_Line=str_replace('Tactical','Tactical Dagger Taktische Dolche',$temp_Line);
$temp_Line=str_replace('<*Mtext*>',$M_item_put,$temp_Line);
$temp_Line=str_replace('<*Murl*>',$M_item_put,$temp_Line);
$MenueListing.=$temp_Line."\n";
}
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);
$previewContantText=str_replace('BootDagger','BootDagger - Siefeldolche',$previewContantText);
$resource=implode(" ",file('content/html/index.inc.php'));
// 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*>',$_SERVER['HTTP_REFERER'],$resource);
$resource=str_replace('<*order*>',$orderContent,$resource);
$resource=str_replace('<*wki*>',$sub_STRING,$resource);
$resource=str_replace('<*menue*>',$MenueListing,$resource);
$resource=str_replace('<*css*>',$css,$resource);
echo $resource;
//echo '',var_dump($_SESSION),'
';
//echo '',var_dump($_POST),'
';
//echo '',var_dump($_GET),'
';
?>