<?php namespace App\Http\Controllers;?>
<!DOCTYPE html>
<html>

<head>

    <title>Video Story | Admin | Samuhik Saving and Credit Cooperative ltd. </title>
    <?php echo $__env->make('Admin.Parts.MetaCSS', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
     <script>
        
        $(document).ready(function(){
            
            
            $('table > tbody  > tr').each(function() {
        $(this).find('td:eq(3)').html( $(this).find('td:eq(3)').html().replace(/(<([^>]+)>)/ig,"").substring(0,300));
        
            
            });
            
        });
    </script>
</head>

<body>

<!--====================================================
                     MAIN NAVBAR
======================================================-->
    <?php echo $__env->make('Admin.Parts.TopHeader', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<!--====================================================
                    PAGE CONTENT
======================================================-->
    <div class="page-content d-flex align-items-stretch">

        <!--***** SIDE NAVBAR *****-->
        <?php echo $__env->make('Admin.Parts.LeftNav', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <div class="content-inner form-cont">
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-6 col-lg-6">
                           <?php if(session('info')): ?>
                           <div class="alert alert-success" style="text-transform: capitalize;">
                              <?php echo e(session('info')); ?>

                           </div>
                           <?php endif; ?>
                           <?php
                               $video=session('edit');
                           ?>
                           <?php if($errors->any()): ?>
                           <div class="alert alert-danger">
                              <ul>
                                 <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                 <li><?php echo e($error); ?></li>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              </ul>
                           </div>
                           <?php endif; ?>
                        </div>
                     </div>
                    <div class="card form" id="form1">
                        <div class="card-header">
                            <h3>Add Video Story</h3>
                        </div>
                        <br>
                        <?php if(!$video): ?>
                        <form action="admin_video" method="post" enctype="multipart/form-data">
                            <?php else: ?>
                            <form action="<?php echo e(url('admin_video/update',array($video->id))); ?>" method="post" enctype="multipart/form-data">
                            <?php endif; ?>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="title">Title<i style="color: red">*</i></label>
                                        <input type="text" class="form-control" id="title" placeholder="Enter Title" name="title" value="<?php if($video) {echo $video->title;}?>" required>
                                        
                                    </div>

                                    <div class="form-group">
                                        <label for="title">Title In Nepali</label>
                                        <a rel="nofollow" href="http://naya.com.np" title="Nepali Social Network" class="naya_convert" data-site="dark"></a>
                                        <input type="text" class="form-control" id="title" placeholder="Enter Title in Nepali" name="title_nepali" value="<?php if($video) {echo $video->title_nepali;}?>">
                                        
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="batch">link<i style="color: red">*</i></label>
                                        <input type="text" class="form-control" id="batch" placeholder="Enter link" name="link" value="<?php if($video) {echo $video->link;}?>" required>
                                        
                                    </div>
                                  
                                </div>
                                
                            </div>
                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                            
                            <button type="reset" class="btn btn-general btn-white">Cancel</button>
                            <button type="submit" class="btn btn-general btn-blue mr-2"><?php if($video){echo "Update";}else {echo "Save";}?></button>
                        </form>
                    </div>

                <div class="card form" id="form1">           
        <div class="row">
           <div class="col-md-12">
            <div class="box">
              <div class="box-header">
                <h3 class="box-title">Data Table</h3>
              </div>
             <!-- /.box-header -->
             <div class="box-body" >
              <table id="example2" class="table table-bordered table-hover">
                <thead>
                  <tr>
                  <th>Title</th>
                     <th>Title Nepali</th>            
                  <th>link</th>
                     <th>Date</th>
                  <th>Action</th>
                  </tr>
                </thead>
                <tbody>
                <?php $__currentLoopData = $save; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr class="table-active">
                <td><?php echo e($tt->title); ?></td>
                <td><?php echo e($tt->title_nepali); ?></td>
                <td><?php echo e($tt->link); ?></td>
                <td><?php echo e($tt->created_at); ?>

                 <td><a class="btn btn-danger"  href="<?php echo e(url('admin_video/delete',array($tt->id))); ?>">Delete</a></td>
                <td><a class="btn btn-success"  href="<?php echo e(url('admin_video/edit',array($tt->id))); ?>">Edit</a></td>

                </tr>
                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
              
              
               
              </table>
            </div>
            <!-- /.box-body -->
            </div>
          </div>
        </div>
    </div>

                  
                
                </div>
            </div>
        </div>
    </div>

<?php echo $__env->make('Admin.Parts.Js', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</body>

</html>
