</div>

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/perfect-scrollbar/js/perfect-scrollbar.jquery.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/js/main.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/jquery.nestable/jquery.nestable.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/moment.js/min/moment.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/daterangepicker/js/daterangepicker.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/select2/js/select2.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/select2/js/select2.full.min.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/bootstrap-slider/js/bootstrap-slider.js" type="text/javascript"></script>
<script src="<?php echo $baseUrl; ?>/admin/assets/lib/jquery.gritter/js/jquery.gritter.js" type="text/javascript"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        App.init();
        App.formElements();
        App.uiNotifications();
    });
    $(document).ready(function() {
        $('a[data-toggle="tab"]').on('show.bs.tab', function(e) {
            localStorage.setItem('activeTab', $(e.target).attr('href'));
        });
        var activeTab = localStorage.getItem('activeTab');
        if (activeTab) {
            $('#myTab a[href="' + activeTab + '"]').tab('show');
        }

        //Momen JS
        if ($('.format-date').length > 0) {
            $('.format-date').each(function() {
                var ini = $(this);
                var tgl = ini.text();
                moment.locale('id');
                if (moment(tgl, 'YYYY-MM-DD', true).isValid() || moment(tgl, 'YYYY-MM-DD HH:mm:ss', true).isValid()) {
                    var formatTgl = moment(tgl, "YYYY-MM-DD HH:mm:ss").fromNow();
                    ini.html(formatTgl);
                }
            });
        }

        // function notifications(heading,data,color){
        //     $.extend(
        //         $.gritter.options, {
        //             position: 'top-center'
        //         });
        //     $.gritter.add({
        //         title: heading,
        //         text: data,
        //         class_name: 'color '+ color + ''
        //     });
        // }

        $("#Member_email").change(function(){
            var value = $(this).val();
            jQuery.ajax({
                url: "https://balitbanghub.dephub.go.id/transhub_challenge/lombavideo/site/checkAvailability/type/1",
                data:'email='+$(this).val(),
                type: "POST",
                success:function(data){
                    if(data==1){
                        swal("Informasi", "Alamat Email Sudah Terdaftar", "warning");
                        $('#Member_email').val('');
                    }
                },
                error:function (){}
            });
        });

        $("#Member_code").change(function(){
            var value = $(this).val();
            jQuery.ajax({
                url: "https://balitbanghub.dephub.go.id/transhub_challenge/lombavideo/site/checkAvailability/type/3",
                data:'code='+$(this).val(),
                type: "POST",
                success:function(data){
                    if(data==1){
                        swal("Informasi", "NIK Sudah Terdaftar", "warning");
                        $('#Member_code').val('');
                    }
                },
                error:function (){}
            });
        });


    });
</script>

<style type="text/css">
    @media only screen and (max-width: 600px) {
        .nav-tabs>li a {
            padding: 5px 4px;
            margin-right: 0;
            min-width: 30px;
            border-radius: 0;
            color: #404040;
            border-width: 0;
        }

        h4 {
            margin-top: 5px;
            margin-bottom: 5px;
        }

        .col-sm-12 {
            padding-left: 8px;
            padding-right: 8px;
        }
    }
</style>

</body>

</html>