<?php
require_once "../../includes/db.php";
require_once "../../includes/functions.php";
require_once "../../includes/auth.php";
ensure_manager();

$id = intval($_GET['id']);
$status = intval($_GET['status']);
$restaurant_id = $_SESSION['restaurant_id'];

db()->prepare("UPDATE branches SET active=? WHERE id=? AND restaurant_id=?")
   ->execute([$status,$id,$restaurant_id]);

echo "success";
