IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/library/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/library/library_rfid.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-lg-6 col-md-6 col-sm-6">
        <div class="card">
            <div class="header">
                <h2><strong>@if(isset($rfid))Edit @else  Add @endif</strong>RFID</h2>
            </div>
            <div class="body">
                @if(isset($rfid))
                {!! Form::model( $rfid, ['route' => ['bookrfids.update', $rfid->idLibraryRFID], 'method' => 'put','class'=>'form-horizontal'] ) !!}
                @else
                {!! Form::open(['url' => 'school/bookrfids','class'=>'form-horizontal','id'=>'form']) !!}
                @endif
                
                
                <div class="row clearfix">
                    <div class="col-sm-4 form-control-label required">
                            <label for="classname">Machine ID</label>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                {!! Form::text('rfidName',null,['class' => 'form-control','required'=>'required']) !!}
                                @if ($errors->has('rfidName'))
                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                    <strong>{{ $errors->first('rfidName') }}</strong>
                                </label>
                                @endif
                            </div>
                        </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        @if(isset($rfid))
                        {!! Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                        @else
                        {!! Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                        @endif
                        {!! Form::close() !!} 
                    </div>
                </div>
            </div>
        </div>
    </div
</div>
<div class="col-sm-6">
        <div class="card">
            <div class="header">
                <h2><strong>List Of  RFID </strong></h2>
            </div>
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover js-basic-example dataTable">
                    <thead>
                        <tr>
                            <th>S.NO.</th>
                            <th>Name</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1; ?>
                        @foreach($rfids as $var)
                        <tr>
                            <td>{{ $i }}</td>
                            <td>{{$var->rfidName}}</td>
                            <td>
                                <a href='{{url('/school/bookrfids/'.$var->idLibraryRFID.'/edit')}}'  class="btn btn-raised btn-info waves-effect btn-round"><i class="fa fa-edit"></i>Edit</a>
                                <button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="{{$var->idLibraryRFID}}" data-type="confirm">DELETE</button>
                            </td>
                        </tr>
                        <?php $i++; ?>
                        @endforeach

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(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  RFID!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "DELETE",
                url: "{{url('/school/bookrfids/')}}" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "RFID has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});
// Saving form data
</script>
@stop

Copyright © 2021 - 2025 IMMREX7