Friday, April 28, 2017

CURD Operation index.blade.php

@extends('adminlte::page')

@section('title', 'Subscriptions')

@section('content_header')
    <h1>Subscriptions</h1>
@stop

@section('content')

<!-- @foreach($subscriptions as $subscription)

<li>{!! $subscription['subscription_name'] !!}
{!! $subscription['subscription_description'] !!}
{!! $subscription[' subscription_type'] !!}</li>
@endforeach -->


@if(Session::has('message'))
<div class='alert alert-success'>{{Session::get('message')}}</div>
@endif

 <div class="col-sm-2">
<!-- <tr>
<td> -->
<a type="button" href="{{ url('admin/subscriptions/create') }}" class="btn btn-block btn-primary">Add Subscriptions</a>
<!-- </td></tr>-->
 </div>
<section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Total {{$subscriptions->total()}} Records</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example2" class="table table-bordered table-hover">
                <thead>
                <tr>
                  <th>Sr. No.</th>
                  <th>Name</th>
                  <th>Description</th>
                  <th>Price</th>
                  <th>Days</th>
                  <th>Plan Type</th>
                  <th>Created Date</th>
                  <th>Actions</th>
                </tr>
                </thead>
                <tbody>               
              
                 @foreach($subscriptions as $subscription)
                  <tr>
                 
                  <td>{!! $subscription['id'] !!}</td>
                  <td>{!! $subscription['subscription_name'] !!}</td>
                  <td>{!! $subscription['subscription_description'] !!}</td>
                  <td>{!! $subscription['subscription_price'] !!}</td>
                  <td>{!! $subscription['days'] !!}</td>
                  <td>{!! $subscription['subscription_type'] !!}</td> 
                  <td>{!! $subscription['created_at'] !!}</td> 
                  <td>
                  <div class="btn-group">
                  <button type="button" class="btn btn-success">Action</button>
                  <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                  </button>
                  <ul class="dropdown-menu" role="menu">
                   <!--  <li><a href="{{ url('admin/subscriptions/create') }}">Add Subscriptions</a></li> -->
                    <li><a href="{{ route('subscriptions.edit', $subscription['id']) }}">Edit</a></li>
                    <li><a href="{{ url('admin/subscriptions/deleterecord', $subscription['id']) }}">Delete</a></li>
                    <!--   <li><a href="#">Inactive</a></li> -->
                    <!-- <li class="divider"></li> -->             
                    <li><a href="{{ url('admin/subscriptions',$subscription['id']) }}">View</a></li>
                  </ul>
                </div>
                  </td>
                  </tr>    
                  @endforeach

                </tfoot>
              </table>
              {{$subscriptions->links()}}
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->


          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->



@stop

@section('css')
    <link rel="stylesheet" href="/css/admin_custom.css">
@stop

@section('js')
    <script> console.log('Hi!'); </script>
@stop


No comments:

Post a Comment

What are the main differences between Laravel 4 and Laravel 5.x?

Summarizing Laravel 5.0 Release notes from the above article:  1. The old app/models directory has been entirely removed. 2. Controllers...