Subversion Repositories SmartDukaan

Rev

Rev 8018 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <title>Recharge Top Up</title>
                
                <link type = "text/css" href = "css/pincode.css" rel = "stylesheet"/>
                <link type = "text/css" href = "css/colorbox.css" rel = "stylesheet"/>
                <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
                <script type="text/javascript" src="js/jquery.colorbox-min.js"></script>
        </head>
        <body>
                <h3>Recharge Topup</h3>
                #set($errorMsg=$action.getErrorMsg())
                #if(!$errorMsg.isEmpty())
        <div style="color:red">
            $errorMsg
        </div>
                #end
                Saholic wallet balance (with MobiSoc) is : INR $action.getSaholicRechargeBalance()<br>
                Spice Retail Current wallet balance is : INR $action.getWalletBalance(1)<br>
                Spice Online Retail Current wallet balance is : INR $action.getWalletBalance(2)
                <form id="recharge-topup" name="recharge-topup" action="" method="post"">
                        <table>
                                <tr>
                                        <td>Company:</td>
                                        <td>
                                                <select id="companyId" name="companyId">
                            <option value="1" selected>Spice Retail Ltd</option>
                                                        <option value="2">Spice Online Retail Pvt Ltd</option>
                                                </select>
                                        </td>
                                </tr>
                                <tr>
                                        <td>Amount:</td>
                                        <td>
                                                <input id="amount" name="amount" type="text"/>
                                        </td>
                                </tr>
                                <tr>
                                        <td>&nbsp;</td>
                                        <td><input type="submit" value="Add amount"/></td>
                                </tr>
            </table>
                </form>
                
                <br />
                <br />
                <br />
                <br />
                
        </body>
<script type="text/javascript">
$("#recharge-topup").live('submit', function(){
        var amt = $('#amount').val();
        var cmp = $( "#companyId option:selected" ).text();
        if (amt==isNaN(amt) || amt==null || amt==""){
                alert("Empty amount.");
                return false;
        }
        if(!confirm("Adding amount "+amt+" to "+cmp)){
                return false;
        }
        var data = $(this).serialize();
    jQuery.ajax({
        url: "/Support/recharge-topup",
        type: 'POST',
        data: data,
        async: false,
        success: function (data) {
                        $('#recharge-topup')[0].reset();
                },
                error : function() {
                        alert("OOPS!!!Failed to do changes.Try Again.");
                        $('#recharge-topup')[0].reset();
                 },
        cache: false,
        contentType: "application/x-www-form-urlencoded",
        processData: false
    });
        location.reload();
    return false;
        });
</script>
</html>