IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/34e97ce98e97c54b1805295ba3edd62786f2900d.php

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-lg-5 col-md-5 col-sm-5">
        <div class="card">
            <div class="header">
                <h2><strong><?php if(isset($newsletter)): ?>Edit <?php else: ?>  Add <?php endif; ?></strong>Newsletter</h2>
            </div>
            <div class="body">
                <?php if(isset($newsletter)): ?>
                <?php echo Form::model($newsletter, ['method' => 'PATCH', 'action' => ['School\NewsLetterController@update', $newsletter->idNewsletter], 'class' => 'form-horizontal']); ?>

                <?php else: ?>
                <?php echo Form::open(['url' => 'school/newsletters', 'class' => 'form-horizontal','files'=>true,]); ?>

                <?php endif; ?>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname" class="required">Select Class</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php if(isset($newsletter) && $newsletter->idClass == null): ?>
                            <p class="form-control-static">All</p>
                            <?php else: ?> <?php if(isset($newsletter)): ?>
                            <?php echo Form::select('idClass',$class,null,['class' => 'form-control show-tick ms']); ?>

                            <?php else: ?>
                            <div style="border:1px solid #ccc; width:250px; height: 110px; overflow-y: scroll;">
                                <div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong>
                                 <input type="checkbox" class="select-all" name='all'>
                                 <?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                 <div class="checkbox-inline" style="padding-left:5px;">
                                     <label style="margin-right:10px;"><?php echo e($value); ?></label>
                                     <input type="checkbox" name="classes[]" value="<?php echo e($key); ?>" class="chkall">
                                 </div>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>   
                            </div>
                            <?php endif; ?>
                            <?php endif; ?>
                            <?php if($errors->has('idClass')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('idClass')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname" class="required">Subject</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            
                            <?php if(isset($newsletter) && $newsletter->subjectName != "NA"): ?>
                            <p>Subject : <?php echo e($newsletter->subjectName); ?></p>
                            <?php endif; ?>
                            <?php echo Form::select('subject',$subjects,null,['class' => 'form-control show-tick ms']); ?>

                            <?php if($errors->has('subject')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('title')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname" class="required">Title</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php echo Form::text('title',null,['class' => 'form-control']); ?>

                            <?php if($errors->has('title')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('title')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname" class="required">Description</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php echo Form::textarea('description',null,['class' => 'form-control','size'=>'30x2']); ?>

                            <?php if($errors->has('description')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('description')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname">Image</label>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <?php echo Form::file('image',null,['class' => 'form-control']); ?>

                            <?php if($errors->has('image')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('image')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname" >Video Link(Key Only)</label>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <?php echo Form::text('videoLink',null,['class' => 'form-control']); ?>

                            <?php if($errors->has('videoLink')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('videoLink')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname">Select Publish Date</label>
                    </div>
                    <div class="col-sm-5">
                        <div class="form-group">
                            <?php echo Form::text('publishDate',null,['class' => 'form-control datepicker']); ?>

                            <?php if($errors->has('publishDate')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('publishDate')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                    <?php if(isset($newsletter)): ?>
                    <?php else: ?>
<!--                    <div class="col-sm-2">
                        <button class="btn btn-sm btn-success" style="font-size: 12px;" name='schedule'>Schedule</button>
                    </div>-->
                    <?php endif; ?>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        <?php if(isset($newsletter)): ?>
                        <?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                        <?php else: ?>
                        <?php echo Form::submit('PUBLISH NOW',['class' => 'btn btn-raised btn-warning btn-round waves-effect']); ?>

                        <?php endif; ?>
                        <?php echo Form::close(); ?> 
                    </div>
                </div>
           
            </div>
        </div>
    </div>

    <div class="col-lg-7">
        <div class="card">
            <?php $__currentLoopData = $newsletters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="body">
                <ul class="cbp_tmtimeline">
                    <li>
                        <time class="cbp_tmtime" datetime="#"><span class="hidden"><?php echo e($val->publishDate); ?></span> <span class="large"></span></time>
                        <div class="cbp_tmicon"><i class="zmdi zmdi-account"></i></div>
                        <div class="cbp_tmlabel">
                            <h2><a href="javascript:void(0);"><?php echo e($val->title); ?></a> <span></span></h2>
                            <p>
                                    <a href="<?php echo e(url('school/newsletters/' . $val->idNewsletter . '/edit')); ?>" class="btn btn-sm btn-info waves-effect waves-float waves-red"><i class="zmdi zmdi-edit"></i></a>
                                    <a href="#" class="btn btn-sm btn-danger waves-effect waves-float waves-red js-sweetalert" data-id="<?php echo e($val->idNewsletter); ?>" data-type="confirm"><i class="zmdi zmdi-delete"></i></a>
               
                            </p>
                            <?php if($val->subjectName != "NA"): ?>
                            <p><?php echo e($val->subjectName); ?></p>
                            <?php endif; ?>
                            <p><?php echo e($val->description); ?></p>
                            <?php if($val->image!=null): ?>
                            <img src="<?php echo e(asset('storage/schools/'.$val->idSchool.'/newsletters/'.$val->image)); ?>">
                            <?php else: ?>
                            <iframe width="360" height="315" src="https://www.youtube.com/embed/<?php echo e($val->videoLink); ?>" frameborder="0" allowfullscreen></iframe>
                            <?php endif; ?>
                        </div>
                    </li>
                </ul>

            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <div class="body">
            <?php echo $newsletters->render(); ?>
             </div>
         </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).on('click', '.select-all', function(){
    var checkAll = this.checked;
    if(checkAll === true){
            $('.chkall').each(function () {
                this.checked = checkAll;
            });
    }else{
        $('.chkall').each(function () {
                this.checked = checkAll;
        });
    }
 });
$(document).on('click', '.js-sweetalert', function (e) {
    $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure?",
            text: "Are You sure you want to delete this Newsletter!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "DELETE",
                url: "<?php echo e(url('/school/newsletters/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Newsletter has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7