This is the query:
Code: Select all
<?php
session_start();
include("database.php");
$user=addslashes($_SESSION[username]);
$query="SELECT * FROM `leave` a INNER JOIN `employee` b ON b.`StaffNo` = a.`Super` WHERE b.`username` = '$user'AND a.`Status` = 'Pending
Review'";
$result=mysql_query($query) or die(mysql_error());
$num=mysql_numrows($result);
$i=0;
while ($i < $num)
{
$nama = mysql_result($result,$i,"Nama"); //name
$jawatan = mysql_result($result,$i,"Jawatan");
$staffno = mysql_result($result,$i,"StaffNo");
$jenis = mysql_result($result,$i,"Jenis");
$mula = mysql_result($result,$i,"DateMula"); //date start
$tamat = mysql_result($result,$i,"DateTamat"); //date end
$mohon = mysql_result($result,$i,"DateMohon"); // date apply
$refid = mysql_result($result,$i,"RefID");
$jumlah = mysql_result($result,$i,"Jumlah");
$status = mysql_result($result,$i,"Status");
$access = mysql_result($result,$i,"AccType");
$ack_by = mysql_result($result,$i,"EmpName");
?>The question is how can I include a checkbox that will allow the superior to select which application that they want to approved from the list.
One more things, what variable should I call to indicate that the checkbox is checked or not to change the status in the database from "Pending Review" to "Approved".