IMMREX7

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

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong><?php if(isset($gallery)): ?>Edit <?php else: ?>  Add <?php endif; ?></strong> Gallery</h2>
                <a href="<?php echo e(url('teacher/galleries')); ?>" class="btn btn-sm btn-success" style="float: right;">View Uploaded Photo</a>
                <a href="<?php echo e(url('teacher/gfolders')); ?>" class="btn btn-sm btn-info" style="float: right;">Create Folder</a>
            </div>
            <div class="body">
                <?php if(isset($gallery)): ?>
                <?php echo Form::model($gallery, ['method' => 'PATCH', 'action' => ['Teacher\GalleryController@update', $gallery->idGallery], 'class' => 'form-horizontal']); ?>

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

                <?php endif; ?>
                <?php echo e(csrf_field()); ?>

                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">Select Class</label>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group">
                            <?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms','id'=>'idClass']); ?>

                            <?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-2 form-control-label">
                        <label for="classname">Select Folder</label>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group">
                            <?php echo Form::select('idFolder',$folders,null,['class' => 'form-control show-tick ms','id'=>'idFolder']); ?>

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

                            <?php if($errors->has('imageTitle')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('imageTitle')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">Image</label>
                    </div>
                    <div class="col-sm-10">
                        <div class="dropzone" id='frmFileUpload'>
                            <div class="dz-message">
                                <div class="drag-icon-cph"> <i class="material-icons">touch_app</i> </div>
                                <h3>Drop files here or click to upload.</h3>
                                <div class="fallback" id="dz-error-message">
                                    <input name="file" type="file" multiple />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        <?php if(isset($gallery)): ?>
                        <?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                        <?php else: ?>
                        <?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-all']); ?>

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

            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
Dropzone.options.frmFileUpload= {
    autoProcessQueue: false,
    url: "<?php echo e(url('teacher/galleries')); ?>",
    uploadMultiple: true,
    parallelUploads: 5,
    maxFiles: 30,
    maxFilesize: 5,
    acceptedFiles: 'image/*',
    addRemoveLinks: true,
    init: function() {
        dzClosure = this; // Makes sure that 'this' is understood inside the functions below.

        // for Dropzone to process the queue (instead of default form behavior):
        document.getElementById("submit-all").addEventListener("click", function(e) {
            // Make sure that the form isn't actually being sent.
            e.preventDefault();
            e.stopPropagation();
            dzClosure.processQueue();
        });

        //send all the form data along with the files:
        this.on("sendingmultiple", function(data, xhr, formData) {
        //    _token: $('[name="_token"]').val()
            formData.append("_token", $('meta[name="csrf-token"]').attr('content'));
            formData.append("idFolder", $( "#idFolder option:selected" ).val());
            formData.append("idClass", $("#idClass").val());
            formData.append("imageTitle", $("#image_title").val());
        });
        this.on("error", function(file, response, xhr) { 
            if (response.hasOwnProperty('errors')) {
                // Validation error
                for (const error in response.errors) {
                   this.emit("error", file, response.errors[error].join(' '));
                }
            }
        });
        this.on('success', function(){
            //if (this.getQueuedFiles().length == 0 && this.getUploadingFiles().length == 0) {
                    location.reload();
          //  }
	});
    }
}

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('teachers.teacher_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7