Guys I am working with a milk farm project
This is my project view.blade screen
Refer: https://imgur.com/a/R24pAzT
My problem is I need to search and then download as pdf and download as excel.
After search the search result is displayed in the screen. That content I must download as pdf(as report) or excel.
Now I will explain the image I attached. The image I attached is a view.blade file.
In that I have displayed the whole records of my table in tabular format.
I have 2 textboxes (date format) from_date and to_date and 3 buttons (search, download pdf, download excel)
First I will give the form and to date then I will press search button it displays the search result in the same view.blade form.
Then if I need I should download the search result as pdf(as report) and excel.
Another thing the total sum of the column must also displayed in the last row. That is sum(no_of_litres) it must be added totally and displayed in the bottom last row.
Based on the search the sum must be done.
This is what I need. The search must be viewed in the same view.blade file.
How to perform this task.
This is my view.blade file, I didn’t use {!! Form::open() !!} and {!! Form::close() !!} Tags.
<caption><h2 align="center">EXCESS MILK PREVIEW</h2></caption>
<div class="form-group row">
<div class="col-sm-4">
{{ Form::label('frmdate','From Date') }}
{{ Form::date('frmdate',null,array('class'=>'form-control')) }}
</div>
<div class="col-sm-4">
{{ Form::label('todate','To Date') }}
{{ Form::date('todate',null,array('class'=>'form-control')) }}
</div>
<br>
<div class="col-sm-4">
<div class="form-group row">
<div class="col-sm-4">
<a href="" class="btn btn-success btn-sm" style="width: 100%; margin-bottom:10px"</td>Search</a>
</div>
<div class="col-sm-4">
<a href="" class="btn btn-success btn-sm" style="width: 100%; margin-bottom:10px"</td>Download PDF</a>
</div>
<div class="col-sm-4">
<a href="" class="btn btn-success btn-sm" style="width: 100%; margin-bottom:10px"</td>Download Excel</a>
</div>
</div>
</div>
</div>
Just i pasted the 2 textboxes and the 3 buttons
How can I write functions for these three buttons? Whether I can write in same function else each different function.
According to my knowledge I thought it’s better to write three different functions in the controller. Kindly someone suggest idea please.
Still I didn’t write any functions definition in the controller need idea.
I think everyone understood the question
Already I have discussed related to this in previous questions in this forum.
How to pass data without not using form tag and not by ajax call like this lots of discussions are made in the previous questions
Refer :
How to pass data from blade to controller in laravel?
Problem in sum('total') shows an error in laravel
How to sum the columns and display it in view file laravel
Route not defined problem in laravel even it was defined
Error in Maatwebsite to export excel file in laravel
All the questions target to one point only. So to make it clear I made this question.
But I think I am confusing everyone who responding to me that’s why I made a clear cut question here
Kindly don’t get irritated and please suggest me a clear idea about this please. Thisis my last concept in my project
Thank you..