<link rel="stylesheet" href="<?php echo base_url();?>assets/js/validationEngine.jquery.css" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<div class="modal-header" style="min-height: 35px;vertical-align: middle">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h5 class="heading">Rearrange Active Magazine</h5>

</div>
<div class="widget-body innerAll inner-2x">
    <form id="fileupload" action="<?php echo base_url();?>index.php/subscriber/rearrange_active_magazine" method="POST" enctype="multipart/form-data">
        <table class="table table-white table-vertical-center margin-none footable">
            <tr>
                <td style="width:250px">
                    <label class="col-sm-3 control-label text-center">Options: </label>
                    <select name="updated_action" id="updated_action" class="cust_select" required="required">
                        <option value="">--All--</option>
                        <option value="2">Terminate and Refund</option>
                        <option value="3">Transfer</option>
                        <option value="4">Delete</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="width:250px">
                    <label class="col-sm-3 control-label text-center">Comments: </label>
                    <textarea class="form-control validate[required]" style="border: 1px solid;width:400px" name="transfer_comments" id="transfer_comments" required="required"></textarea>
                </td>
            </tr>
            <tr>
                <td style="width:250px">
                    <input type="hidden" name="intSubscriberId" value="<?php echo $intSubscriberId ?>">
                    <input type="hidden" name="intTransactionMagazineId" value="<?php echo $intTransactionMagazineId ?>">
                    <label class="col-sm-3 control-label text-center">
                        <input type="submit" id="update_status" name="submit" value="Proceed" class="btn btn-success" />
                    </label>
                </td>
            </tr>
        </table>
    </form>
</div>

<script src="<?php echo base_url();?>assets/js/main.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/custom.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/plugins/forms_elements_multiselect/js/jquery.multi-select.js?v=v2.0.0-rc1&sv=v0.0.1.2"></script>
<script src="<?php echo base_url();?>assets/plugins/forms_elements_bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="<?php echo base_url();?>assets/components/forms_elements_bootstrap-select/bootstrap-select.js"></script>
<script src="<?php echo base_url();?>assets/components/forms_elements_bootstrap-select/bootstrap-select.init.js"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine.js" type="text/javascript"></script>
<script>
    $(document).ready(function(){
        $("#fileupload").validationEngine();
        $("#update_status").click(function(){
            var intSelectedOption = $("#updated_action").val();
            var transfer_comments = $("#transfer_comments").val();

            if (intSelectedOption == '' || transfer_comments == '') {
                alert("Please process both the option and comment");
                return false;
            }

            if (intSelectedOption == 2) {
                var strSureForRefund = confirm("Are you sure to proceed ? \nThis action is irreversible, do you want to continue ?");
                if (strSureForRefund != true) {
                    return false;
                }
            }
            if (intSelectedOption == 3) {
                var strSureForRefund = confirm("Are you sure you want to proceed ? \nIf so, please proceed to select the magazine to transfer");
                if (strSureForRefund != true) {
                    return false;
                }
            }
        });
    });
</script>