if ($num_rows > 0) {
    for ($i = 1; $i <= $num_rows; $i++) {
        $rowBn = getRows($rsBn);
        echo "<option value='{$rowBn['0']}'>{$rowBn['1']}</option>\n";
    }
}
$rsBn = null;
$num_rows = 0;
$rowBn = null;
?>
      				</select>
        &nbsp;&nbsp; <span class="error">&nbsp;&nbsp;</span>Branch</td>
      <td align="left"><span id='branch_result'><select name="branch" id="branch" style="width:108px;">
      						<?php 
if (isset($personcd)) {
    $rsBranch = fatch_branch($rowPerson['bank_cd'], $dist_cd);
    $num_rows = rowCount($rsBranch);
    if ($num_rows > 0) {
        echo "<option value=''>-Select Branch-</option>\n";
        for ($i = 1; $i <= $num_rows; $i++) {
            $rowBranch = getRows($rsBranch);
            echo "<option value='{$rowBranch['0']}'>{$rowBranch['3']}</option>\n";
        }
    }
    $rsBranch = null;
    $rowBranch = null;
}
?>
     				 </select></span>
        &nbsp;&nbsp; <span class="error">&nbsp;&nbsp;</span>Bank A/C No</td>
      <td align="left"><input type="text" name="acc_no" id="acc_no" style="width:142px;" /></td>
    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);
    if ($num_rows < 1) {
        echo "<select name='branch' id='branch' style='width:108px;'></select>";
    } else {
        echo "<select name='branch' id='branch' style='width:108px;'>\n";
        echo "<option value=''>-Select Branch-</option>\n";
        for ($i = 1; $i <= $num_rows; $i++) {
            $rowBranch = getRows($rsBranch);
            echo "<option value='{$rowBranch['0']}'>{$rowBranch['2']}</option>\n";
        }
        echo "</select>\n";
    }
    $rsBranch = NULL;
    $rowBranch = NULL;
    unset($rsBranch, $rowBranch, $num_rows);