echo "<option value='0'>-Select Office-</option>\n";
        for ($i = 1; $i <= $num_rows; $i++) {
            $rowOfc = getRows($rsOfc);
            echo "<option value='{$rowOfc['0']}'>{$rowOfc['1']}</option>\n";
            $rowOfc = null;
        }
    }
    $rsOfc = null;
    $num_rows = 0;
    echo "</select>";
}
if ($opn == 'for_sub_emp_office') {
    include_once 'function/ofc_fun.php';
    $sub_div = $_GET['sub_div'];
    echo "<select id='office' name='office' style='width:240px;' onchange='return office_change(this.value);'>\n";
    $rsOfc = office_details_ag_forsub($sub_div);
    $num_rows = rowCount($rsOfc);
    if ($num_rows > 0) {
        echo "<option value='0'>-Select Office-</option>\n";
        for ($i = 1; $i <= $num_rows; $i++) {
            $rowOfc = getRows($rsOfc);
            echo "<option value='{$rowOfc['0']}'>{$rowOfc['2']}</option>\n";
            $rowOfc = null;
        }
    }
    $rsOfc = null;
    $num_rows = 0;
    echo "</select>";
}
if ($opn == 'personnel') {
    $office = $_GET['office'];
<table width="750px" cellpadding="0" cellspacing="0" border="0">
<thead>
	<tr><th align="center" colspan="5"><?php 
print $_SESSION['environment'];
?>
</th></tr>
</thead>
<tr><td align="center">
<?php 
date_default_timezone_set('Asia/Calcutta');
include_once '../inc/db_trans.inc.php';
include_once '../function/ofc_fun.php';
extract($_POST);
$subdiv = isset($_POST['Subdivision']) ? $_POST['Subdivision'] : "";
$office_cd = isset($_POST['office']) ? $_POST['office'] : "";
$rsOff = office_details_ag_forsub($subdiv);
$num_rows_Off = rowCount($rsOff);
for ($i = 1; $i <= $num_rows_Off; $i++) {
    $rowOff = getRows($rsOff);
    $office = $rowOff['officecd'];
    $office_dtl = $rowOff['office'] . ", " . $rowOff['address1'] . ", " . $rowOff['address2'] . ", P.O.-" . $rowOff['postoffice'] . ", Subdiv-" . $rowOff['subdivision'] . ", P.S.-" . $rowOff['policestation'] . ", Dist.-" . $rowOff['district'] . ", PIN-" . $rowOff['pin'];
    ?>
	<table width="750px" cellpadding="0" cellspacing="0" border="0">
    <thead>
    	<tr><th align="center" colspan="4">&nbsp;</th></tr>
        <tr><th colspan="4" align="center"><hr width="100%" /></th></tr>
        <tr><th align="left">OFFICE: <br />(<?php 
    print $office;
    ?>
)</th><th colspan="4" align="left"><?php 
    print $office_dtl;