<?php
include '../includes/connection.php';
session_start();
$branch=$_SESSION['branch_id'];
$idd=$_GET['id'];
$sql = "SELECT * FROM staff where staff_code='$idd' && branch_id='$branch'";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
        echo "<h4>Name: ".$row['full_name'].", Code: ".$row['staff_code']."</h4>";
} else {
    echo "invalid";
}

?>