164 lines
7.1 KiB
HTML
Executable File
164 lines
7.1 KiB
HTML
Executable File
<!DOCTYPE html>
|
||
<html lang="fr">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Scraper Pro - H3R7Tech</title>
|
||
<style>
|
||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||
body { font-family: -apple-system, sans-serif; background: #1a1a2e; color: #eee; padding: 20px; }
|
||
header { background: linear-gradient(90deg, #00d9ff, #7b2cbf); padding: 20px; text-align: center; margin: -20px -20px 20px; border-radius: 0 0 20px 20px; }
|
||
h1 { font-size: 28px; }
|
||
.logo { text-align: center; padding: 10px; }
|
||
.logo img { width: 80px; border-radius: 10px; }
|
||
|
||
.search-box { background: #16213e; padding: 20px; border-radius: 12px; margin-bottom: 20px; }
|
||
.search-box h2 { color: #00d9ff; margin-bottom: 15px; }
|
||
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
|
||
input, select { flex: 1; min-width: 150px; padding: 12px; background: #0f3460; border: 1px solid #333; border-radius: 8px; color: #fff; }
|
||
button { padding: 12px 24px; background: #00d9ff; border: none; border-radius: 8px; color: #000; font-weight: bold; cursor: pointer; }
|
||
button:hover { background: #00b8d4; }
|
||
|
||
.quick-add { background: #16213e; padding: 20px; border-radius: 12px; }
|
||
.quick-add h2 { color: #00d9ff; margin-bottom: 15px; }
|
||
|
||
.result { background: #0f3460; padding: 15px; margin: 10px 0; border-radius: 8px; border-left: 4px solid #00d9ff; }
|
||
.result h3 { color: #00d9ff; margin-bottom: 8px; }
|
||
.result p { color: #aaa; margin: 5px 0; font-size: 14px; }
|
||
|
||
.actions { display: flex; gap: 10px; margin-top: 10px; }
|
||
.btn-add { background: #7b2cbf; color: #fff; }
|
||
.btn-crm { background: #e94560; color: #fff; }
|
||
|
||
a { color: #00d9ff; }
|
||
|
||
.home-btn{position:fixed;top:10px;left:10px;z-index:9999;background:linear-gradient(135deg,#00d9ff,#7b2cbf);color:#fff;border:none;border-radius:8px;padding:10px 15px;font-size:14px;cursor:pointer;text-decoration:none;display:flex;align-items:center;gap:8px;box-shadow:0 2px 10px rgba(0,217,255,0.3);transition:all 0.3s;font-family:-apple-system,BlinkMacSystemFont,sans-serif}.home-btn:hover{transform:translateY(-2px);box-shadow:0 4px 15px rgba(0,217,255,0.5)}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<a href="https://portal-kolifee.duckdns.org/" class="home-btn" title="Retour au portail"><span style="font-size:18px">🏠</span><span>Accueil</span></a>
|
||
<div class="logo">
|
||
<img src="/turf/H3R7Tech_logo.png" alt="H3R7Tech">
|
||
</div>
|
||
|
||
<header>
|
||
<h1>🔍 Scraper Pro - H3R7Tech</h1>
|
||
</header>
|
||
|
||
<div class="search-box">
|
||
<h2>📋 Ajout Manuel de Prospects</h2>
|
||
<p style="color:#888;margin-bottom:15px;">Les annuaires professionnels bloquent les scrapers automatiques. Ajoutez les prospects manuellement ici.</p>
|
||
|
||
<div class="form-row">
|
||
<input type="text" id="nom" placeholder="Nom du professionnel *">
|
||
<input type="text" id="entreprise" placeholder="Nom de l'entreprise">
|
||
</div>
|
||
<div class="form-row">
|
||
<input type="tel" id="tel" placeholder="Téléphone">
|
||
<input type="email" id="email" placeholder="Email">
|
||
</div>
|
||
<div class="form-row">
|
||
<input type="text" id="adresse" placeholder="Adresse">
|
||
<select id="secteur">
|
||
<option value="Artisan">Artisan</option>
|
||
<option value="Cordonnier">Cordonnier</option>
|
||
<option value="Boulanger">Boulanger</option>
|
||
<option value="Plombier">Plombier</option>
|
||
<option value="Electricien">Électricien</option>
|
||
<option value="Macon">Maçon</option>
|
||
<option value="Peintre">Peintre</option>
|
||
<option value="Autre">Autre</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-row">
|
||
<select id="source">
|
||
<option value="Recherche manuelle">Recherche manuelle</option>
|
||
<option value="PagesJaunes">PagesJaunes</option>
|
||
<option value="Google">Google</option>
|
||
<option value="Recommandation">Recommandation</option>
|
||
</select>
|
||
<button onclick="addToCRM()">➕ Ajouter au CRM</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="quick-add">
|
||
<h2>💾 Derniers Ajouts</h2>
|
||
<div id="last-added">Chargement...</div>
|
||
</div>
|
||
|
||
<div style="text-align:center;margin:30px 0;">
|
||
<a href="/crm/">📊 Ouvrir CRM</a> |
|
||
<a href="/">← Retour Portail</a>
|
||
</div>
|
||
|
||
<script>
|
||
const CRM_API = '/crm/api/prospects';
|
||
|
||
function loadLastAdded() {
|
||
fetch(CRM_API)
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
const prospects = (data.prospects || []).slice(-5).reverse();
|
||
const div = document.getElementById('last-added');
|
||
|
||
if (prospects.length === 0) {
|
||
div.innerHTML = '<p style="color:#666;">Aucun prospect</p>';
|
||
return;
|
||
}
|
||
|
||
div.innerHTML = prospects.map(p => `
|
||
<div class="result">
|
||
<h3>${p.nom}</h3>
|
||
<p>📍 ${p.entreprise || '-'} | 📞 ${p.tel || '-'} | 🏷️ ${p.secteur}</p>
|
||
</div>
|
||
`).join('');
|
||
});
|
||
}
|
||
|
||
function addToCRM() {
|
||
const nom = document.getElementById('nom').value;
|
||
if (!nom) {
|
||
alert('Le nom est requis!');
|
||
return;
|
||
}
|
||
|
||
const prospect = {
|
||
nom: nom,
|
||
entreprise: document.getElementById('entreprise').value || nom,
|
||
tel: document.getElementById('tel').value,
|
||
email: document.getElementById('email').value,
|
||
secteur: document.getElementById('secteur').value,
|
||
source: document.getElementById('source').value,
|
||
statut: 'nouveau',
|
||
score: 3,
|
||
notes: 'Adresse: ' + document.getElementById('adresse').value
|
||
};
|
||
|
||
fetch(CRM_API, {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify(prospect)
|
||
})
|
||
.then(r => r.json())
|
||
.then(d => {
|
||
if (d.success) {
|
||
alert('✅ Prospect ajouté!');
|
||
// Clear form
|
||
document.getElementById('nom').value = '';
|
||
document.getElementById('entreprise').value = '';
|
||
document.getElementById('tel').value = '';
|
||
document.getElementById('email').value = '';
|
||
document.getElementById('adresse').value = '';
|
||
loadLastAdded();
|
||
} else {
|
||
alert('❌ Erreur: ' + (d.error || 'Inconnue'));
|
||
}
|
||
})
|
||
.catch(e => alert('❌ Erreur: ' + e.message));
|
||
}
|
||
|
||
// Load last added on start
|
||
loadLastAdded();
|
||
</script>
|
||
</body>
|
||
</html>
|