<!DOCTYPE html>
<html>

@include('includes.head')


<body class="hold-transition skin-blue fixed sidebar-mini">
    <!-- Site wrapper -->
    <div class="wrapper">

        @include('includes.header')
        <!-- =============================================== -->

        <!-- Left side column. contains the sidebar -->
        @include('includes.side-nav')

        <!-- =============================================== -->

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    Event
                    <small>Manage City</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li><a href="#">City Event</a></li>
                    <li class="active">Event</li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content">
                @include('includes.messages')
                <!-- Default box -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Event</h3>


                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="box-body">
                                <form action="{{ route('event.update',$courseInfo->id) }}" enctype="multipart/form-data" method="POST">
                                    @csrf
                                    <div class="form-row">
                                        <div class="form-group col-md-12">
                                            <label for="">Event   Name*</label>
                                            <input type="text" name="name_en" class="form-control" required
                                                value="{{$courseInfo->name_en ??""}}">
                                        </div>
                                        <div class="form-group col-md-12">
                                            <label for="">Event   Location*</label>
                                            <input type="text" name="location" class="form-control" required
                                                value="{{$courseInfo->location ??""}}">
                                        </div>

                                        <div class="form-group col-md-4">
                                            <label for="">Start Date*</label>
                                            <input type="date" name="start_date" class="form-control" required
                                            value="{{$courseInfo->start_date ??""}}">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="">Start Time*</label>
                                            <input type="time" name="start_time" class="form-control" required
                                            value="{{$courseInfo->start_time ??""}}">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="">End Time*</label>
                                            <input type="time" name="end_time" class="form-control" required
                                            value="{{$courseInfo->end_time ??""}}">
                                        </div>
                                        <div class="form-group col-md-12">
                                            <label for="">Image*</label>
                                            <input type="file" name="img" class="form-control" id="imageUpload">
                                            <img id="imagePreview" src="{{$courseInfo->img ?? ''}}" style="width:100px;">
                                        </div>





                                        <div class="form-group col-md-12">
                                            <label for="">Event Description</label>
                                            <textarea name="description" id="editor1" cols="30" rows="10">{{$courseInfo->description ??""}}</textarea>
                                        </div>



                                        <div class="form-group col-md-12">
                                            <button type="submit" class="btn btn-info" value="Submit">Submit</button>
                                        </div>
                                    </div>
                                </form>
                            </div>



                        </div>
                        <!-- /.box-body -->

                    </div>

                </div>

        </div>

        <!-- /.box -->

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    @include('includes.footer')

    </div>
    <!-- ./wrapper -->

    @include('includes.scripts')
    <script>
        $(function() {
            CKEDITOR.replace('editor7')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor8')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor5')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor6')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor9')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor10')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor11')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor12')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor13')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor14')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor15')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor16')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor17')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor18')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor19')
        })
    </script>
    <script>
        $(function() {
            CKEDITOR.replace('editor20')
        })
    </script>
    <script>
        function initCKEditor(elementId) {
            CKEDITOR.replace(elementId);
        }

        $(function() {
            initCKEditor('editor1');
            initCKEditor('editor2');
            initCKEditor('editor3');
            initCKEditor('editor4');
            initCKEditor('editor5');
            initCKEditor('editor6');
            initCKEditor('editor7');
            initCKEditor('editor8');

            // Other initialization code...
        });
    </script>

<script>
    document.getElementById('imageUpload').addEventListener('change', function(event) {
        let file = event.target.files[0];
        if (file) {
            let reader = new FileReader();
            reader.onload = function(e) {
                document.getElementById('imagePreview').src = e.target.result;
            };
            reader.readAsDataURL(file);
        }
    });
    </script>

</body>

</html>
