<?php
  define('AUTH_INC',true);
  
  //return;
  
  
  #region Required
  {
  require_once('../PHP/class.pagegen.php');
  $pgen = new page_gen(true);
  
  require_once('../PHP/config.php');
  require_once('../PHP/functions.php');
  require_once('../PHP/initlang.php');
  require_once('../PHP/kosar.inc.php');
  require_once('../PHP/user.inc.php');
  
  }
  #endregion


header("Content-type: text/xml; charset=UTF-8");

echo '<?xml version="1.0" encoding="UTF-8" ?>';


  $pages = null;
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/','lastmod'=>date('Y-m-d'),'changefreq'=>'daily','priority'=>1.0);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/hirek.html','changefreq'=>'weekly','priority'=>0.6);
  $pages[] = array('loc'=>'http://leddiszkont.hu/referenciak.html','changefreq'=>'monthly','priority'=>0.4);
  $pages[] = array('loc'=>'http://leddiszkont.hu/tablazatok.html','changefreq'=>'monthly','priority'=>0.4);
  $pages[] = array('loc'=>'http://leddiszkont.hu/vasarlasi-feltetelek.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://leddiszkont.hu/kis-videok.html','changefreq'=>'monthly','priority'=>0.4);
  $pages[] = array('loc'=>'http://leddiszkont.hu/mindent-a-led-vilagarol.html','changefreq'=>'monthly','priority'=>0.5);
  $pages[] = array('loc'=>'http://leddiszkont.hu/viszonteladoknak.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://leddiszkont.hu/cegunkrol.html','changefreq'=>'monthly','priority'=>0.3);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/kapcsolat.html','changefreq'=>'monthly','priority'=>0.95);
  $pages[] = array('loc'=>'http://leddiszkont.hu/kosar.html','changefreq'=>'monthly','priority'=>0.6);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/kiemelt-akciok.html','changefreq'=>'weekly','priority'=>0.8);
  for($i=1;$i< $DB->GetOne('SELECT COUNT(*) FROM termekek WHERE akcios=? ',array('Y'))%$options['onepage'] ;$i++)
    $pages[] = array('loc'=>'http://leddiszkont.hu/kiemelt-akciok.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/vegkiarusitas.html','changefreq'=>'weekly','priority'=>0.75);
  for($i=1;$i< $DB->GetOne('SELECT COUNT(*) FROM termekek WHERE vtszszj LIKE ? ',array('%v%'))%$options['onepage']; $i++)
    $pages[] = array('loc'=>'http://leddiszkont.hu/vegkiarusitas.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/ujdonsagok.html','changefreq'=>'weekly','priority'=>0.75);
  for($i=1;$i< $DB->GetOne('SELECT COUNT(*) FROM termekek WHERE vtszszj LIKE ? ',array('%u%'))%$options['onepage']; $i++)
    $pages[] = array('loc'=>'http://leddiszkont.hu/ujdonsagok.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://leddiszkont.hu/mintadarabok.html','changefreq'=>'weekly','priority'=>0.7);
  
    
  $sql = $DB->GetArray('SELECT DISTINCT e6 FROM termekek WHERE e6 IS NOT NULL AND e6<>\'\'');
  $kategoriak=array();
  foreach($sql as $row)
  { 
    $arr = explode(',',$row);
    if(is_array($arr))
    {
      foreach($arr as $row2)
        $kategoriak[trim($row2)] = trim($row2);
    }
    else
    {
      $kategoriak[trim($row)] = trim($row);
    }
  }
  
  
  foreach( $kategoriak as $row )
  {
    
    $pages[] = array('loc'=>'http://leddiszkont.hu/'.ekezetnelkul($row).'/termekek.html','changefreq'=>'weekly','priority'=>0.75);  
    
    for($i=1;$i< $DB->GetOne('SELECT COUNT(*) FROM termekek WHERE e6_encoded LIKE ? ',array('%'.ekezetnelkul($row).'%'))%$options['onepage']; $i++)
      $pages[] = array('loc'=>'http://leddiszkont.hu/'.ekezetnelkul($row).'/termekek.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.7.(mt_rand(0,9)));
      
  }
  
  $sql = $DB->Execute('SELECT * FROM termekek WHERE 1');
  
  while( $row = $sql->FetchRow() )
  {
    $pages[] = array('loc'=>'http://leddiszkont.hu/'.ekezetnelkul($row['e6']).'/'.ekezetnelkul($row['e12']).'/'.$row['cikkszam'].'/adatlap.html','changefreq'=>'weekly','priority'=>'0.'.mt_rand(65,80)); 
  }
  
  
  
?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">


    <?php


    foreach($pages as $row) {
    $loc = ( stripslashes($row['loc']) );

    echo "

    <url>
        <loc>".$loc."</loc>
        ".($row['lastmod']?'<lastmod>'.$row['lastmod'].'</lastmod>':'')."
        ".($row['changefreq']?'<changefreq>'.$row['changefreq'].'</changefreq>':'')."
        ".($row['priority']?'<priority>'.$row['priority'].'</priority>':'')."
    </url>";

 } ?>

</urlset>