<?php 
    session_start();
    if(!$_SESSION['id']){
        header('location:index.php');
    }

   $id=$_GET['id'];
   $status=$_GET['status'];
require_once '../system/conn.php';
   if($status==0){
	    $query = " UPDATE `branch` SET `status`='1' WHERE id='".$_GET['id']."' ";
		$statement = $conn->prepare($query)->execute($data);
		if($statement){
		  echo " <script>window.location.assign('branch-list.php')</script>";
		}else{
		    echo "not inserted";
		  }
	}else{
		$query = " UPDATE `branch` SET `status`='0' WHERE id='".$_GET['id']."' ";
		//print_r($query);exit;
		$statement = $conn->prepare($query)->execute($data);
		if($statement){
		  echo " <script>window.location.assign('branch-list.php')</script>";
		}else{
		    echo "not inserted";
		  }
	}

?>