Elimde 4 kişinin bilgileri olan bir liste var. Bu listeleri pdf olarak indirebiliyorum. Ama ben sadece checkbox ile seçili olan kişileri indirmek istiyorum.
http://i.hizliresim.com/Ly1Nlz.png
web.php
Route::get('pdfview',array('as'=>'pdfview','uses'=>'ExcelController@pdfview'));
ExcellController.php
public function pdfview(Request $request)
{
$uyes=DB::table("uye")->get();
view()->share('uye',$uyes);
if($request->has('download')){
$pdf = PDF::loadView('pdfview');
return $pdf->download('kisiListesi.pdf');
}
return view('pdfview');
}
pdfview.blade.php
<div class="box-body" style="font-family: DejaVu Sans, sans-serif;">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr style="border: 1px solid black; text-align:center;">
<th>No</th>
<th>Adı</th>
<th>Soyadı</th>
<th>E-Mail</th>
</tr>
</thead>
<tbody>
@php
$i = 1
@endphp
@foreach($uye as $uyes)
<tr>
<td>{!! $i++ !!}</td>
<td>{!! $uyes -> adi !!}</td>
<td>{!! $uyes -> soyadi !!}</td>
<td>{!! $uyes -> email !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
listele.blade.php
@extends('master')
@section('content')
@if(session('mesaj'))
<div class="alert alert-success">
{{ session('mesaj') }}
</div>
@endif
<div class="box-header">
<h3 class="box-title">Üye Listele</h3>
</div>
<di>
<a href="{{ URL::to('deleteAll') }}" class="btn btn-danger" style="margin-left: 10px">Hepsini Sil</a>
</di>
<div class="btn-group">
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#yukle" >Kişi Yükle</button>
<div class="modal fade" id="yukle" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h2 class="header">Kişileri Yükle</h2>
</div>
<form action="postImport" method="post" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="file" name="uye"><br>
<button type="submit">Yükle</button>
</form>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<a href="{{ URL::to('getExport') }}" class="btn btn-info">Excel ile İndir</a>
<a href="{{ route('pdfview',['download'=>'pdf']) }}" class="btn btn-danger">PDF ile İndir</a>
</div>
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Seç</th>
<th>No</th>
<th>Adı</th>
<th>Soyadı</th>
<th>E-Mail</th>
<th>İşlemler</th>
</tr>
</thead>
<tbody>
@php
$i = 1
@endphp
@foreach($uyes as $uye)
<tr>
<th>
<form method="post">
<input type="checkbox" name="sec" class="checkbox">
</form>
</th>
<td>{!! $i++ !!}</td>
<td>{!! $uye -> adi !!}</td>
<td>{!! $uye -> soyadi !!}</td>
<td>{!! $uye -> email !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection