IMMREX7

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

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

                <?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($thought) && $thought->idClass == null): ?>
                            <p class="form-control-static">All</p>
                            <?php else: ?> <?php if(isset($thought)): ?>
                            <?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">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" class="required">Thought</label>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <?php echo Form::textarea('thought',null,['class' => 'form-control','size'=>'30x2']); ?>

                            <?php if($errors->has('thought')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('thought')); ?></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($thought)): ?>
                    <?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($thought)): ?>
                        <?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 col-md-7">
        <div class="card single_post">
            <div class="header">
                <h2><strong>Latest</strong> Thoughts</h2>
            </div>
            <?php $__currentLoopData = $thoughts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="body">
                <div class="img-post m-b-15">
                    <img src="<?php echo e(asset('storage/schools/'.$value->idSchool.'/thoughts/'.$value->image)); ?>">
                    <!--<img src="../assets/images/blog/blog-page-4.jpg" alt="Awesome Image">-->
                </div>
                <h3 class="m-t-0 m-b-5" ><a href="#" style="color: #6572b8;"><?php echo e($value->source); ?></a></h3>
                <p><a href="#">Publish Date : <?php echo e($value->publishDate); ?></a></p>
                <p>
                    <a href="<?php echo e(url('school/thoughts/' . $value->idThought . '/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($value->idThought); ?>" data-type="confirm"><i class="zmdi zmdi-delete"></i></a>
                </p>
                <p><?php echo e($value->thought); ?></p>
            </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 Thought!",
            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/thoughts/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Thought 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