<style>
    .form-horizontal .form-group {
        margin-left: 0 !important;
        padding: 5px;
        height: 50px;
    }

    .form-group .control-label {
        color: #000 !important;
        opacity: 1 !important;
        margin-right: -18px;
    }

    .border-line {
        border-left: 2px solid #eee;
    }

    #WizardModal .nav-tabs-linetriangle>li.active>a:after {
        border-top-color: #fff;
    }
</style>

<div class="modal fade DontReset" data-backdrop="static" id="upload_image_form" tabindex="-1" role="dialog" aria-hidden="true" style="margin: 0 auto;">
    <div class="modal-dialog" style="width: 80%;">
    <div class="modal-content">
            <div class="modal-header clearfix text-left">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="pg-close fs-20"></i>
                </button>
                <h5 class="semi-bold"><?php print CommonLanguage::getMessage('upload_image'); ?></h5>
            </div>
            <div class="modal-body">
                <form id="AddCategoryPostForm" method="POST" onsubmit="return false">
                    <div class="row">
                        <?php echo Forms::AlertDiv('add_alert_category'); ?>
                         
                        <div class="col-md-12">
                            <label><?php print CommonLanguage::getMessage('image'); ?></label>
                            <input type="file" name="new_image_name" onchange="validateImage(this)" class="form-control input-rounded" data-max-size='12000'/>
                        </div>
                       
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="CloseAdd_Cat" data-dismiss="modal"><?php print CommonLanguage::getMessage('Close'); ?></button>
                <button type="submit" class="btn btn-primary " id="Add_Cat"><?php print CommonLanguage::getMessage('Save'); ?></button>
            </div>
            <?php echo Forms::ModalLoader('addCategoryLoader'); ?>
        </div>
    </div>
</div>
<script>
    var Required_Fields = <?php echo json_encode(CommonLanguage::getMessage('Required_Fields')); ?>,
        Failed_Submit = <?php echo json_encode(CommonLanguage::getMessage('Failed_Submit')); ?>,
        Submitted_Successfully = <?php echo json_encode(CommonLanguage::getMessage('Submitted_Successfully')); ?>;
    $(function() {
        $("body").addClass("NoSearch")
        $("body .search-link[data-toggle='search']").html("<i class='pg-search'></i>Click here to <span class='bold'>search</span>")
 

        $("#Add_Cat").on("click", function () {
            //                        var Data = {
            //                            Cat_Name: $("#Cat_Name").val(),
            //                            hide_pos: $("#hide_pos").is(":checked") ? 1 : 0,
            //                            Parent_ID: parent_id
            //                        }
            var Data = new FormData(document.getElementById("AddCategoryPostForm"));

            $('#addCategoryLoader').removeClass('hidden')
            $.ajax({
                url: "ACCAjax/org_upolad_file",
                method: "POST",
                dataType: "json",
                data: Data,
                processData: false,
                contentType: false,
                complete: function (v1, v2) {
                    console.log('v1');
                    console.log(v1);
                    console.log('v2');
                    console.log(v2);

                    var responseType = $.type(v1.responseJSON);
                    if (v2 == 'success' && v1.responseJSON[0] == 'OK') {
                        AddAlert('#add_alert_category', Submitted_Successfully, 'success');
                         
                    } else {
                        AddAlert('#add_alert_category', Failed_Submit, 'danger');
                    }           
                    $('#addCategoryLoader').addClass('hidden')
    
                }
            })
        });
    });
</script>