<?php
include "dbPDO.php";
if(isset($_POST["branch_id"]))
{
	$branchID = $_POST["branch_id"];
	$output = array();
	$sql = $db->prepare("SELECT * FROM branches WHERE branchID = ? LIMIT 1");
	$sql->bindParam(1,$branchID);
	$sql->execute();
  if($sql->rowCount()>0){$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["branchID"]   = $row["branchID"];
		$output["b_name"]     = $row["b_name"];
    	$output["b_boss"]     = $row["b_boss"];
		$output["phone"]      = $row["phone"];
    	$output["phone2"]     = $row["phone2"];
		$output["b_boss2"]    = $row["b_boss2"];
    	$output["phoneB2"]    = $row["phoneB2"];
		$output["location"]   = $row["location"];
    	$output["start_date"] = $row["start_date"];
		$output["comm"]   	  = $row["comm"];
   }
	echo json_encode($output);
}
