<div style="display: none;">
    <div id="subVersionContent">
        <div class="popup-header toolbar-header">
            <div class="popup-title">SVN</div>
            <div class="popup-close-btn" onclick="zamanEposPopupcloser()"><span class="icon icon-cancel"></span></div>
        </div>
        <div class="popup-content">
            <?php echo form_open('settings/save', array('id' => 'generalSvnForm', 'enctype' => 'multipart/form-data')); ?>
            <div class="neworder-table-guest collection-phone ccfee">
                <div class="form-group">
                    <input type="text" name="version" class="form-control" placeholder="svn" value="<?php echo $this->config->item('version') ?>">
                </div>
                <div class="clearfix"></div>
                <br/> <hr/>
                <div class="tab-group config-submit">
                    <button type="submit" onclick="saveSVN('generalSvnForm')"><span class="icon icon-folder"></span>&nbsp;<?php echo $this->lang->line('save') ?></button>
                </div>
            </div>
            <?php echo form_close() ?>
        </div>
    </div>
</div>
<script type="text/javascript">
    function zamanSVNControllerPopup() {
        $.colorbox({
            inline: true,
            scrolling: false,
            href: "#subVersionContent",
            width: '40%',
            height: '175px',
            maxWidth: "100%",
            open: true,
            closeButton: false,
            transition: 'elastic',
            overlayClose: false,
            onClosed: function () {
                resetForm('generalSvnForm');
            }
        });
    }
    function saveSVN(formId) {
        if (!$('.page-loader').is(":visible")) {
            $('#' + formId).validate({
                submitHandler: function () {
                    var myform = document.getElementById(formId);
                    var formdata = new FormData(myform);
                    if (checkInternetConnection()) {
                        $.ajax({
                            url: $('#' + formId).attr('action'),
                            data: formdata,
                            cache: false,
                            processData: false,
                            contentType: false,
                            type: 'POST',
                            dataType: 'json',
                            success: function (response) {
                                if (response.status) {
                                    zamanDbEposConfiguration('mono');
                                    zamanEposPopupcloser();
                                    zamanEposNavigator('controllPanel', '<?php echo site_url('settings/controllPanel') ?>', 'controllPanel');
                                } else {
                                    warning('<?php echo $this->lang->line('error') ?>', response.message, '<?php echo $this->lang->line('ok') ?>');
                                }
                            }
                        });
                    } else {
                        warning('<?php echo $this->lang->line('lost_connection') ?>', '<?php echo $this->lang->line('lost_connection_message') ?>', '<?php echo $this->lang->line('close') ?>');
                    }
                }
            });
        }
    }

</script>