<th>Batch UDT</th>
  
    

  </tr>
<?php 
$i = 1;
$query = "select * from `base` where `pincode_change_flag`=1";
$query = mysql_query($query);
if (mysql_num_rows($query) > 0) {
    while ($row = mysql_fetch_array($query)) {
        $id = $row['id'];
        $fes = $row['fe'];
        $pre_fes = $row['previous_fes'];
        $fes_contact_no = get_cell('fes', get_fes_id($fes), 'fes_mobile_no');
        $pre_fes_contact_no = get_cell('fes', get_fes_id($pre_fes), 'fes_mobile_no');
        ?>
		<tr>
		<td ><?php 
        echo $i++;
        ?>
</td>
        <td ><?php 
        echo $row['code'];
        ?>
</td>
		<td ><?php 
        echo $row['external_id'];
        ?>
</td>
        <td ><?php 
$account_number = $row['account_number'];
$full_name = $row['full_name'];
//New Address
$address = $new_address;
$mail_zip = $new_pincode;
$bill_plan = $row['bill_plan'];
$bill_cycle = $row['bill_cycle'];
//New Fes
$fe = $new_fes;
$base_file_name = $row['base_file_name'];
$upload_date_time = date('y-m-d H:i:s');
$time_stamp = $row['time_stamp'];
$ivr_flag = $new_ivr_flag;
//Response for Second Address  or respose for DV
$ivr_hold_timestamp = $row['ivr_hold_timestamp'];
$fes_id = get_fes_id($fe);
//insert_base($code,$external_id,$full_name,$address,$mail_zip,$bill_plan,$bill_cycle,$fe,$base_file_name,$time_stamp,$imei,$batch_code,$is_se);
$insert_base_sql = "INSERT INTO `base` (`code` ,`account_number`,`external_id` ,`full_name` ,`address` ,`mail_zip` ,`bill_plan` ,`bill_cycle` ,`fe` ,`base_file_name` ,`time_stamp` ,`fes_id` ,`batch_code` ,`upload_date_time`,`ivr_flag`,`ivr_hold_timestamp`,`dv`,`change_address_flag`)VALUES ('{$code}','{$account_number}','{$external_id}', '{$full_name}', '{$address}', '{$mail_zip}', '{$bill_plan}', '{$bill_cycle}', '{$fe}', '{$base_file_name}',CURRENT_TIMESTAMP , '{$fes_id}', '{$batch_code}','{$upload_date_time}','{$ivr_flag}','{$ivr_hold_timestamp}','{$dv}','change_address_flag');";
mysql_query($insert_base_sql) or die("Base Not inserted Properly");
?>
<script>
<?php 
if ($dv == 0) {
    ?>
window.top.window.manage_adress_change();
<?php 
} else {
    ?>
window.top.window.manage_dv_change();
<?php 
}