checkbox ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
g3ckO
Forum Contributor
Posts: 117
Joined: Mon Jul 12, 2004 2:57 am
Location: Malaysia
Contact:

checkbox ??

Post by g3ckO »

I want to make a form for the superior to approve the leave application made by the staff under them.

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");
?>
I will list all the application made by the staff with their name, date leave start, date leave end and date leave apply

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".
Post Reply