<?php $__env->startSection('content'); ?>



<link href="<?php echo e(asset('assets/css/vendor/quill.core.css')); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo e(asset('assets/css/vendor/quill.snow.css')); ?>" rel="stylesheet" type="text/css" />

<style>
    .bg-primary{
    background-color: #727cf5 !important;

    padding: 3px;
    /* font-size: 20px; */
}
input.form-control ,.form-control form-control-sm{
    border: 1px solid black;
    border-radius: 0px;
}
/* .from{
    width: 1000px;
    margin-left: 8%;
} */
</style>


<div class="container mt-2">
		<?php $__env->startComponent('components.breadcrumb'); ?>
            <?php $__env->slot('title'); ?>
                <?php echo app('translator')->get('result_entry.add_mark'); ?>
            <?php $__env->endSlot(); ?>
            <?php $__env->slot('breadcrumb1'); ?>
                <?php echo app('translator')->get('common.dashboard'); ?>
            <?php $__env->endSlot(); ?>
            <?php $__env->slot('breadcrumb1_link'); ?>
                <?php echo e(route('dashboard')); ?>

            <?php $__env->endSlot(); ?>
            <?php if(\App\Traits\RolePermissionTrait::checkRoleHasPermission('role', 'create')): ?>
                <?php $__env->slot('action_button1'); ?>
                  <i class="fa fa-eye"></i>  <?php echo app('translator')->get('common.view'); ?>
                <?php $__env->endSlot(); ?>
                <?php $__env->slot('action_button1_link'); ?>
                    <?php echo e(route('add_marks.index')); ?>

                <?php $__env->endSlot(); ?>
            <?php endif; ?>
            <?php $__env->slot('action_button1_class'); ?>
                btn-primary
            <?php $__env->endSlot(); ?>
        <?php echo $__env->renderComponent(); ?>
	<div class="col-12">
		<div class="card">
			<div class="card-body">
            <div class="container">
                <div class="from ms-md-5 ">
                    <form method="GET" action="<?php echo e(url('searchingStudent')); ?>">
                            <div class="row">
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.select_class'); ?> :</label>
                                        <div class="col-sm-7">
                                            <select class="form-control form-control-sm" id="class_id" name="class_id" onchange="getExamTypes();getMarksClassGropup();getMarksSubjects();getSection()">
                                                <option value="">Select One</option>
                                                <?php if($params['class']): ?>
                                                <?php $__currentLoopData = $params['class']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($v->id); ?>">
                                                    <?php if($lang == 'en'): ?>
                                                    <?php echo e($v->class_name ?: $v->class_name_bn); ?>

                                                    <?php else: ?>
                                                    <?php echo e($v->class_name_bn ?: $v->class_name); ?>

                                                    <?php endif; ?>
                                                </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2" id="">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark"> <?php echo app('translator')->get('add_marks.exam_type'); ?>  :</label>
                                        <div class="col-sm-7" id="examTypeBox">
                                            <select class="form-control form-control-sm" id="exam_type_id" name="exam_type_id">
                                                <option value="">
                                                  Select One</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.select_subject_type'); ?> :</label>
                                        <div class="col-sm-7">
                                            <select class="form-control form-control-sm" id="subject_type" name="subject_type">
                                                <option value="1">Compulsory Subject</option>
                                                <option value="2">Group Subject</option>
                                                <option value="3">Optional Subject</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.select_group'); ?>  :</label>
                                        <div class="col-sm-7" id="groupData">
                                            <select class="form-control form-control-sm" id="group_id" name="group_id" onchange="loadGroupsSubject()">
                                                <option value="">
                                                  Select One</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>

                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.subject_name'); ?> :</label>
                                        <div class="col-sm-7" id="subjectBox">
                                            <select class="form-control form-control-sm" id="subject_id" name="subject_id" required onchcange="getSubjectPart()">
                                                <option value="">
                                                  Select One</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.part_name'); ?> :</label>
                                        <div class="col-sm-7" id="subjectPartData">
                                            <select class="form-control form-control-sm" id="subject_part_id" name="subject_part_id">
                                                <option selected>
                                                  Select One</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.session'); ?> :</label>
                                        <div class="col-sm-7">
                                            <select class="form-control form-control-sm" id="session" name="session">
                                                <?php if($params['session']): ?>
                                                <?php $__currentLoopData = $params['session']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($v->session); ?>"><?php echo e($v->session); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                <div class="col-md-6 mt-2">
                                    <div class="row ">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label  text-md-end text-dark">
                                            <?php echo app('translator')->get('add_marks.section'); ?> :</label>
                                        <div class="col-sm-7" id="sectionBox">
                                            <select class="form-control form-control-sm" id="section_id" name="section_id">
                                                <option value="">
                                                  Select One</option>
                                              </select>
                                        </div>
                                  </div>
                                </div>
                                    <div class="text-center mt-4 ">
                                        <button type="submit" class="btn btn-success btn-sm button border-0">
                                            <i class="fa fa-search"></i> Search
                                        </button>
                                  </div>
                            </div>
                      </form>

                </div>

			</div> <!-- end card body-->
        </div>
		</div> <!-- end card -->
	</div><!-- end col-->
</div>



<script src="<?php echo e(asset('assets/js/vendor/quill.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/pages/demo.quilljs.js')); ?>"></script>


<script>
    function getExamTypes()
    {
        const class_id = $('#class_id').val();
        if(class_id != '')
        {
            $.ajax({
                headers : {
                    'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
                },

                url : '<?php echo e(url('getExamType')); ?>',

                type : "POST",

                data : {class_id},

                beforeSend : function(){
                    $('#examTypeBox').html('Loading...');
                },
                success : function(res){
                    $('#examTypeBox').html(res);
                }
            });
        }
    }

    function getMarksClassGropup()
    {
        const class_id = $('#class_id').val();
        // alert(class_id);
        if(class_id != '')
        {
            $.ajax({
                headers : {
                    'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
                },

                url : '<?php echo e(url('getMarksClassGropup')); ?>',

                type : "POST",

                data : {class_id},

                beforeSend : function(){
                    $('#groupData').html('Loading...');
                },
                success : function(res){
                    if(res == 'no_group')
                    {
                        $('#groupFullBox').hide();
                    }
                    else
                    {
                        $('#groupFullBox').show();
                        $('#groupData').html(res);
                    }
                }
            });
        }
    }

    function getMarksSubjects()
    {
        const class_id = $('#class_id').val();
        const group_id = $('#group_id').val();
        const subject_type = $('#subject_type').val();

        $.ajax({
            headers : {
                'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
            },

            url : '<?php echo e(url('getMarksSubjects')); ?>',

            type : "POST",

            data : {class_id,group_id,subject_type},

            beforeSend : function()
            {
                $('#subjectBox').html('Loading...');
            },

            success : function(res)
            {
                $('#subjectBox').html(res);
            }
        })
    }

    function loadGroupsSubject()
    {
        let class_id = $('#class_id').val();
        let subject_type = $('#subject_type').val();
        let group_id = $('#group_id').val();
        $.ajax({
            headers : {
                'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
            },

            url : '<?php echo e(url('loadGroupsSubject')); ?>',

            type : 'POST',

            data : { class_id, subject_type, group_id },

            beforeSend : function()
            {
                $('#subjectBox').html('Loading...');
            },

            success : function(res)
            {
                $('#subjectBox').html(res);
            }
        });
    }

    function getSubjectPart()
    {
        const subject_id = $('#subject_id').val();
        if(subject_id != '')
        {
            $.ajax({
                headers : {
                    'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
                },

                url : '<?php echo e(url('getSubjectPart')); ?>',

                type : "POST",

                data : {subject_id},

                beforeSend : function(){
                    $('#subjectPartData').html('Loading....');
                },

                success : function(res)
                {
                    if(res == 'no_part')
                    {
                        $('#subjectPartBox').hide();
                    }
                    else
                    {
                        $('#subjectPartBox').show();
                        $('#subjectPartData').html(res);
                    }
                }
            })
        }
    }

    function getSection()
    {
        let loading = '<b class="text-danger">Loading...</b>';
        let class_id = $('#class_id').val();
        if(class_id != '')
        {
            $.ajax({
                headers : {
                    'X-CSRF-TOKEN' : '<?php echo e(csrf_token()); ?>'
                },

                url : '<?php echo e(url('getSection')); ?>',

                type : 'POST',

                data : {class_id},

                breforeSend : () => {
                    $('#sectionBox').html(loading);
                },

                success : (res) => {
                    $('#sectionBox').html(res);
                }
            })
        }
    }

</script>


<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/gzmcfenigov/public_html/resources/views/admin/add_marks/create.blade.php ENDPATH**/ ?>