{"id":91,"date":"2026-04-19T15:38:49","date_gmt":"2026-04-19T15:38:49","guid":{"rendered":"https:\/\/cashchat.se\/dir\/?page_id=91"},"modified":"2026-04-19T15:38:49","modified_gmt":"2026-04-19T15:38:49","slug":"access","status":"publish","type":"page","link":"https:\/\/cashchat.se\/dir\/access\/","title":{"rendered":"Access"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Admin Panel \u2013 Adase Ads Contacts<\/title>\n  <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n  <link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/6.5.0\/css\/all.min.css\">\n  <script src=\"https:\/\/cdn.sheetjs.com\/xlsx-0.20.2\/package\/dist\/xlsx.full.min.js\"><\/script>\n  <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/html2pdf.js\/0.10.1\/html2pdf.bundle.min.js\"><\/script>\n  <style>\n    :root {\n      --brand-blue: #2563eb;\n      --brand-purple: #8b5cf6;\n      --brand-lemon: #84cc16;\n    }\n    .btn-primary { background-color: var(--brand-blue); }\n    .btn-primary:hover { background-color: #1d4ed8; }\n  <\/style>\n<\/head>\n<body class=\"bg-gray-100 dark:bg-gray-900\">\n\n<div id=\"loginSection\" class=\"flex items-center justify-center min-h-screen p-4\">\n  <div class=\"max-w-md w-full bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8\">\n    <div class=\"text-center mb-6\">\n      <i class=\"fas fa-lock text-4xl text-brand-purple\"><\/i>\n      <h2 class=\"text-2xl font-bold mt-2\">Admin Login<\/h2>\n    <\/div>\n    <form id=\"loginForm\">\n      <div class=\"mb-4\">\n        <label class=\"block text-sm font-medium mb-1\">Email<\/label>\n        <input type=\"email\" id=\"adminEmail\" required class=\"w-full border rounded-lg px-4 py-2 dark:bg-gray-700\">\n      <\/div>\n      <div class=\"mb-6\">\n        <label class=\"block text-sm font-medium mb-1\">Password<\/label>\n        <input type=\"password\" id=\"adminPassword\" required class=\"w-full border rounded-lg px-4 py-2 dark:bg-gray-700\">\n      <\/div>\n      <button type=\"submit\" class=\"btn-primary w-full text-white py-2 rounded-lg font-semibold\">Login<\/button>\n    <\/form>\n  <\/div>\n<\/div>\n\n<div id=\"dashboardSection\" class=\"hidden container mx-auto px-4 py-8\">\n  <div class=\"flex flex-wrap justify-between items-center mb-6 gap-4\">\n    <h1 class=\"text-2xl font-bold\"><i class=\"fas fa-users text-brand-purple\"><\/i> Contact List<\/h1>\n    <div class=\"flex gap-3 flex-wrap\">\n      <button id=\"uploadBtn\" class=\"bg-brand-lemon hover:bg-green-600 text-white px-4 py-2 rounded-lg\"><i class=\"fas fa-upload\"><\/i> Upload CSV\/JSON<\/button>\n      <button id=\"downloadExcelBtn\" class=\"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg\"><i class=\"fas fa-file-excel\"><\/i> Excel<\/button>\n      <button id=\"downloadPdfBtn\" class=\"bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg\"><i class=\"fas fa-file-pdf\"><\/i> PDF<\/button>\n      <button id=\"logoutBtn\" class=\"bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg\"><i class=\"fas fa-sign-out-alt\"><\/i> Logout<\/button>\n    <\/div>\n  <\/div>\n  <div class=\"bg-white dark:bg-gray-800 rounded-2xl shadow-lg overflow-x-auto\">\n    <table class=\"w-full text-sm\" id=\"contactsTable\">\n      <thead class=\"bg-gray-100 dark:bg-gray-700\">\n        <tr>\n          <th class=\"px-4 py-3 text-left\">ID<\/th>\n          <th class=\"px-4 py-3 text-left\">Full Name<\/th>\n          <th class=\"px-4 py-3 text-left\">Email<\/th>\n          <th class=\"px-4 py-3 text-left\">Mobile<\/th>\n          <th class=\"px-4 py-3 text-left\">Country<\/th>\n          <th class=\"px-4 py-3 text-left\">Gender<\/th>\n          <th class=\"px-4 py-3 text-left\">Registered<\/th>\n        <\/tr>\n      <\/thead>\n      <tbody id=\"contactsBody\"><\/tbody>\n    <\/table>\n  <\/div>\n  <input type=\"file\" id=\"fileUploadInput\" accept=\".csv, .json\" class=\"hidden\" \/>\n<\/div>\n\n<script>\n  const VALID_EMAIL = \"data@cashchat.se\";\n  const VALID_PASSWORD = \"adaseAds#\";\n\n  function loadContacts() {\n    const contacts = JSON.parse(localStorage.getItem('adase_contacts') || '[]');\n    const tbody = document.getElementById('contactsBody');\n    if (!tbody) return;\n    tbody.innerHTML = '';\n    contacts.forEach(c => {\n      const row = tbody.insertRow();\n      row.insertCell(0).innerText = c.id;\n      row.insertCell(1).innerText = c.fullname;\n      row.insertCell(2).innerText = c.email;\n      row.insertCell(3).innerText = c.mobile;\n      row.insertCell(4).innerText = c.country;\n      row.insertCell(5).innerText = c.gender;\n      row.insertCell(6).innerText = new Date(c.registeredAt).toLocaleString();\n    });\n  }\n\n  function downloadExcel() {\n    const contacts = JSON.parse(localStorage.getItem('adase_contacts') || '[]');\n    const wsData = [[\"ID\",\"Full Name\",\"Email\",\"Mobile\",\"Country\",\"Gender\",\"Registered Date\"]];\n    contacts.forEach(c => {\n      wsData.push([c.id, c.fullname, c.email, c.mobile, c.country, c.gender, c.registeredAt]);\n    });\n    const ws = XLSX.utils.aoa_to_sheet(wsData);\n    const wb = XLSX.utils.book_new();\n    XLSX.utils.book_append_sheet(wb, ws, \"Contacts\");\n    XLSX.writeFile(wb, `contacts_${new Date().toISOString().slice(0,19)}.xlsx`);\n  }\n\n  function downloadPDF() {\n    const element = document.getElementById('contactsTable');\n    const opt = {\n      margin: [0.5, 0.5, 0.5, 0.5],\n      filename: `contacts_${new Date().toISOString().slice(0,19)}.pdf`,\n      image: { type: 'jpeg', quality: 0.98 },\n      html2canvas: { scale: 2 },\n      jsPDF: { unit: 'in', format: 'a4', orientation: 'landscape' }\n    };\n    html2pdf().set(opt).from(element).save();\n  }\n\n  function uploadContacts(file) {\n    const reader = new FileReader();\n    reader.onload = function(e) {\n      let newContacts = [];\n      const content = e.target.result;\n      if (file.name.endsWith('.json')) {\n        try {\n          newContacts = JSON.parse(content);\n        } catch(err) { alert('Invalid JSON'); return; }\n      } else if (file.name.endsWith('.csv')) {\n        const lines = content.split(\/\\r?\\n\/);\n        const headers = lines[0].split(',');\n        for (let i=1; i<lines.length; i++) {\n          if (!lines[i].trim()) continue;\n          const vals = lines[i].split(',');\n          if (vals.length >= 6) {\n            newContacts.push({\n              id: Date.now() + i,\n              fullname: vals[0],\n              email: vals[1],\n              mobile: vals[2],\n              country: vals[3],\n              gender: vals[4],\n              registeredAt: vals[5] || new Date().toISOString()\n            });\n          }\n        }\n      } else {\n        alert('Please upload CSV or JSON');\n        return;\n      }\n      const existing = JSON.parse(localStorage.getItem('adase_contacts') || '[]');\n      const merged = [...existing, ...newContacts];\n      localStorage.setItem('adase_contacts', JSON.stringify(merged));\n      loadContacts();\n      alert(`Added ${newContacts.length} new contacts`);\n    };\n    reader.readAsText(file);\n  }\n\n  \/\/ Login logic\n  document.getElementById('loginForm').addEventListener('submit', (e) => {\n    e.preventDefault();\n    const email = document.getElementById('adminEmail').value.trim();\n    const pwd = document.getElementById('adminPassword').value.trim();\n    if (email === VALID_EMAIL && pwd === VALID_PASSWORD) {\n      sessionStorage.setItem('adase_admin_logged', 'true');\n      document.getElementById('loginSection').classList.add('hidden');\n      document.getElementById('dashboardSection').classList.remove('hidden');\n      loadContacts();\n    } else {\n      alert('Invalid credentials');\n    }\n  });\n\n  document.getElementById('logoutBtn').addEventListener('click', () => {\n    sessionStorage.removeItem('adase_admin_logged');\n    document.getElementById('loginSection').classList.remove('hidden');\n    document.getElementById('dashboardSection').classList.add('hidden');\n  });\n\n  document.getElementById('downloadExcelBtn').addEventListener('click', downloadExcel);\n  document.getElementById('downloadPdfBtn').addEventListener('click', downloadPDF);\n  document.getElementById('uploadBtn').addEventListener('click', () => {\n    document.getElementById('fileUploadInput').click();\n  });\n  document.getElementById('fileUploadInput').addEventListener('change', (e) => {\n    if (e.target.files.length) uploadContacts(e.target.files[0]);\n    e.target.value = '';\n  });\n\n  \/\/ Check if already logged in\n  if (sessionStorage.getItem('adase_admin_logged') === 'true') {\n    document.getElementById('loginSection').classList.add('hidden');\n    document.getElementById('dashboardSection').classList.remove('hidden');\n    loadContacts();\n  }\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Admin Panel \u2013 Adase Ads Contacts Admin Login Email Password Login Contact List Upload CSV\/JSON Excel PDF Logout ID Full Name Email Mobile Country Gender Registered<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"class_list":["post-91","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/pages\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":1,"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/pages\/91\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/pages\/91\/revisions\/92"}],"wp:attachment":[{"href":"https:\/\/cashchat.se\/dir\/wp-json\/wp\/v2\/media?parent=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}