Update Banyak
This commit is contained in:
+53
-181
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
// error_reporting(1);
|
||||
error_reporting(0);
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 0);
|
||||
|
||||
$ppnnow = 11;
|
||||
|
||||
@@ -284,14 +286,12 @@ $statuspaygw = $datastatus['status_payment_gateway'];
|
||||
<!--jquery http-->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- Load Google Maps API library -->
|
||||
<script>
|
||||
(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
|
||||
key: "AIzaSyA1MgLuZuyqR_OGY3ob3M52N46TDBRI_9k",
|
||||
v: "weekly",
|
||||
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
||||
// Add other bootstrap parameters as needed, using camel case.
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="dist/js/leaflet/leaflet.css" />
|
||||
<script src="dist/js/leaflet/leaflet.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="dist/js/leaflet/leaflet.fullscreen.css" />
|
||||
<script src="dist/js/leaflet/Leaflet.fullscreen.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
/* Styling untuk marquee container */
|
||||
.marquee-container {
|
||||
@@ -402,32 +402,50 @@ $statuspaygw = $datastatus['status_payment_gateway'];
|
||||
</div>
|
||||
</li> -->
|
||||
<!-- Notifications Dropdown Menu -->
|
||||
<!-- <li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#">
|
||||
<i class="far fa-bell"></i>
|
||||
<span class="badge badge-warning navbar-badge">15</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
|
||||
<span class="dropdown-item dropdown-header">15 Notifications</span>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" class="dropdown-item">
|
||||
<i class="fas fa-envelope mr-2"></i> 4 new messages
|
||||
<span class="float-right text-muted text-sm">3 mins</span>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" class="dropdown-item">
|
||||
<i class="fas fa-users mr-2"></i> 8 friend requests
|
||||
<span class="float-right text-muted text-sm">12 hours</span>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" class="dropdown-item">
|
||||
<i class="fas fa-file mr-2"></i> 3 new reports
|
||||
<span class="float-right text-muted text-sm">2 days</span>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" class="dropdown-item dropdown-footer">See All Notifications</a>
|
||||
</div>
|
||||
</li> -->
|
||||
<?php if($_SESSION['master']) { ?>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#">
|
||||
<i class="far fa-bell"></i>
|
||||
<span class="badge badge-warning navbar-badge">2</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right"
|
||||
style="border-radius: 15px; box-shadow: 0 8px 20px rgba(0,0,0,0.15); overflow:hidden;">
|
||||
|
||||
<!-- Header -->
|
||||
<span class="dropdown-item dropdown-header"
|
||||
style="background: linear-gradient(135deg, #3498db, #8e44ad);
|
||||
color:#fff; font-weight:bold; border-bottom:1px solid #eee;">
|
||||
🔔 2 Notifications
|
||||
</span>
|
||||
|
||||
<!-- Notif 1: AI Customer Service -->
|
||||
<a href="?<?= encrypt_url('whatsapp_gateway/customer_ai'); ?>" class="dropdown-item"
|
||||
style="padding:15px; display:flex; align-items:center;">
|
||||
<i class="fas fa-robot text-primary" style="font-size:20px; margin-right:12px;"></i>
|
||||
<div>
|
||||
<div style="font-weight:bold; color:#2c3e50;">Fitur Baru: AI Customer Service</div>
|
||||
<small style="color:#888;">New</small>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<!-- Notif 2: Voucher Auto Pilot -->
|
||||
<a href="?<?= encrypt_url('ganerate_voucher'); ?>" class="dropdown-item"
|
||||
style="padding:15px; display:flex; align-items:center;">
|
||||
<i class="fas fa-ticket-alt text-success" style="font-size:20px; margin-right:12px;"></i>
|
||||
<div>
|
||||
<div style="font-weight:bold; color:#2c3e50;">Fitur Baru: Voucher Auto Pilot</div>
|
||||
<small style="color:#888;">17 Agt 2025</small>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (isset($_SESSION['master'])) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link">
|
||||
@@ -840,154 +858,8 @@ $statuspaygw = $datastatus['status_payment_gateway'];
|
||||
})
|
||||
|
||||
</script>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA1MgLuZuyqR_OGY3ob3M52N46TDBRI_9k&callback=initMap" async defer></script>
|
||||
<script>
|
||||
var map;
|
||||
var marker;
|
||||
|
||||
function initMap() {
|
||||
var latitudeInput = document.getElementById('latitude').value;
|
||||
var longitudeInput = document.getElementById('longitude').value;
|
||||
|
||||
// Cek apakah input form memiliki nilai
|
||||
if (latitudeInput && longitudeInput) {
|
||||
var pos = {
|
||||
lat: parseFloat(latitudeInput),
|
||||
lng: parseFloat(longitudeInput)
|
||||
};
|
||||
initMapWithPos(pos);
|
||||
} else {
|
||||
// Jika input form kosong, gunakan geolocation
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
var pos = {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
};
|
||||
initMapWithPos(pos);
|
||||
updateFormInputs(pos.lat, pos.lng);
|
||||
}, function() {
|
||||
handleLocationError(true);
|
||||
});
|
||||
} else {
|
||||
handleLocationError(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fungsi untuk menginisialisasi peta dengan posisi yang diberikan
|
||||
function initMapWithPos(pos) {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: pos,
|
||||
zoom: 17,
|
||||
mapTypeId: 'hybrid',
|
||||
mapTypeControl: false,
|
||||
streetViewControl: false,
|
||||
fullscreenControl: true,
|
||||
});
|
||||
|
||||
updateMarker(pos.lat, pos.lng);
|
||||
|
||||
// Event listener untuk menambahkan marker saat peta diklik
|
||||
map.addListener('click', function(e) {
|
||||
var latitude = e.latLng.lat().toFixed(6);
|
||||
var longitude = e.latLng.lng().toFixed(6);
|
||||
updateMarker(latitude, longitude);
|
||||
updateFormInputs(latitude, longitude);
|
||||
});
|
||||
}
|
||||
|
||||
// Fungsi untuk menampilkan marker pada peta
|
||||
function updateMarker(latitude, longitude) {
|
||||
if (marker) {
|
||||
marker.setPosition({lat: parseFloat(latitude), lng: parseFloat(longitude)});
|
||||
} else {
|
||||
marker = new google.maps.Marker({
|
||||
position: {lat: parseFloat(latitude), lng: parseFloat(longitude)},
|
||||
map: map
|
||||
});
|
||||
}
|
||||
|
||||
map.setCenter(marker.getPosition());
|
||||
}
|
||||
|
||||
// Fungsi untuk memperbarui nilai input form
|
||||
function updateFormInputs(latitude, longitude) {
|
||||
document.getElementById('latitude').value = latitude;
|
||||
document.getElementById('longitude').value = longitude;
|
||||
|
||||
// Perbarui input latlong
|
||||
document.getElementById('latlong').value = `${latitude}, ${longitude}`;
|
||||
}
|
||||
|
||||
// Tangani error jika geolocation tidak berhasil
|
||||
function handleLocationError(browserHasGeolocation) {
|
||||
alert(browserHasGeolocation ?
|
||||
'Error: The Geolocation service failed.' :
|
||||
'Error: Your browser doesn\'t support geolocation.');
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const latlongInput = document.getElementById('latlong');
|
||||
|
||||
// Ambil input tersembunyi berdasarkan atribut data-maps
|
||||
const latitudeInput = document.querySelector('input[data-maps="latitude"]');
|
||||
const longitudeInput = document.querySelector('input[data-maps="longitude"]');
|
||||
|
||||
// Set nilai latlong jika latitude dan longitude sudah ada
|
||||
if (latitudeInput.value && longitudeInput.value) {
|
||||
latlongInput.value = `${latitudeInput.value}, ${longitudeInput.value}`;
|
||||
}
|
||||
|
||||
latlongInput.addEventListener('input', function() {
|
||||
const latlongValue = latlongInput.value.split(',');
|
||||
|
||||
// Validasi format latitude dan longitude
|
||||
const latLongRegex = /^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$/; // Format: latitude, longitude
|
||||
if (latLongRegex.test(latlongInput.value.trim())) {
|
||||
// Pastikan kita memiliki dua nilai: latitude dan longitude
|
||||
if (latlongValue.length === 2) {
|
||||
const lat = latlongValue[0].trim();
|
||||
const long = latlongValue[1].trim();
|
||||
|
||||
// Update input tersembunyi
|
||||
latitudeInput.value = lat;
|
||||
longitudeInput.value = long;
|
||||
|
||||
// Update marker dan center peta
|
||||
updateMarker(lat, long);
|
||||
map.setCenter({lat: parseFloat(lat), lng: parseFloat(long)});
|
||||
}
|
||||
} else {
|
||||
// Jika format tidak valid, beri delay sebelum menampilkan pesan
|
||||
setTimeout(function() {
|
||||
latlongInput.value = ''; // Kosongkan nilai
|
||||
latlongInput.placeholder = 'Isi dengan format yang sesuai'; // Tampilkan pesan
|
||||
latitudeInput.value = ''; // Kosongkan input tersembunyi
|
||||
longitudeInput.value = ''; // Kosongkan input tersembunyi
|
||||
}, 500); // Delay 500ms
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk mengupdate latlong input saat latitude atau longitude diubah
|
||||
latitudeInput.addEventListener('input', function() {
|
||||
const lat = latitudeInput.value;
|
||||
const long = longitudeInput.value;
|
||||
|
||||
// Update latlong input
|
||||
latlongInput.value = `${lat}, ${long}`;
|
||||
});
|
||||
|
||||
longitudeInput.addEventListener('input', function() {
|
||||
const lat = latitudeInput.value;
|
||||
const long = longitudeInput.value;
|
||||
|
||||
// Update latlong input
|
||||
latlongInput.value = `${lat}, ${long}`;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const dropdown0 = document.getElementById('dropdown0');
|
||||
|
||||
Reference in New Issue
Block a user