How to automatic update status? : [this is the image][1]I have a problem on how to update all status in one click. As you can see in the picture, if I click the lock it will then automatically update all status of the student to "lock", if I click the unlock button also it will automatic the status into "unlock", how to do that?
Here's my code:

    <a href="unlock.php"  title="Lock"><img src="images/lock.png" height="40" width="40"></a>
    								
    <a href="lock.php" title="Unlock"><img style="margin-left:8px;" src="images/unlock.png" height="40" width="40"></a>

when I click the lock.php here's what the codes like:

    <?php
    			include '../connection/connect.php';
    				include '../dbcon.php';
    				
    $idnum=$_POST['idnum'];
    $stat='LOCK';
    $sqla = "UPDATE student 
          SET status=?
    	WHERE idno=?";
    $qa = $db->prepare($sqla);
    $qa->execute(array($stat,$idnum));
    			
    	Header ('Location:lock_unlock.php');
    	}
    ?>
      


  [1]: http://i.stack.imgur.com/CMUVY.png