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

<head>

    <title>Report | Admin | Milijuli </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(5)').html( $(this).find('td:eq(5)').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
                               $data=session('avisd');
                           ?>
                           <?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 Report</h3>
                        </div>
                        <br>
                        <?php if(!$data): ?>
                        <form action="admin_report" method="post" enctype="multipart/form-data">
                            <?php else: ?>
                            <form action="<?php echo e(url('admin_report/update',array($data->id))); ?>" method="post" enctype="multipart/form-data">
                            <?php endif; ?>
                            <div class="row">
                                <div class="col-md-12">

                                  <div class="form-group">
                                        <label for="title">Type<i style="color: red">*</i></label>
                                        <SELECT class="form-control" id="type" name="report_type">
                                          <option value="Pearl Report" <?php if($data) echo AdminlogController::IsSelected($data->report_type,'Pearl Report');?>>Pearl Report</option>
                                          <option value="Trial Balance" <?php if($data) echo AdminlogController::IsSelected($data->report_type,'Trial Balance');?>>Trial Balance</option>
                                          <option value="Balance Sheet" <?php if($data) echo AdminlogController::IsSelected($data->report_type,'Balance Sheet');?>>Balance Sheet</option>
                                          <option value="AGM Report" <?php if($data) echo AdminlogController::IsSelected($data->report_type,'AGM Report');?>>AGM Report</option>
                                          
                                         
                                        </SELECT> 
                                        
                                    </div>


                                     <div class="form-group">
                                        <label for="date">Title<i style="color: red">*</i></label>
                                        <input type="text" class="form-control" id="date"  name="title" value="<?php if($data) {echo $data->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($data) {echo $data->title_nepali;}?>">
                                        
                                    </div>
                                    
                                    
                                    <div class="form-group">
                                        <label for="date">Date<i style="color: red">*</i></label>
                                        <input type="date" class="form-control" id="date"  name="date" value="<?php if($data) {echo $data->date;}?>" required>
                                        
                                    </div>



                                  <div class="form-group">
                                        <label for="exampleInputFile">File<i style="color: red">*</i> <i style="margin-left: 20px; font-size: 10px;">single file</i></label>
                                        <?php if(!$data): ?>
                                        <input type="file" class="form-control-file" id="exampleInputFile" name="file" accept=
"application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint,
text/plain, application/pdf" required>
                                        <?php else: ?>
                                        <input type="file" class="form-control-file" id="exampleInputFile" name="file" accept=
"application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint,
text/plain, application/pdf" >
                                        <br>
                                        <div class="form-group">
                                          <p><?php echo e($data->file_name); ?></p>
                                            
                                        </div>
                                        <?php endif; ?>
                                       
                                    </div>

                                    <div class="form-group">
                                        <label for="exampleTextarea">Description<i style="color: red">*</i></label>
                                        <textarea class="form-control ckeditor" id="exampleTextarea" rows="3" name="description"><?php if($data) {echo $data->description;}?></textarea>
                                    </div>

                                    <div class="form-group">
                                        <label for="exampleTextarea">Description in Nepali</label>
                                        <a rel="nofollow" href="http://naya.com.np" title="Nepali Social Network" class="naya_convert" data-site="dark"></a>
                                        <textarea class="form-control" id="exampleTextarea" rows="8" name="description_nepali" placeholder="Enter the Description in Nepali"><?php if($data) {echo $data->description_nepali;}?></textarea>
                                    </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($data){echo "Update";}else {echo "Save";}?></button>
                        </form>
                    </div>

       <div class="card form" id="form1">           
        <div class="row">
          <div class="col-xs-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 width="5%">SN</th>
                
                  <th width="15%">Type</th>
                  <th width="15%">Title</th>
                  <th width="10%">Date</th>
                  <th width="15%">File Name</th>
                  <th width="35%">Description</th>
                
                  
                  <th width="15%">Action</th>
                </tr>
                </thead>
                <tbody>
     
                  <tbody>
                  
                    <?php
                    echo AdminlogController::table_generator('reports',array('report_type','title','date','file_name','description'), 'admin_report','Report');?>
  
           
                </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>
