unset($ret);
    } else {
        $msg = "<div class='alert-error'>Office details entry of subdivision you selected not allowed</div>";
    }
    // prevent form from actually posting (only for demo purposes)
    /*	echo "\nSubDiv: ".$Subdivision."\n";
    	echo "Municipality: ".$Municipality."\n";
    	echo "PoliceStation: ".$PoliceStation."\n";
    	echo "OfficeID: ".$OfficeID."\n";*/
}
?>

<?php 
if (isset($_REQUEST['officeid'])) {
    $offccd = decode($_REQUEST['officeid']);
    $rsOffice = fatch_offcDtl($offccd);
    $rowOffice = getRows($rsOffice);
}
if (isset($_REQUEST['msg'])) {
    if ($_REQUEST['msg'] == 'success') {
        $msg = "<div class='alert-success'>Record updated successfully</div>";
    }
}
?>
<script language="javascript" type="text/javascript">
function bind_all()
{
<?php 
if (!isset($offccd)) {
    ?>
		var subdivision=document.getElementById('Subdivision');
<?php

session_start();
extract($_GET);
include_once 'inc/db_trans.inc.php';
include_once 'function/add_fun.php';
$offccd = isset($_GET["offccd"]) ? $_GET["offccd"] : "";
//$personid=$_GET["personid"];
$bank = isset($_GET["bank"]) ? $_GET["bank"] : "";
$dist = isset($_GET["dist"]) ? $_GET["dist"] : "";
//=================Get office details===========================
if ($offccd != '') {
    $rsOffc = fatch_offcDtl($offccd);
    $num_rows = rowCount($rsOffc);
    if ($num_rows < 1) {
        echo "";
    } else {
        $rowOffc = getRows($rsOffc);
        echo "<label class='text_small'><b>Office Name: </b>" . $rowOffc['office'] . "<br/><b>Desig. of O/C: </b>" . $rowOffc['officer_desg'] . "</label>";
    }
    $rsOffc = NULL;
    $rowOffc = NULL;
    unset($rsOffc, $rowOffc, $num_rows);
} else {
    $rsOffc = NULL;
    unset($rsOffc);
}
//==========================Get Brance Name======================================
if ($bank != '') {
    $rsBranch = fatch_branch($bank);
    $num_rows = rowCount($rsBranch);