<?php
  define('AUTH_INC',true);
  
  //return;
  
  
  #region Required
  {
  require_once('../PHP/class.pagegen.php');
  $pgen = new page_gen(true);
  
  require_once('../PHP/config.php');
  
  }
  #endregion


header("Content-type: text/xml; charset=UTF-8");

echo '<?xml version="1.0" encoding="UTF-8" ?>';


  $pages = null;
  
  $pages[] = array('loc'=>'http://ledszaki.hu/','lastmod'=>date('Y-m-d'),'changefreq'=>'daily','priority'=>1.0);
  
  $pages[] = array('loc'=>'http://ledszaki.hu/hirek.html','changefreq'=>'weekly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/altalanos-szerzodesi-feltetelek.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/adatvedelmi-szabalyzat.html','changefreq'=>'monthly','priority'=>0.4);
  $pages[] = array('loc'=>'http://ledszaki.hu/szallitasi-feltetelek.html','changefreq'=>'monthly','priority'=>0.5);
  $pages[] = array('loc'=>'http://ledszaki.hu/kapcsolat-terkep.html','changefreq'=>'monthly','priority'=>0.95;
  
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/G4-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/G9-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/GU10-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/MR16-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/egyeb-kiegeszitok.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/E14-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/E27-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/R7S-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/egyszinu-ledszalag.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/egyszinu-vizallo-ledszalag.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/RGB-ledszalag.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/RGB-vizallo-ledszalag.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/ledszalag-kiegeszitok.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-tapegysegek.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/BA15S-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/BA15Y-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/B83-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/sofita-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/T5-es-T10-foglalat.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-modulok.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-mennyezeti-lampa.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-reflektor.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-fenycso.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-panel.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/asztali-es-olvasolampa.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-karacsonyi-fenyek.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-tablak.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/foglalatok.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-fenyeroszabalyzok-es-vezerlok.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-tapegysegek.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-kiegeszitok-szalagokhoz.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-raktarvilagitas.html','changefreq'=>'monthly','priority'=>0.6);
  $pages[] = array('loc'=>'http://ledszaki.hu/termekek/led-display-es-patika-kereszt.html','changefreq'=>'monthly','priority'=>0.6);
  
  $sql = $DB->Execute('SELECT * FROM termekek WHERE 1');
  
  while( $row = $sql->FetchRow() )
  {
  
    $t = new termek(getUrlstring())
  
    $pages[] = array('loc'=>'http://ledszaki.hu/adatlapok/'.$t.'.html','changefreq'=>'weekly','priority'=>'0.'.mt_rand(65,80)); 
  }
  
  
  $pages[] = array('loc'=>'http://ledszaki.hu/akcios-termekek.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://ledszaki.hu/kiemelt-akciok.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://ledszaki.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://ledszaki.hu/vegkiarusitas.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://ledszaki.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://ledszaki.hu/ujdonsagok.html?from='.($options['onepage']*$i),'changefreq'=>'weekly','priority'=>0.65);
  
  $pages[] = array('loc'=>'http://ledszaki.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://ledszaki.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://ledszaki.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://ledszaki.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>