<?

include ("config.php");

header("Content-type: text/xml"); 


echo '<';
echo '?xml version="1.0" encoding="UTF-8"?';
echo '>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
';

$sql = mysql_query("SELECT * from antwoorden_116 where vraag10='Actief'  and koppelid != 660 order by vraag20 desc") or sql_error();
while ($row = mysql_fetch_array($sql))
{
	$this_titel = $row["vraag3"];
	$this_omschrijving = $row["vraag4"];
	$this_url = "http://www.interieurdeal.com" . opdrachtUrl($row["koppelid"],$row["vraag2"],$this_titel);
	

	echo "<url>\n";
	echo "<loc>" . $this_url . "</loc>\n";
	echo "</url>\n";
}

$sql = mysql_query("SELECT * from antwoorden_113 where vraag25='Actief' and vraag118 > 0 and koppelid != 61") or sql_error();
while ($row = mysql_fetch_array($sql))
{
	$this_url = "http://www.interieurdeal.com" .  winkelurl($row["koppelid"],$row["vraag1"],$row["vraag6"]);

	echo "<url>\n";
	echo "<loc>" . $this_url . "</loc>\n";
	echo "</url>\n";
}



$thisArray = array(1,2,10,3,4,32,5,6,17,37);


foreach ($thisArray as $key => $waarde)
{	
	
	if ($waarde == 6 or $waarde == 17)
	{
		foreach ($cfg["nav"][$waarde]["childs"] as $key2 => $waarde2)
		{
			$this_pagnaam = ($cfg["nav"][$waarde2]["naam"]);
			$this_url = "http://www.interieurdeal.com" . url_pages($waarde2);
			
			echo "<url>\n";
			echo "<loc>" . $this_url . "</loc>\n";
			echo "</url>\n";
		
		}
	}
	else
	{
		$this_pagnaam = ($cfg["nav"][$waarde]["naam"]);
		$this_url = "http://www.interieurdeal.com" . url_pages($waarde);
				
		echo "<url>\n";
		echo "<loc>" . $this_url . "</loc>\n";
		echo "</url>\n";
	
	}
}




foreach ($cfg["groepen"] as $key => $waarde)
{
	$tellen++;
	$this_titel = $cfg["groepen"][$key]["titel"];
	$this_titel2 = $cfg["groepen"][$key]["titel"];
	$this_hoofdgroepnaam = $cfg["groepen"][$key]["hoofdtitel"];
	$this_vertonen = $cfg["groepen"][$key]["vertonen"];
	$this_aantal = $cfg["groepen"][$key]["aantal"];
	$this_url = productsoortUrl($key);
	
	
	if ($cfg["groepen"][$key]["seo-titel"])
	{
		$this_url1 = "http://www.interieurdeal.com/" . $cfg["groepen"][$key]["seo-keyword"] . "/";
		$this_titel2 = $cfg["groepen"][$key]["seo-titel"] . " kopen";
	}
	
	if ($this_vertonen != "Nee")
	{
		echo "<url>\n";
		echo "<loc>" . $this_url1 . "</loc>\n";
		echo "</url>\n";
	
	
		//printr($cfg["groepen"][$key]);
		//exit;
		foreach ($cfg["groepen"][$key]["seo-keyword-kopen"] as $key2 => $waarde2)
		{
			//$waarde2 = trim($waarde2);
			//if ($waarde2)
			
			if (($key == 29 or $key == 38) and $key2 > 0)
			{
				$this_url = "http://www.interieurdeal.com/" . $cfg["groepen"][$key]["seo-keyword"] . "/" . seo_urlencode2($waarde2) . ".html";
			}
			else
			{
				$this_url = "http://www.interieurdeal.com/" . $cfg["groepen"][$key]["seo-keyword"] . "/" . seo_urlencode2($waarde2) . "-kopen.html";
			}
				
				echo "<url>\n";
				echo "<loc>" . $this_url . "</loc>\n";
				echo "</url>\n";
			
			
		}
	}
}


$sql2 = mysql_query("select * from antwoorden_144 where vraag5 > '0'") or sql_error();
while ($row2 = mysql_fetch_array($sql2))
{
	$this_url = "http://www.interieurdeal.com/" . $row2["vraag6"] . ".html";
	
	echo "<url>\n";
	echo "<loc>" . $this_url . "</loc>\n";
	echo "</url>\n";
}

$sql2 = mysql_query("select * from antwoorden_145 where vraag5 > '0'") or sql_error();
while ($row2 = mysql_fetch_array($sql2))
{
	$this_groepid = $row2["vraag5"];
	$this_dir1 = $cfg["groepen"][$this_groepid]["seo-keyword"];
	$this_url = "http://www.interieurdeal.com/$this_dir1-prijzen/" . $row2["vraag6"] . ".html";
	
	echo "<url>\n";
	echo "<loc>" . $this_url . "</loc>\n";
	echo "</url>\n";
}
			






foreach ($cfg["groepen"] as $key => $waarde)
{
	$tellen++;
	$this_titel = $cfg["groepen"][$key]["titel"];
	$this_hoofdgroepnaam = $cfg["groepen"][$key]["hoofdtitel"];
	$this_vertonen = $cfg["groepen"][$key]["vertonen"];
	$this_aantal = $cfg["groepen"][$key]["aantal"];
	$this_url = "http://www.interieurdeal.com" . productsoortUrl($key);
	
	if ($this_vertonen != "Nee")
	{
		echo "<url>\n";
		echo "<loc>" . $this_url . "</loc>\n";
		echo "</url>\n";
	}
}

foreach ($cfg["groepen"] as $key => $waarde)
{
	$tellen++;
	$this_titel = $cfg["groepen"][$key]["titel"];
	$this_hoofdgroepnaam = $cfg["groepen"][$key]["hoofdtitel"];
	$this_vertonen = $cfg["groepen"][$key]["vertonen"];
	$this_aantal = $cfg["groepen"][$key]["aantal"];
	$this_url = "http://www.interieurdeal.com" . productsoortUrl($key);
	
	if ($this_vertonen != "Nee")
	{
	
		$seo_keyword = $cfg["groepen"][$key]["seo-keyword"];
	
		$cfg["plaatsArray"] = gemeentearray(90);
				
		foreach ($cfg["plaatsArray"] as $key2 => $waarde2)
		{
			$this_url = $cfg["websiteroot"] . $seo_keyword . "-" . seo_urlencode2($waarde2) . ".html";
			
			echo "<url>\n";
			echo "<loc>" . $this_url . "</loc>\n";
			echo "</url>\n";
		}
	}
}

$thisArray = array();
$thisArray[] = "merken/";

$this_query = "select * from antwoorden_153 where vraag4 != 'Nee'";
$sql = mysql_query($this_query) or sql_error();
while ($row = mysql_fetch_array($sql))
{
	$this_merkid = $row["koppelid"];
	$this_merk = $row["vraag1"];
	
	$productgroepenidArray = pipe2array($row["vraag3"]);
	$productgroepenArray = array();
	
	$thisArray[] = "merken/" . seo_urlencode2($this_merk) . "/";
	
	foreach ($productgroepenidArray as $key => $waarde)
	{
		if ($waarde == 29 or $waarde == 38)
		{
		}
		elseif ($waarde and $cfg["productgroepen-titel"][$waarde])
		{
			$thisArray[] = "merken/" . seo_urlencode2($this_merk) . "/" . seo_urlencode2($this_merk . " " . $cfg["productgroepen-titel"][$waarde]) . "/";
		}
	}
}

$thisArray[] = "luxaflex/";
$thisArray[] = "eijffinger-gordijnen/";
$thisArray[] = "heuga-tapijttegels/";

$nr1 = $url_chunks2[$laatste_chunk];
		

$this_query = "select * from antwoorden_152 where vraag42 != 'Nee'";
$sql = mysql_query($this_query) or sql_error();
while ($row = mysql_fetch_array($sql))
{
	$this_groepid = $row["vraag41"];
	$this_luxaflex_soort = $row["vraag1"];
	$this_seo_url = $row["vraag39"];
	$this_merk = $row["vraag43"];
	
	$thisArray[] = seo_urlencode2($this_merk) . "/" . $this_seo_url . "/";
	
	$fotoArray = getfotoArray(152,$row["koppelid"],3,38,$row);
	
	$aantal = count($fotoArray);
	
	for ($i=1;$i<=$aantal;$i++)
	{
		$thisArray[] = seo_urlencode2($this_merk) . "/" . $this_seo_url . "/" . $this_seo_url . "_$i.html";
	}
	
	
}

$sql = mysql_query("select koppelid, vraag17, vraag10 from antwoorden_30 where (vraag16 = '' or vraag16 = '0') and vraag17 != '' order by vraag17 asc") or sql_error();
while ($row = mysql_fetch_array($sql))
{
	$thisArray[] = "interieurwinkel/" . seo_urlencode2($row["vraag17"] . "-" . $row["vraag10"]) . "_b-" . $row["koppelid"] . ".html";
}

foreach ($thisArray as $key => $waarde)
{
	echo "<url>\n";
	echo "<loc>" . $cfg["websiteroot"] . $waarde . "</loc>\n";
	echo "</url>\n";
}
?>
</urlset>