IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/onlinereg/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/onlinereg/enquiry-students.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>List Of Equiries </strong></h2>
            </div>
            <div class="body table-responsive">
                {!! Form::open(['method' => 'GET',  'action' => ['School\RegisteredStudentController@enquiry'], 'class' => 'form-horizontal']) !!}
                <div class="row clearfix">
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">From Date</label>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            {!! Form::text('fromDate',null,['class' => 'form-control datepicker']) !!}
                        </div>
                    </div>
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">To Date</label>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            {!! Form::text('toDate',null,['class' => 'form-control datepicker']) !!}
                        </div>
                    </div>
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">Status</label>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            {!! Form::select('admitted',['N'=>'Active','R'=>'Rejected'],null,['class' => 'form-control show-tick ms']) !!}
                        </div>
                    </div>
                    <div class="col-sm-2">
                        {!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                    </div>
                </div>
                {!! Form::close() !!} 
                <br>
                <table class="table table-bordered table-striped table-hover dataTable js-basic-example" id='tableexps'>
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Date</th>
                            <th>Registration No.</th>
                            <th>Name</th>
                            <th>DOB</th>
                            <th>Admission For Class</th>
                            <th>Gender</th>
                            <th>Contact No</th>
                            <th>Remarks for enquiry</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1; ?>
                        @foreach($students as $value)
                        <tr>
                            <th scope="row">{{$i}}</th>
                            <th>{{Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $value->created_at)->format('d-M-Y')}}</th>
                            <td>{{$value->registrationNo}}</td>
                            <td>{{$value->firstName}} {{$value->middleName}} {{$value->lastName}}</td>
                            <td>{{$value->studentDob}}</td>
                            <td>{{$value->className}}</td>
                            <td>{{$value->gender}}</td>
                            <td>{{$value->father_mobile}}</td>
                            <td>
                                @if(isset($value->remarks))
                                {{$value->remarks}}
                                @else
                                <form method="post"  id='paymentform{{$value->idRegistration}}}'>
                                    {!! Form::text('remarks',null,['class' => 'form-control','required'=>'required','placeholder'=>'Remarks','id'=>'payst'.$value->idRegistration]) !!}
                                    <button type="button" id="paymentbtn{{$value->idRegistration}}" onclick="savePaymentStatus({{$value->idRegistration}})" class="btn btn-raised btn-success">UPDATE</button>
                                </form>
                                 <span id="paysuccessmsg{{$value->idRegistration}}" style="color:green;"></span>
                                @endif 
                            </td>
                            <td>
                                <a href="{{url('school/form/enquiry/print/'.$value->idRegistration)}}" id="admit{{$value->idRegistration}}" class="btn btn-raised btn-success">Print/View</a>
                                @if($value->admitted == "N")
                                <a href="#" id="reject{{$value->idRegistration}}" onclick="rejForm({{$value->idRegistration}});" class="btn btn-raised btn-warning">REJECT</a>
                                <div id='rejectform{{$value->idRegistration}}' style="display: none;background:#fff;width:200px;">
                                    <form method="post"  id='rjform{{$value->idRegistration}}}'>
                                    {!! Form::text('remarks',null,['class' => 'form-control','required'=>'required','placeholder'=>'Remarks','id'=>'remarks'.$value->idRegistration]) !!}
                                    <button type="button" id="rejectbtn{{$value->idRegistration}}" onclick="rejectData({{$value->idRegistration}})" class="btn btn-raised btn-success">Reject</button>
                                    </form>
                                    <span id="rejmsg{{$value->idRegistration}}" style="color:green;"></span>
                                </div>
                                <button id="mv{{$value->idRegistration}}" class="btn btn-raised btn-success" onclick="moveEnquiry({{$value->idRegistration}})">Move to Registration</button>
                                <span id="mvsuccessmsg{{$value->idRegistration}}" style="color:green;"></span>
                                @endif
                            </td>
                        </tr>
                        <?php $i++; ?>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
    $(function () {
        $("#tableexps").dataTable().fnDestroy();
        $('#tableexps').DataTable({
            dom: 'Bfrtip',
            buttons: [
                { extend: 'csv', text: 'Export to Excel',title:'Student Enquiry List',
                    exportOptions: {
                        columns: [0,1,3,4,5,6,7]
                    }
                }
                
            ]
        });  
});
    function moveEnquiry(regid){         
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        }); 
        $.ajax({
            type: "POST",
            url: "{{url('/school/enquiry-move/') }}",
            data: {idRegistration:regid},
            dataType: 'json',
            success: function (data) {
                
                if (data[Object.keys(data)[0]] === 'SUCCESS') {
                    $('#mvsuccessmsg' + regid).empty();
                    $('#mv'+regid).hide();
                    $('#mvsuccessmsg'+ regid).append('<span> Moved to Registration <a href="/school/registered-students/'+regid+'">Edit Now</a></span>');
                } else {                  //False Case: With error msg
                    $("#msg").html(data);   //$msg is the id of empty msg
                }

            },

            error: function (data) {
                var errors = data.responseJSON.errors;
                $('#errormsg' + patid).empty();
                errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
                $('#errormsg' + patid).html(errorate);
                
            }
        });
    }
    function savePaymentStatus(regid){
        var pstatus = $("#payst"+regid).val();
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $.ajax({
            type: "POST",
            url: "{{url('/school/update-remarks/') }}",
            data: {idRegistration:regid,paymentStatus:pstatus,},
            dataType: 'json',
            success: function (data) {
                
                if (data[Object.keys(data)[0]] === 'SUCCESS') {
                    //True Case i.e. passed validation
                    console.log('#paysuccessmsg'+regid);
                    $('#paysuccessmsg' + regid).empty();
                    $('#paymentbtn'+regid).hide();
                    $('#paysuccessmsg'+ regid).append('<span>Remark Updated !!</span>');
                    
                } else {                  //False Case: With error msg
                    $("#msg").html(data);   //$msg is the id of empty msg
                }

            },

            error: function (data) {
                var errors = data.responseJSON.errors;
                $('#errormsg' + patid).empty();
                errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
                $('#errormsg' + patid).html(errorate);
                
            }
        });
    }
    function rejForm(regid){
        $('#rejectform'+regid).show();
        $('#reject'+regid).hide();
    }
    function showForm(regid){
        $('#adissionform'+regid).show();
        $('#admit'+regid).hide();
    }
     function saveData(regid) {
        var section = $("#section"+regid).val();
        var ecno = $("#ecno"+regid).val();
        console.log(section);
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $.ajax({
            type: "POST",
            url: "{{url('/school/registered-students/') }}",
            data: {idRegistration:regid,idSection:section,ecNo:ecno},
            dataType: 'json',
            success: function (data) {
                if (data[Object.keys(data)[0]] === 'SUCCESS') {
                    //True Case i.e. passed validation
                    $('#successmsg' + regid).empty();
                    $('#submitbtn'+regid).hide();
                    $('#successmsg'+ regid).append('<span>Data Saved Successfully !!</span>');
                    
                } else {                  //False Case: With error msg
                    $("#msg").html(data);   //$msg is the id of empty msg
                }

            },

            error: function (data) {
                var errors = data.responseJSON.errors;
                $('#errormsg' + patid).empty();
                errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
                $('#errormsg' + patid).html(errorate);
                
            }
        });
    }
    function rejectData(regid) {
        var remarks = $("#remarks"+regid).val();
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $.ajax({
            type: "POST",
            url: "{{url('/school/reject-students/') }}",
            data: {idRegistration:regid,remarks:remarks},
            dataType: 'json',
            success: function (data) {
                if (data[Object.keys(data)[0]] === 'SUCCESS') {
                    //True Case i.e. passed validation
                    $('#rejmsg' + regid).empty();
                    $('#rejectbtn'+regid).hide();
                    $('#rejmsg'+ regid).append('<span>Data Saved Successfully !!</span>');
                    
                } else {                  //False Case: With error msg
                    $("#msg").html(data);   //$msg is the id of empty msg
                }

            },

            error: function (data) {
                var errors = data.responseJSON.errors;
                $('#errormsg' + patid).empty();
                errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
                $('#errormsg' + patid).html(errorate);
                
            }
        });
    }
</script>
@stop

Copyright © 2021 - 2025 IMMREX7