

<?php $__env->startSection('content'); ?>
    
    <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
    <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
    
    <div class="row">
        <div class="col-12">
            <div class="row">
        <div class="col-md-12">
          <div class="card">
            <div class="card-header pb-0">
              <div class="d-flex align-items-center">
                <p class="mb-0 font-weight-bolder">Add Video Post</p>
                <label class="btn btn-<?php echo e($errors->first('iserror') == 'false' ? 'success' : 'primary'); ?> btn-sm ms-auto"><?php echo e($errors->first('response')); ?></label>
              </div>
            </div>
            <div class="card-body">
                <!--<img src="<?php echo e(asset('storage/images/test.jpg')); ?>">-->
                <form method="post" action=" <?php echo e(route('video.store')); ?> " id="addform" enctype="multipart/form-data" >
                    <?php echo csrf_field(); ?>
                    <div class="row">
                        <div class="col-md-6">
                          <div class="form-group">
                            <label for="example-text-input" class="form-control-label">Name <b style="color:red"><?php echo e($errors->first('title')); ?></b></label>
                            <input class="form-control" name="title" type="text" placeholder="Happy diwali" required>
                          </div>
                        </div>
                        <div class="col-md-6">
                          <div class="form-group">
                            <label for="example-text-input" class="form-control-label">Select Type</label>
                            
                            <select class="form-control" id="type" name="type" required>
                                <option value="festival" selected>Festival</option>
                                <option value="business">Business</option>
                                <option value="political">Political</option>
                                <option value="custom">Custom</option>
                            </select>
                            
                          </div>
                        </div>
                        
                        <div class="col-md-6">
                          <div class="form-group">
                            <label for="example-text-input" class="form-control-label">Select Language <b style="color:red"><?php echo e($errors->first('language')); ?></b></label>
                            
                            <select class="form-control" name="language" required="required">
                                <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($language->language_code); ?>"><?php echo e($language->language_name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            
                          </div>
                        </div>
                        
                        <div class="col-md-6">
                          <div class="form-group" id="cate_lay">
                            <label for="example-text-input" class="form-control-label">Select Festival</label>
                            
                            <select class="form-control" id="category" name="category" required>
                                <?php $__currentLoopData = $festivals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $festival): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($festival->id); ?>" selected><?php echo e($festival->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            
                          </div>
                        </div>
                        
                        <div class="col-md-6">
                          <div class="form-group">
                            <label for="example-text-input" class="form-control-label">Video<b style="color:red"><?php echo e($errors->first('image_posts')); ?></b></label>
                            <input class="form-control" type="file" id="video" name="video" accept=".mp4" onchange="videoPreview()" required="required">
                          </div>
                        </div>
                        
                        <div class="card-body mt-n3">
                            <div class="mb" id="previewImages">
                                <video width="250" height="auto" controls>
                                   <source id="videoplayer">
                                </video>
                            </div>
                        </div>
                        
                    
                        <div class="col-md-12" >
                          <div class="form-group">
                              
                              <?php if(Session::get('admin_type') == "Demo"): ?>
                              <div class="btn btn-primary col-md-6 demo_action">Submit</div>
                              <?php else: ?>
                              <input class="btn btn-primary col-md-6" type="submit" value="Submit">
                              <?php endif; ?>
                            
                            
                          </div>
                        </div>
                     
                    </div>
                </form>
            </div>
          </div>
        </div>
        
      </div>
        </div>
    </div>
<!--<p class='remove pull-right bg-danger' style='cursor:pointer;position: absolute;top: 0px;right: 15px;padding: 6px 10px;' id='"+i+"'><i class='fa fa-close'></i></p>-->
<script type="text/javascript">

    $("#video").change(function () {
        
        var $source = $('#videoplayer');
        
        $source[0].src = URL.createObjectURL(this.files[0]);
        
        $source.parent()[0].load();
        
    });
    
    $("#type").change(function() {
        $('#cate_lay').empty();
        if($(this).find("option:selected").text() == "Custom")
        {
            $('#cate_lay').append(
                '<label for="example-text-input" class="form-control-label">Select Category</label>'+
                '<select name="category" class="form-control" required>'+
                '<option value="">Select Category</option><?php $__currentLoopData = $custom; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>"><?php echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>');
            create_custom_dropdowns();
        }
        if($(this).find("option:selected").text() == "Festival")
        {
            $('#cate_lay').append(
                '<label for="example-text-input" class="form-control-label">Select Festival</label>'+
                '<select name="category" class="form-control" required>'+
                '<option value="">Select Category</option><?php $__currentLoopData = $festivals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>"><?php echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>');
            create_custom_dropdowns();
        }
        if($(this).find("option:selected").text() == "Political")
        {
            $('#cate_lay').append(
                '<label for="example-text-input" class="form-control-label">Select Party</label>'+
                '<select name="category" class="form-control" required>'+
                '<option value="">Select Party</option><?php $__currentLoopData = $political; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>"><?php echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>');
            create_custom_dropdowns();
        }
        if($(this).find("option:selected").text() == "Business")
        {
            $('#cate_lay').append(
                '<label for="example-text-input" class="form-control-label">Select Business</label>'+
                '<select name="category" class="form-control" required>'+
                '<option value="">Select Category</option><?php $__currentLoopData = $business; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>"><?php echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>');
            create_custom_dropdowns();
        }
    });
    
    $(document).ready(function () {
        create_custom_dropdowns();
    });

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/extended.posterbanao.com/resources/views/video/create.blade.php ENDPATH**/ ?>