@extends('layouts.dashboard')

@section('page_title')
	Bank
@endsection

@section('page_header_title')
	Manage Bank
@endsection



@section('page_body')

{{ Breadcrumbs::render('bank') }}

	<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                	  <div class="card-header">
                       @if(Auth::user()->hasAnyPermission(['All','Add Bank']))
					     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_bank"><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
               @endif
            
					     <h3 class="card-title">Add Bank</h3>
					  </div>

                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>
                          
                          <th>#</th>
                          <th>Title</th>

                          <th>Account #</th>


                          <th>Branch Code</th>
                          <th>Swift Code</th>

                          <th>Name</th>
                          <th>Location</th>
                       
                          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                          
                        </tr>
                      </thead>
                      <tbody>
                          @php($pass_data = [])
                        @foreach($banks as $rows)
                         @php(
                              $pass_data = array(
                                  'id'              => Crypt::encrypt($rows->id),
                                  'bank_name'       => $rows->bank_name,
                                  'title'           => $rows->title,
                                  'account_no'      => $rows->account_no,
                                  'location'        => $rows->location,
                                  'branch_code'     => $rows->branch_code,
                                  'swift_code'      => $rows->swift_code,

                                )
                            ) 
                        <tr>
                            <td>{{$loop->iteration}}</td>
                            <td>{{$rows->title}}</td>
                            <td>{{$rows->account_no}}</td>
                            <td>{{$rows->branch_code}}</td> 
                            <td>{{$rows->swift_code}}</td> 

                          <td>{{ucfirst($rows->bank_name)}}</td>
                           <td>{{$rows->location}}</td>
                              <td class="text-center">

                                  <div class="item-action dropdown">
                                    <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
                                    <div class="dropdown-menu dropdown-menu-right">
                                   
                                    @if(Auth::user()->hasAnyPermission(['All','Update Bank']))
                                      <a onclick="update(event,'{{json_encode($pass_data)}}','form_update_bank','md_update_bank')" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
                                      @endif

                                      <a href="{{route('bank.trash',['id' => Crypt::encrypt($rows->id)])}}" content ="remove bank" class="dropdown-item  cls_delete"><i class="dropdown-icon  fa fa-trash"></i> Remove </a>
                                     

                                
                                     
                                     
                                    </div>
                                  </div>
                               </td>
                        </tr>
                        @endforeach
                      	
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>
@endsection

@section('page_modal')
  @include('bank.modals.add_bank')
  @include('bank.modals.update_bank')


@endsection

@section('page_script')
	
@endsection

  