<td><?php 
    if ($row['status'] == "1") {
        echo '<span style="color:#009e1e; font-weight:bold;">Verified</span>';
    } elseif ($row['status'] == "2") {
        echo '<span style="color:#FF0000; font-weight:bold;">Rejected</span>';
    } else {
        echo '<span style="color:#0068b1; font-weight:bold;">Pending</span>';
    }
    ?>
</td>
          <td><?php 
    togetstatusofferlabel($row['ac_id'], $row['id'], "status");
    ?>
</td>    
          <td  height="30" style="text-align:right; padding-right:20px"><?php 
    $bal = moneyFormatIndia($row['balance']);
    echo $bal;
    ?>
</td>
          <td style="text-align:right; padding-right:20px"><?php 
    echo togetcurrentoffervalue($row['ac_id'], $row['id']);
    ?>
</td>  
            
            
            
        </tr>
        <?php 
    $j++;
}
?>
                  <td align="left" class="head2"><?php 
echo toshowformatdate($admin->date_closed);
?>
</td>
                </tr>
                <tr>
                  <td height="30" align="left" class="blackbold">Last Payment Date</td>
                  <td align="left" class="head2"><?php 
echo toshowformatdate($admin->last_payment_date);
?>
</td>
                </tr>
                <tr>
                  <td height="30" align="left" class="blackbold">Last Payment Done</td>
                  <td align="left" class="head2">Rs. <?php 
echo moneyFormatIndia($admin->last_payment_done);
?>
</td>
                </tr>
                <tr>
                  <td height="30" align="left" class="blackbold">Account Status</td>
                  <td align="left" class="head2"><?php 
if ($admin->status == "1") {
    echo "Verified";
} else {
    echo "Unable to Verify";
}
?>
</td>
                </tr>
        ?>
</td>
          <td  height="30"><?php 
        echo togetaccounttype($row['product_type']);
        ?>
</td>
          <td  height="30"><?php 
        echo $row['account_no'];
        ?>
</td>
          <td  height="30"><?php 
        echo moneyFormatIndia($row['balance']);
        ?>
 </td>          
          <td><?php 
        echo moneyFormatIndia(togetcurrentoffervalue($row['ac_id'], $row['id']));
        ?>
</td>  
          <td><?php 
        echo todisplay($array_payin, 'ad_status[' . $row['ac_id'] . ']', 'Please Select', togetpayin($row['ac_id'], "payin"));
        ?>
</td>
        
           <input name="offeraccept[<?php 
        echo $row['ac_id'];
        ?>
]" type="hidden" value="<?php 
        echo $offer;
        ?>
" />
           <input name="userid[<?php 
<?php

$amount = '10000034000';
$amount = moneyFormatIndia($amount);
echo $amount;
## ref link : http://stackoverflow.com/questions/10042485/how-to-display-currency-in-indian-numbering-format-in-php
function moneyFormatIndia($num)
{
    $explrestunits = "";
    if (strlen($num) > 3) {
        $lastthree = substr($num, strlen($num) - 3, strlen($num));
        $restunits = substr($num, 0, strlen($num) - 3);
        // extracts the last three digits
        $restunits = strlen($restunits) % 2 == 1 ? "0" . $restunits : $restunits;
        // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping.
        $expunit = str_split($restunits, 2);
        for ($i = 0; $i < sizeof($expunit); $i++) {
            // creates each of the 2's group and adds a comma to the end
            if ($i == 0) {
                $explrestunits .= (int) $expunit[$i] . ",";
                // if is first value , convert into integer
            } else {
                $explrestunits .= $expunit[$i] . ",";
            }
        }
        $thecash = $explrestunits . $lastthree;
    } else {
        $thecash = $num;
    }
    return $thecash;
    // writes the final format where $currency is the currency symbol.
                <tr>
                  <td align="left" colspan="2" >
                  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    	<tr align="center" class="normal" width="100%">
                  <td align="left" colspan="2" class="blackbold">EMI With Amount and Date</td>
                </tr>
                          <tr>
                            <td style="padding:10px 0;" width="25%" class="blackbold">Amount</td>
                            <td style="padding:10px 0;" class="blackbold">Date</td>
                          </tr>
                          <?php 
                while ($rowfp = mysql_fetch_assoc($resultfp)) {
                    ?>
                          <tr>
                            <td style="padding:10px 0;">Rs. <?php 
                    echo moneyFormatIndia($rowfp["emiamount"]);
                    ?>
</td>
                            <td style="padding:10px 0;"><?php 
                    echo toshowformatdate($rowfp["emidate"]);
                    ?>
</td>
                          </tr>
                          <?php 
                }
                ?>
                    </table>                  
                  </td>
                </tr>
                <tr>
                  <td align="left" class="blackbold" height="1" colspan="2"></td>
function togetcurrentoffervalue($aid, $userid)
{
    $query = "SELECT `offer`,`counteroffer`,`status` FROM `tbl_offerdetails` WHERE `aid` = '{$aid}' AND `userid` = '{$userid}' ORDER BY add_date DESC";
    $result = mysql_query_with_throw($query);
    $total = mysql_num_rows($result);
    $row = mysql_fetch_assoc($result);
    if ($total > 0) {
        if ($row["status"] == '2') {
            $string = '<span style="color:#009e1e; font-weight:bold">' . moneyFormatIndia($row["counteroffer"]) . ' </span>';
        } else {
            $string = '<span style="color:#009e1e; font-weight:bold">' . moneyFormatIndia($row["offer"]) . ' </span>';
        }
    } else {
        $string = '<span style="color:#0068b1; font-weight:bold;">None</span>';
    }
    return $string;
}
    ?>
</td>
          <td  height="30"><?php 
    echo $row1['account_no'];
    ?>
</td>
          <td  height="30"><?php 
    echo $row1['unikdueid'];
    ?>
</td>
          <td  height="30"><?php 
    echo moneyFormatIndia($row1['balance']);
    ?>
 </td>
          <td  height="30"><?php 
    echo moneyFormatIndia($row1['principal']);
    ?>
 </td>
          <td  height="30"><?php 
    echo todisplay($array_asource, 'ad_asource[' . $row1['id'] . ']', 'Please Select', togetfieldvalue($row1['id'], "tbl_accounts", "account_source"));
    ?>
</td>
          <td  height="30"><?php 
    echo todisplay($array_cibil, 'ad_acibil[' . $row1['id'] . ']', 'Please Select', togetfieldvalue($row1['id'], "tbl_accounts", "cibil_status"));
    ?>
</td>
          <td><?php 
    echo todisplay($array_case, 'ad_case[' . $row1['id'] . ']', 'Please Select', togetfieldvalue($row1['id'], "tbl_accounts", "case_type"));
    ?>
</td>
           <input name="rws_case[<?php 
                <div class="gt-formfields"><?php 
if (toshowformatdate($row["last_payment_date"]) != "") {
    echo toshowformatdate($row["last_payment_date"]);
} else {
    echo "-";
}
?>
</div>
                <div class="gt-label">Last Payment Date</div>
            </div>
            <!-- Field Content Ends -->
            
            <div class="gt-fieldsas">        
                <div class="gt-formfields"><?php 
if ($row["last_payment_done"] > 0) {
    echo '<i class="fa fa-inr"></i> ' . moneyFormatIndia($row["last_payment_done"]);
} else {
    echo "-";
}
?>
</div>
                <div class="gt-label">Last Payment Done</div>
            </div>
            <!-- Field Content Ends -->
            
           <div class="gt-fieldsas last">        
                <div class="gt-formfields"><?php 
echo $row["unikdueid"];
?>
</div>
                <div class="gt-label">Dues ID</div>