File: public/assets/js/app/install.js

Recommend this page to a friend!
  Classes of ikhsan  >  Slim Starter  >  public/assets/js/app/install.js  >  Download  
File: public/assets/js/app/install.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Slim Starter
Build MVC Web applications based on Slim framework
Author: By
Last change:
Date: 6 years ago
Size: 1,647 bytes
 

Contents

Download
$(function(){
    $('#checkConnection').click(function(e){
        e.preventDefault();
        var $this = $(this),
            $dbsettings = $('#dbsettings').serialize(),
            $alert = $('#alert');

        $this.prop('disabled', true);
        $this.html('Checking Connection...');
        $alert.html('');

        $.post(global.baseUrl+'install.php/db/check', $dbsettings, function(response){

            $this.prop('disabled', false);
            $this.html('check');

            if(response.success){
                $('#saveConfiguration').prop('disabled', false);
                $alert.html(
                    '<div class="alert alert-success alert-dismissable">'+
                        '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'+
                        response.message+
                    '</div>'
                );
            }else{
                $('#saveConfiguration').prop('disabled', true);
                $alert.html(
                    '<div class="alert alert-danger alert-dismissable">'+
                        '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'+
                        response.message+
                    '</div>'
                );
            }
        });
    });

    $('#dbdriver').change(function(){
        var $driver = $(this).val();

        $('#dbsettings .config').each(function(){
            var $div = $(this);
            if($div.hasClass($driver)){
                $div.show();
            }else{
                $div.hide();
            }
        });
    }).trigger('change');

});

For more information send a message to info at phpclasses dot org.