-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin.php
More file actions
105 lines (83 loc) · 3.98 KB
/
Copy pathjoin.php
File metadata and controls
105 lines (83 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php include('includes/header.php'); ?>
<h2 class="mt-3">Bergabung dengan DKR Sidamulih</h2>
<p>Ingin menjadi bagian dari DKR Sidamulih? Isi formulir berikut untuk bergabung:</p>
<form class="mt-3" id="joinForm">
<div class="mb-3">
<label for="name" class="form-label">Nama Lengkap</label>
<input type="text" class="form-control" id="name" placeholder="Nama Lengkap" required>
</div>
<div class="mb-3">
<label for="school" class="form-label">Asal Sekolah/Instansi</label>
<input type="text" class="form-control" id="school" placeholder="Asal Sekolah/Instansi" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" placeholder="email@example.com" required>
</div>
<div class="mb-3">
<label for="phone" class="form-label">Nomor Telepon</label>
<input type="text" class="form-control" id="phone" placeholder="Nomor Telepon" required>
</div>
<!-- Tombol Kirim Email -->
<button type="button" class="btn btn-primary" onclick="sendEmail(event)">
<i class="fas fa-envelope"></i> Kirim via Gmail
</button>
<!-- Tombol Kirim WhatsApp -->
<button type="button" class="btn btn-success ms-2" onclick="sendWhatsApp(event)">
<i class="fab fa-whatsapp"></i> Kirim via WhatsApp
</button>
</form>
<script>
function sendEmail(event) {
event.preventDefault(); // Mencegah form dari pengiriman default
// Ambil data dari form
const name = document.getElementById('name').value;
const school = document.getElementById('school').value;
const email = document.getElementById('email').value;
const phone = document.getElementById('phone').value;
// Cek apakah semua data terisi dengan benar
if (!name || !school || !email || !phone) {
alert("Semua field harus diisi.");
return;
}
// Format template email
const subject = encodeURIComponent('Pendaftaran Anggota DKR Sidamulih');
const body = encodeURIComponent(`Halo Kak perkenalkan nama saya ${name},
Saya berminat dan ingin bergabung dengan DKR Sidamulih. Berikut adalah detail saya:
Asal Sekolah/Instansi: ${school}
Email: ${email}
Nomor Telepon: ${phone}
Atas perhatianya saya ucapkan terima kasih.`);
// Membuat URL ke Gmail
const gmailLink = `https://mail.google.com/mail/?view=cm&fs=1&to=dkrsidamulih@example.com&su=${subject}&body=${body}`;
// Redirect ke Gmail di browser
window.open(gmailLink, '_blank');
}
function sendWhatsApp(event) {
event.preventDefault(); // Mencegah form dari pengiriman default
// Ambil data dari form
const name = document.getElementById('name').value;
const school = document.getElementById('school').value;
const email = document.getElementById('email').value;
const phone = document.getElementById('phone').value;
// Cek apakah semua data terisi dengan benar
if (!name || !school || !email || !phone) {
alert("Semua data harus diisi.");
return;
}
// Format template WhatsApp
const message = encodeURIComponent(`Halo Kak perkenalkan nama saya *${name}*,
Saya berminat dan ingin bergabung dengan DKR Sidamulih. Berikut adalah detail saya:
*Asal Sekolah/Instansi:* ${school}
*Email:* ${email}
*Nomor Telepon:* ${phone}
Atas perhatianya saya ucapkan terima kasih.`);
// Membuat URL ke WhatsApp
const whatsappLink = `https://wa.me/6281573236181?text=${message}`;
// Redirect ke WhatsApp di browser
window.open(whatsappLink, '_blank');
}
</script>
<!-- Link ke Font Awesome untuk Ikon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<?php include('includes/footer.php'); ?>