			<div class="row text-center">
                <div class="col-sm-4 p-2">
					<div class="row stat-box">
						<h6 class="text-center">Attendance</h6>
						<?php	include ('include/ip_location.php');
							// $userIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
							$userIP = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'];
							if (array_key_exists($userIP, $allowedIPs))
								{
								$getlocation = $allowedIPs[$userIP];
								echo '<div class="col"><a href="ams_selfie.php"><div class="icon-wrapper d-bg-dark text-success"><i class="fas fa-id-card"></i></div>
								<strong class="pstrong">Auto AMS</strong></a></div>';
								}
							else{
								$fetch1['AMS_Location'];
								if ( $fetch1['AMS_Location']=="ALL")
									{echo '<div class="col"><a href="ams_mark.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-fingerprint"></i></div>
									<strong class="pstrong">Office In / OUT</strong></a></div>';}
								else if ( $fetch1['AMS_Location']=="Club")
									{echo '<div class="col"><a href="ams_mark_club.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-fingerprint"></i></div>
									<strong class="pstrong">Club In / OUT</strong></a></div>';}
								else {	echo '<div class="col"><a href="ams_mark_selected.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-fingerprint"></i></div>
									<strong class="pstrong">Office In / OUT</strong></a></div>';}	
								}
						?>
						
						
						<div class="col"><a href="viewcurrent.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-eye"></i></div><strong class="pstrong">Current Month</strong></a></div>
						<div class="col"><a href="viewlast.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-scroll"></i></div><strong class="pstrong">Last Month</strong></a></div>
						<?php
						if ($fetch1['Rider_Status'] == 'rider')
							{
							echo '<div class="col-3"><a href="ams_rider.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-biking"></i></div><strong class="pstrong">Conveyance</strong></a></div>';
							}
						?>
					</div> 
                </div>
				<div class="col-sm-4 p-2">
					<div class="row stat-box">
						<h6 class="text-center">Leave</h6>
						<div class="col">
							<a href="leave-request-od.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-business-time"></i></div>
								<strong class="pstrong">Apply OD</strong>
							</a>
						</div>
						<div class="col">
							<a href="leave-request-mis.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-user-clock"></i></div>
								<strong class="pstrong">Apply MIS</strong>
							</a>
						</div>
						<div class="col">
							<a href="leave.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-calendar-check"></i></div>
								<strong class="pstrong">Leave Dashboard</strong>
							</a>
						</div>
					</div> 
                </div>
                <div class="col-sm-4 p-2">
					<div class="row stat-box">
						<h6 class="text-center">AMS Others</h6>
						<?php
						$mtq = mysqli_query($conn, "SELECT * FROM hr_dump WHERE Functional_Reporting='$fetch1[empid]' AND Status='Active'");
						$dteam = ($mtq && mysqli_num_rows($mtq) > 0) ? mysqli_fetch_array($mtq) : null;
						if (!empty($dteam['empid'])) {
							echo '<div class="col"><a href="team.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-users"></i></div><strong class="pstrong">My Team</strong></a></div>';
						}
						?>
						<div class="col">
							<a href="notification-list.php"><div class="icon-wrapper d-bg-dark text-white"><i class="fas fa-bell"></i></div>
								<strong class="pstrong">Notifications</strong>
							</a>
						</div>
						<?php	
						$cm = date('Y-m');
						$leavePending = mysqli_query($conn, "SELECT * FROM emp_leave WHERE Functional_Reporting='$fetch1[Employee_Number]' AND Status='Pending' AND DateFrom LIKE '%$cm%'");
						$dataPending = ($leavePending && mysqli_num_rows($leavePending) > 0) ? mysqli_fetch_array($leavePending) : null;
						if (!empty($dataPending['Status']) && $dataPending['Status'] == 'Pending') {
							echo '<div class="blink text-danger"><b>Pending Team Leaves</b></div>';
						}
						?>
					</div> 
				</div>
            </div>

