<?php
/* ─────────────────────────────────────────────
   sitemap.xml.php — upload as sitemap.xml
   Outputs valid XML sitemap including all blog
   posts dynamically from DB
───────────────────────────────────────────── */
require_once("codelibrary/inc/variables.php");
require_once("codelibrary/inc/functions.php");

header("Content-Type: application/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <!-- ── CORE PAGES ── -->
  <url><loc>https://www.cloudycoders.com/</loc><changefreq>weekly</changefreq><priority>1.0</priority></url>
  <url><loc>https://www.cloudycoders.com/about/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/pricing/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/contact/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/case-studies/</loc><changefreq>weekly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/blog/</loc><changefreq>daily</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/career/</loc><changefreq>weekly</changefreq><priority>0.7</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-implementation/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/zoho/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/sitemap/</loc><changefreq>monthly</changefreq><priority>0.3</priority></url>

  <!-- ── SERVICE PAGES ── -->
  <url><loc>https://www.cloudycoders.com/sales-cloud/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/service-cloud/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/integration-cloud/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/marketing-cloud/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/commerce-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/app-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/appexchange-app-development/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/configure-price-quote/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/mulesoft-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/lightning-web-components/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/health-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/financial-services-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/manufacturing-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/education-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/non-profit-cloud/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-pardot/</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>

  <!-- ── LOCATION PAGES ── -->
  <url><loc>https://www.cloudycoders.com/salesforce-partner-new-york/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-partner-texas/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-partner-california/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-partner-chicago/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>
  <url><loc>https://www.cloudycoders.com/salesforce-partner-florida/</loc><changefreq>monthly</changefreq><priority>0.9</priority></url>

  <!-- ── LEGAL ── -->
  <url><loc>https://www.cloudycoders.com/privacy-policy/</loc><changefreq>yearly</changefreq><priority>0.3</priority></url>
  <url><loc>https://www.cloudycoders.com/terms-condtions/</loc><changefreq>yearly</changefreq><priority>0.3</priority></url>
  <url><loc>https://www.cloudycoders.com/refund-policy/</loc><changefreq>yearly</changefreq><priority>0.3</priority></url>
  <url><loc>https://www.cloudycoders.com/disclaimer/</loc><changefreq>yearly</changefreq><priority>0.3</priority></url>

<?php
/* ── BLOG POSTS — dynamic from DB ── */
$blog_res = mysql_query_db("select page_url, post_date from cloudyco_blog.tbl_blog where status=1 order by id desc");
while($b = mysql_fetch_db($blog_res)):
  $date = date('Y-m-d', strtotime($b['post_date']));
?>
  <url><loc>https://www.cloudycoders.com/blog/<?php echo htmlspecialchars($b['page_url']); ?>/</loc><lastmod><?php echo $date; ?></lastmod><changefreq>yearly</changefreq><priority>0.6</priority></url>
<?php endwhile; ?>

</urlset>