<?
require_once('functions.php');
$type='BACK OFFICE';
  $dbc=mysqli_connect("localhost","gurudumu_bazuu2","@@karishop@@2023!!","gurudumu_pos");
Permission($_SESSION['department'],$type);

if($_POST['submitted']){
$id=$_POST['id'];
$status=$_POST['sure'];
//$conn='1000';
if($id){
if($status=='Yes'){
$f="select * from accounts where id='$id'";
$ff=mysqli_query($dbc,$f);
while($row=mysqli_fetch_array($ff)){
	    

$t="update accounts set status='ACTIVE' where id='$id'";
$tt=mysqli_query($dbc,$t);

}

;
}
}

$url='indexx.php';
ob_end_clean();
header("Location: $url");
}
?>


<?
//require_once('conf.php');
$id = $_GET['id'];
$r=mysqli_query($dbc,("select * from accounts where id='$id'"));
$row=mysqli_fetch_array($r);
 echo '<form action="active_c.php"method="post">
 <h3>Account Name: ' . $row['name'] . '</h3>
 <p><b>Are you sure you want to Activate  This Customer Account ?<br />
 <input type="radio" name="sure"
value="Yes" /> Yes
 <input type="radio" name="sure" value=
"No" checked="checked" /> No</p>
 <p><input type="submit" name="submit"
value="Activate Account" /></p>
 <input type="hidden" name="submitted"
value="TRUE" />
 <input type="hidden" name="id" value="'
. $id . '" />
 </form>';
 



 ?>
 