<?php
session_start();
require_once '../config.php'; // Ensure this is included BEFORE using $config_basedir

if (empty($_SESSION['SESS_LOGGEDIN'])) {
    header("Location: " . $config_basedir . "../tracking.php");
    exit();
}
?>





<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from velocitycourierlogistics.com/track.php?order_track=ZEN7673616506 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Apr 2024 19:11:47 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
	<meta charset="UTF-8">
	<meta name="keywords" content="Courier DEPRIXA-Integral Web System">
	<meta name="author" content="Jaomweb">
	<meta name="description" content="">
	<!-- For IE -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- For Resposive Device -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- For Window Tab Color -->
	<!-- Chrome, Firefox OS and Opera -->
	<meta name="theme-color" content="#fff">
	<!-- Windows Phone -->
	<meta name="msapplication-navbutton-color" content="#fff">
	<!-- iOS Safari -->
	<meta name="apple-mobile-web-app-status-bar-style" content="#fff">
	<title><?php echo $title ?></title>
	<!-- favicon -->
	<link rel="icon" type="image/png" sizes="16x16" href="../img/favicon.png">
	<!-- Bootstrap -->
	<link href="assetz/css_main_deprixa/main_deprixa/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<!-- Icons -->
	<link href="assetz/css_main_deprixa/main_deprixa/css/materialdesignicons.min.css" rel="stylesheet" type="text/css" />
	<!-- Main css -->
	<link href="assetz/css_main_deprixa/main_deprixa/css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="assetz/css_main_deprixa/main_deprixa/css/styles.css">
	<link rel="stylesheet" href="assetz/css_main_deprixa/css/bundle.html">
	<link rel="stylesheet" type="text/css" href="assetz/css_main_deprixa/main_deprixa/main.css">
	<link rel="stylesheet" href="assetz/css_main_deprixa/main_deprixa/themify-icons.css">
	<link rel="stylesheet" href="assetz/custom_dependencies/track_online_shopping.css">

	<script>
		function mostrarMensaje(id) {
			var popup = document.getElementById("myPopup_" + id);
			popup.classList.toggle("show");
		}
	</script>

</head>

<body>

	<!-- Loader -->
	<div id="preloader">
		<div id="status">
			<div class="spinner">
				<div class="double-bounce1"></div>
				<div class="double-bounce2"></div>
			</div>
		</div>
	</div>
	<!-- Loader -->

	<!-- Navbar STart -->
	<header id="topnav" class="defaultscroll sticky">
		<div class="container">
			<!-- Logo container-->
			<div>
				<a class="logo" href="/">
					<img src="../img/LOGO.png" alt="<?php echo $domain_name ?>" width="190" height="45"/>				</a>
			</div>
			<div class="buy-button">
				<a href="logout.php" class="btn btn-secondary btn-sm"> Home</a>
			</div>
			<!--end login button-->
			<div class="menu-extras">
				<div class="menu-item">
					<!-- Mobile menu toggle-->
					<a class="navbar-toggle">
						<div class="lines">
							<span></span>
							<span></span>
							<span></span>
						</div>
					</a>
					<!-- End mobile menu toggle-->
				</div>
			</div>
		</div>
	</header>
	<!-- Navbar End -->



























	<!-- ERROR PAGE -->


<style>
.bg-home {
    position: relative;
    height: 100px;
    overflow: hidden;
    color: white; /* optional, improves text visibility */
}

.bg-home::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('../img/Truck-Transparent-Background.png') no-repeat center center;
    background-size: cover;
    /*filter: blur(4px);*/
    z-index: 1;
}

.bg-home .home-center,
.bg-home .home-desc-center {
    position: relative;
    z-index: 2;
}
</style>

<section class="">
    <div class='home-center'>
			<div class='home-desc-center'>
				<div class='container'>
					<div class='checkout-form'>
						
	<div class="bg-home">					</div>
						
						<div class='row'>
							
								<div class='col-lg-7'>
									<div class='user-profile-data'>

    
    

									
									
									
									
									
									
									
									
									
									
									
									
						<?php
require_once '../config.php';
session_start();

$id = $_SESSION['SESS_USERID'] ?? null;

if (!$id) {
    exit("No session ID found.");
}

// Use prepared statement for safe query
$stmt = $pdo->prepare("SELECT * FROM packages WHERE id = :id LIMIT 1");
$stmt->execute(['id' => $id]);
$ordrow = $stmt->fetch(PDO::FETCH_ASSOC);

if (!$ordrow) {
    exit("No package found for this ID.");
}

// Now you can echo the HTML with data safely
echo "
<div class='row'>
    <div class='col-md-3'>
        <div class='trackstatus-title'>
            <p><span class='ti-package align-top' style='font-size: 30px;'></span> <b>{$ordrow['consignment_status']}</b></p>
            <label> </label>
        </div>
    </div>
    <div class='col-md-5'>
        <div class='trackstatus-title'>
            <label>Shipment Tracking <b>{$ordrow['tracking_code']}</b></label>
        </div>
    </div>
    <div class='col-md-4'>
        <div class='trackstatus-title'>
            <a class='btn btn-secondary btn-sm' target='blank' href='print-invoice/invoice-print.php?id={$ordrow['id']}'><i style='color:white' class='ti-printer'></i>&nbsp;Print Shipment</a>
        </div>
    </div>
</div>

<!-- General Information -->
<div class='payment-wrap'>
    <div class='row'>
        <div class='col-md-12'>
            <div class='track-title'>
                <h5 class='form_sub' style='background-color: #5a6d90; border-radius: 3px; color:white'>Sender</h5>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-location-pin align-top' style='font-size: 30px;'></span> <label>City Collection</br> <b>{$ordrow['sdr_address']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-location-pin align-top' style='font-size: 30px;'></span> <label>Origin City</br> <b>{$ordrow['comp_location']}</b></label>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-calendar align-top' style='font-size: 30px;'></span> <label>Date of shipment</br> <b>{$ordrow['departure_date']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='form-group'>
                <div class='track-title'>
                    <span class='ti-timer align-top' style='font-size: 30px;'></span> <label>Shipping time</br>
                        <b>{$ordrow['arrival_time']}</b></label>
                </div>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <label>Contact Name</br> <b>{$ordrow['sdr_name']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='form-group'>
                <div class='track-title'>
                    <span class='ti-direction-alt align-top' style='font-size: 30px;'></span> <label>Contact Address</br> <b>{$ordrow['sdr_address']}</b></label>
                </div>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <label>Shipping quantity</br> <b>{$ordrow['consignment_quantity']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='form-group'>
                <div class='track-title'>
                    <label>Total Cost</br> <b>&#36;{$ordrow['total_cost']}</b></label>
                </div>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-12'>
            <div class='form-group'>
                <div class='track-title'>
                    <span class='ti-comment-alt align-top' style='font-size: 30px;'></span>
                    <label>Description</br> <b>{$ordrow['parcel_details']}</b></label>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Recipient Information -->
<div class='payment-wrap'>
    <div class='row'>
        <div class='col-md-12'>
            <div class='track-title'>
                <h5 class='form_sub' style='background-color: #5a6d90; border-radius: 3px; color:white'>Recipient</h5>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-location-pin align-top' style='font-size: 30px;'></span> <label>Delivery city</br> <b>{$ordrow['recv_location']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-location-pin align-top' style='font-size: 30px;'></span> <label>Destination city</br> <b>{$ordrow['final_destination']}</b></label>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <span class='ti-calendar align-top' style='font-size: 30px;'></span> <label>Shipping time</br> <b>{$ordrow['arrival_time']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='form-group'>
                <div class='track-title'>
                    <span class='ti-timer align-top' style='font-size: 30px;'></span> <label>Estimated delivery date</br> <b>{$ordrow['arrival_date']}</b></label>
                </div>
            </div>
        </div>
    </div>
    <div class='row'>
        <div class='col-md-6'>
            <div class='track-title'>
                <label>Contact Name</br> <b>{$ordrow['recv_name']}</b></label>
            </div>
        </div>
        <div class='col-md-6'>
            <div class='form-group'>
                <div class='track-title'>
                    <span class='ti-direction-alt align-top' style='font-size: 30px;'></span> <label>Contact Address</br> <b>{$ordrow['recv_address']}</b></label>
                </div>
            </div>
        </div>
    </div>
</div>
";
?>













									</div> <!-- /.user-profile-data -->
								</div> <!-- /.col- -->


									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									<div class='col-lg-5'>
										<br><br><br>
										<div class='booking-summary_block'>
											<div class='booking-summary-box'>
												<h5>Shipping History</h5>
																				
																				
																				
																				
																				<?php
require_once '../config.php'; // Includes $pdo
session_start();

$id = $_SESSION['SESS_USERID'] ?? null;

if (isset($_GET['func']) && $_GET['func'] === 'conf') {

    // Validate and sanitize the incoming ID
    $validid = pf_validate_number($_GET['id'], "redirect", $config_basedir);

    // Update using PDO
    $stmt = $pdo->prepare("UPDATE logins SET verify = 2 WHERE id = :id");
    $stmt->execute(['id' => $validid]);

} else if (isset($_GET['func'])) {
    // Redirect to user index if 'func' is set but not 'conf'
    header("Location: " . $config_basedir . "../user/index.php");
    exit;
}
?>

 		
 		
 		
 		
 		
 		
 		
 		
 		
 		
 		
 			
	<?php
require_once '../config.php'; // <-- make sure $pdo is initialized in here
session_start();

$id = $_SESSION['SESS_USERID'] ?? null;
if (!$id) {
    header("Location: " . $config_basedir . "tracking.php");
    exit;
}

$stmt = $pdo->prepare("SELECT * FROM locations WHERE trackid = :trackid ORDER BY id DESC LIMIT 100");
$stmt->execute(['trackid' => $id]);
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>

<!-- Leaflet.js CDN -->
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>

<style>
.map-container {
    height: 250px;
     width: 250px;
    border-radius: 1px;
    margin-top: 10px;
    overflow: hidden;
}
</style>

<?php $mapIndex = 0; ?>
<?php foreach ($rows as $row): ?>
    <?php
        $location = htmlspecialchars($row['current_location']);
        $mapId = 'map_' . $mapIndex;
    ?>
    <div class="track-cost">
        <ul class="timeline a">
            <li class="event">
                <div class="row">
                    <div class="col-md-7">
                        <p class="text-left button5"><?= htmlspecialchars($row['arrival_date']) ?></p>
                        <h6 class="text-left button4">
                            <?= htmlspecialchars($row['delivery_status']) ?><br>
                            <?= htmlspecialchars($row['consignment_status']) ?>
                        </h6>
                    </div>
                    <div class="col-md-5">
                        <p class="text-right button5"><?= htmlspecialchars($row['arrival_time']) ?></p>
                       
                        <h6><?= $location ?></h6>
                       <!--<a href="https://www.openstreetmap.org/search?query=<?= urlencode($location) ?>" target="_blank" class="btn btn-warning mt-2">Open Full Map</a>-->
                        <div id="<?= $mapId ?>" class="map-container"></div>
                        
                        
                    </div>
                </div>
            </li>
        </ul>
    </div>

    <script>
    fetch('https://nominatim.openstreetmap.org/search?format=json&q=<?= urlencode($location) ?>')
        .then(response => response.json())
        .then(data => {
            if (data.length > 0) {
                const lat = parseFloat(data[0].lat);
                const lon = parseFloat(data[0].lon);
               const map = L.map("<?= $mapId ?>").setView([lat, lon], 16);
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
    attribution: '&copy; <a href="https://www.esri.com/">Esri</a>, Earthstar Geographics',
    maxZoom: 19
}).addTo(map);

                L.marker([lat, lon]).addTo(map).bindPopup("<?= addslashes($location) ?>");
            } else {
                document.getElementById("<?= $mapId ?>").innerHTML = "<p class='text-danger'>Location not found</p>";
            }
        })
        .catch(() => {
            document.getElementById("<?= $mapId ?>").innerHTML = "<p class='text-danger'>Map load error</p>";
        });
    </script>

    <?php $mapIndex++; ?>
<?php endforeach; ?>


		
		
		
		
		
		
		
		
		
		
		
		
													
													
													
													
								<?php
require_once '../config.php';
session_start();

$id = $_SESSION['SESS_USERID'] ?? null;

if ($id) {
    $stmt = $pdo->prepare("SELECT * FROM groundstate WHERE id = :id LIMIT 1");
    $stmt->execute(['id' => $id]);
    $ordrow = $stmt->fetch(PDO::FETCH_ASSOC);

    if ($ordrow) {
        $location = htmlspecialchars($ordrow['current_location']);
        $mapId = 'map_groundstate';
        ?>

        <div class="track-cost">
            <ul class="timeline a">
                <li class="event">
                    <div class="row">
                        <div class="col-md-7">
                            <p class="text-left button5"><?= htmlspecialchars($ordrow['arrival_date']) ?></p>
                            <h6 class="text-left button4">
                                <?= htmlspecialchars($ordrow['delivery_status']) ?><br>
                                <?= htmlspecialchars($ordrow['consignment_status']) ?><br>
                                <?= htmlspecialchars($ordrow['sdr_address']) ?>
                            </h6>
                        </div>
                        <div class="col-md-5">
                            <p class="text-right button5"><?= htmlspecialchars($ordrow['arrival_time']) ?></p>
                            <h6><?= $location ?></h6>
                            <div id="<?= $mapId ?>" class="map-container"></div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>

        <script>
        fetch('https://nominatim.openstreetmap.org/search?format=json&q=<?= urlencode($location) ?>')
            .then(response => response.json())
            .then(data => {
                if (data.length > 0) {
                    const lat = parseFloat(data[0].lat);
                    const lon = parseFloat(data[0].lon);
                    const map = L.map("<?= $mapId ?>").setView([lat, lon], 16);
                    L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
                        attribution: '&copy; <a href="https://www.esri.com/">Esri</a>, Earthstar Geographics',
                        maxZoom: 19
                    }).addTo(map);
                    L.marker([lat, lon]).addTo(map).bindPopup("<?= addslashes($location) ?>");
                } else {
                    document.getElementById("<?= $mapId ?>").innerHTML = "<p class='text-danger'>Location not found</p>";
                }
            })
            .catch(() => {
                document.getElementById("<?= $mapId ?>").innerHTML = "<p class='text-danger'>Map load error</p>";
            });
        </script>

        <?php
    } else {
        echo "<div class='alert alert-warning'>No tracking information found.</div>";
    }
} else {
    echo "<div class='alert alert-danger'>User session not found.</div>";
}
?>

									
									
									
									
									
									
									
									
									
									
									
									

								
						</div> <!-- /.row -->
					</div> <!-- /.checkout-form -->
				</div> <!-- /.container -->
			</div>
		</div>
	</section>
	
	




















	<!-- ERROR PAGE -->

	<!-- Back to top -->
	<a href="#" class="back-to-top rounded text-center" id="back-to-top">
		<i class="ti-angle-up d-block"> </i>
	</a>
	<!-- Back to top -->


	<!-- jQuery first, then Popper.js, then Bootstrap JS -->
	<!-- jQuery -->
	<script src="assetz/vendor/jquery.2.2.3.min.js"></script>
	<!-- Popper js -->
	<script src="assetz/vendor/popper.js/popper.min.js"></script>
	<!-- Bootstrap JS -->
	<script src="assetz/vendor/bootstrap/js/bootstrap.min.js"></script>
	<!-- menu  -->
	<script src="assetz/vendor/mega-menu/assets/js/custom.js"></script>
	<!-- js ui -->
	<script src="assetz/vendor/jquery-ui/jquery-ui.min.js"></script>
	<script src="assetz/css_main_deprixa/js/bootstrap.bundle.min.js"></script>
	<script src="assetz/css_main_deprixa/js/jquery.easing.min.html"></script>
	<script src="assetz/css_main_deprixa/js/scrollspy.min.html"></script>
	<!-- Main Js -->
	<script src="assetz/css_main_deprixa/js/app.js"></script>
	<!-- Theme js -->
	<script src="assetz/css_main_deprixa/js/theme.html"></script>

	</div> <!-- /.main-page-wrapper -->
	
	
	

<!-- Add this to the bottom of your HTML -->
<style>
#multiChatBtn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    border: none;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#multiChatPopup {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 260px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 15px;
    display: none;
    z-index: 9999;
    font-family: Arial, sans-serif;
}

#multiChatPopup h4 {
    background-color: #b58ee3;
    color: white;
    margin: -15px -15px 10px -15px;
    padding: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-size: 16px;
}

#multiChatPopup p {
    font-size: 14px;
    color: #444;
}

.chat-icons {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.chat-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: white;
}

.chat-icons a.whatsapp { background-color: #25D366; }
.chat-icons a.telegram { background-color: #0088cc; }
.chat-icons a.messenger { background-color: #0078FF; }

.chat-icons i {
    font-size: 18px;
}

</style>

<!-- Floating Button -->
<button id="multiChatBtn">✆</button>

<!-- Popup Chat Box -->
<div id="multiChatPopup">
    <h4>Chat Make Things Easy</h4>
    <p>Thanks for reaching <?php echo $domain_name ?>. You are welcome to Chat us on Whatsapp/Telegram/Facebook at anytime.</p>
    <div class="chat-icons">
        <a href="https://wa.me/<?php echo $whatsapp?>" target="_blank" title="WhatsApp">
        <img src="https://img.icons8.com/color/48/000000/whatsapp.png" alt="WhatsApp" style="margin: 5px;">
    </a>
    <a href="https://t.me/<?php echo $service2?>" target="_blank" title="Telegram">
        <img src="https://img.icons8.com/color/48/000000/telegram-app.png" alt="Telegram" style="margin: 5px;">
    </a>
    <a href="https://m.me/<?php echo $service3?>" target="_blank" title="Messenger">
        <img src="https://img.icons8.com/color/48/000000/facebook-messenger.png" alt="Messenger" style="margin: 5px;">
    </a>
    
    <a href="<?php echo $developa ?>" target="_blank" title="Messenger">
        <img src="CHAT/SMARTSUOO.png" alt="Messenger" style="margin: 5px;">
    </a>
    
    </div>
</div>

<!-- Font Awesome (for icons) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />

<!-- Toggle Script -->
<script>
document.getElementById("multiChatBtn").addEventListener("click", function () {
    const popup = document.getElementById("multiChatPopup");
    popup.style.display = popup.style.display === "block" ? "none" : "block";
});
</script>



<!-- TRANSLATOR POPUP - Middle Right -->
<style>
/* Position the translator trigger */
.translator-trigger {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    background-color: #f1f1f1;
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Style for the translator container */
#ytWidget {
    position: fixed;
    top: 50%;
    right: 70px;
    transform: translateY(-50%);
    z-index: 9998;
    display: none;
}

/* Additional translator widget styles */
#yt-widget .yt-listbox__col {
    display: block !important;
    list-style: none;
    vertical-align: top;
    max-width: 90% !important;
}
.yt-listbox {
    min-width: 200px !important;
    max-width: 500px !important;
    max-height: 500px !important;
    padding: 10px 10px !important;
    overflow: auto !important;
}
#yt-widget.yt-state_bottom .yt-listbox {
    bottom: unset !important;
}
.yt-listbox li {
    display: block !important;
}
.yt-servicelink {
    display: none !important;
}
</style>

<!-- Translator Trigger Icon -->
<div class="translator-trigger" onclick="toggleTranslator()">
    🌐
</div>

<!-- Translator Container -->
<div id="ytWidget"></div>

<!-- Yandex Translator Script -->
<script src="https://translate.yandex.net/website-widget/v1/widget.js?widgetId=ytWidget&pageLang=en&widgetTheme=light&autoMode=true" type="text/javascript"></script>

<!-- Toggle Script -->
<script>
function toggleTranslator() {
    const widget = document.getElementById("ytWidget");
    widget.style.display = widget.style.display === "none" || widget.style.display === "" ? "block" : "none";
}
</script>

</body>


<!-- Mirrored from velocitycourierlogistics.com/track.php?order_track=ZEN7673616506 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Apr 2024 19:12:02 GMT -->
</html>