<table border="1" cellspacing="5" cellpadding="5" width="100%"> <thead> <tr> </tr> </thead> <tbody> <?php require_once('db.php'); $result = $conn->prepare("SELECT * FROM tbl_user where status = 'activate' ORDER BY tbl_user_id ASC"); $result->execute(); for($i=0; $row = $result->fetch(); $i++){ $id=$row['tbl_user_id']; $user_name=$row['user_name']; ?> <tr> <td> <a href="deactivate.php<?php echo '?tbl_user_id='.$id; ?>" onclick="return confirm(' De-Activate account ( <?php echo $user_name?> ) ? ');"> <button type="submit" class="btn_confirm"> Edit Status </button> </a> </td> </tr> <?php } ?> </tbody> </table>
<?php include 'db.php'; $get_id=$_REQUEST['tbl_user_id']; $sql = "UPDATE tbl_user SET status ='deactivate' WHERE tbl_user_id = '$get_id' "; echo "<script>alert('Successfully Edit The Status!'); window.location='index.php'</script>"; ?>
<table border="1" cellspacing="5" cellpadding="5" width="100%"> <thead> <tr> </tr> </thead> <tbody> <?php require_once('db.php'); $result1 = $conn->prepare("SELECT * FROM tbl_user where status = 'deactivate' ORDER BY tbl_user_id ASC"); $result1->execute(); for($i=0; $row1 = $result1->fetch(); $i++){ $id1=$row1['tbl_user_id']; $user_name1=$row1['user_name']; ?> <tr> <td> <a href="activate.php<?php echo '?tbl_user_id='.$id1; ?>" onclick="return confirm(' Activate account ( <?php echo $user_name1?> ) ? ');"> <button type="submit" class="btn_confirm"> Edit Status </button> </a> </td> </tr> <?php } ?> </tbody> </table>
<?php include 'db.php'; $get_id=$_REQUEST['tbl_user_id']; $sql = "UPDATE tbl_user SET status ='activate' WHERE tbl_user_id = '$get_id' "; echo "<script>alert('Successfully Edit The Status!'); window.location='index.php'</script>"; ?>