<?php
include_once("../class/class.MySQL.php");
$db	=new MySQL();
$action = $_GET['act'];

$userid		= $_GET['userid'];

if($action == "update")
{
	$data['branch_name']	 		= $_POST['branch_name'];
	$data['comp_id']	 			= $_POST['company_nameid'];
	$data['brch_code']	 			= $_POST['branch_code'];
	$data['brch_address'] 			= $_POST['branch_address'];
	$data['brch_phno'] 			    = $_POST['phnum'];
	$data['brch_contactno'] 		= $_POST['contact_details'];
	$data['brch_tin'] 			    = $_POST['tin_num'];
	$data['brch_sales'] 			= $_POST['sales_tax_num'];
	$data['brch_service_tax'] 		= $_POST['service_tax_num'];
	$data['brch_shops'] 			= $_POST['shop_estb_licencenum'];
	if($_POST['chk_halfday'] == 'on')
	{
		$brchalf = '1';
	}
	else
	{
		$brchalf = '0';
	}
	$data['brch_half'] 				= $brchalf;
	$where['branch_id']	 = $_POST['userid'];
	$db->Update('branches',$data,$where);
	echo json_encode($data);
	
	
	
	
}


?>