<?php
include '_connect.php';
$name = $_GET['FNAME'];
if (!$conn) {
    die('Could not connect: ' . mysqli_error($conn));
}
?>
<table table width="500" border="1" class="table table-bordered table-striped">
  <tr class="text-blue">
    <?php
    //$sql = "SELECT * FROM mdl_user WHERE firstname = '".$name."'";
    //$result = $conn->query($sql);
    $sql="SELECT * FROM [EHONGDB].[dbo].[EMPLOYEE] WHERE FNAME = '$name' ";
    $select=$conn->prepare($sql);
    $select->execute();
    // echo $sql;
    ?>
    <td width="150"><center>รหัสพนักงาน</center></td>
    <td width="250"><center>ชื่อ-นามสกุล</center></td>
    <td width="100"><center>สถานะ</center></td>
    <td width="100"><center>เพิ่ม</center></td>
  </tr>
  <?php
    while($fetch=$select->fetch())
    {
  ?>
  <tr>
      <td><center><?php echo "$fetch[US_NAME]";?></center></td>
      <td><center><?php echo "$fetch[TNAME]";?><?php echo "$fetch[FNAME]";?> <?php echo "$fetch[LNAME]";?></center></td>
      <td><center><?php echo "$fetch[EM_STATUS]";?></center></td>
      <td><center><a href="add.php?EMP_ID=<?php echo $fetch["EMP_ID"];?>"><img src="img/plus.png" alt="" width="35%" height="auto"></a></center></td>
  </tr>
      <?php } ?>
</table>
