<style>
  .mytable{
    font-size:16px;
	width:700px;
	margin-top:10px;
	color:#FFFFFF;
  }
  
  .mytableth{
    background-color:#000000;
	color:#FFCC00;
	padding:5px 5px 5px 5px;
  }
  
    .mytabletd{
        background-color: #EEEEEE;
        text-align: center;
        color: #000000;
    }
    
  .mybtn{
    width:100px;
	font-size:14px;
	font-weight: bold;
	font-family: Arial;
    color: #0000FF;
  }
    
  .mytext{
    text-align: center;
    padding: 3px;
  }
</style>

<?
  $qsec = "SELECT * FROM punchsys_section";
  $rsec = mysqli_query($conn,$qsec);
  $nsec = mysqli_num_rows($rsec);
  while($myrow = mysqli_fetch_array($rsec)){
  
    $tid = $myrow["id"];
    $tname = $myrow["name"];
	$arrSec[$tid] = $tname;

  }
?>

<center>
<form action="staff_ordup.php" method="post">
<table border="0" cellpadding="0" cellspacing="1" class="mytable">
<tr>
  <th width="60px" class="mytableth">ID</th>
  <th colspan="2" width="280px" class="mytableth">NAME</th>
  <th width="70px" class="mytableth">SORTING</th>
</tr>
<?
  $qstf = "SELECT * FROM punchsys_staff WHERE id NOT IN ('admin','pejabat') ORDER BY userID, repPrint, CAST(id as SIGNED)";
  $rstf = mysqli_query($conn,$qstf);
  $nstf = mysqli_num_rows($rstf);
?>
<?
  while($myrow = mysqli_fetch_array($rstf)){
  
    $tid = $myrow["id"];
    $tename = $myrow["eName"];
    $tcname = $myrow["cName"];
    $tord = $myrow["repPrint"];

	$textOrder = "arrOrd[$tid]";
      
	$tstatus = $myrow["userID"];
	if($tstatus>0){
	  $tstatus = "style='color: #666666'";
	}else{
	  $tstatus = "style='color: #000000'";
	}
      
?>
<tr class="mytabletd" align="center" <?= $tstatus ?>>
  <td bgcolor="#999999"><?= $tid ?></td>
  <td bgcolor="#CCCCCC"><?= $tename  ?></td>
  <td bgcolor="#CCCCCC"><?= $tcname ?></td>
  <td bgcolor="#999999"><input type="text" name="<?= $textOrder ?>" value="<?= $tord ?>" class="mytext" style=" width:50px" /></td>
</tr>
<?
    $i++;
  }
?>
<tr>
  <th colspan="4" class="mytableth"><input type="submit" value="UPDATE" class="mybtn" /></th>
</tr>
</table>
</form>
</center>
