So im working on a CRM software in YetiForce and my task is to download data records and calculate only these that match specified Date frames.
I have a html form where user gives Date frames:
<div class="modal-header">
<h5 class="modal-title">Kalkulator kosztu eksploatacji</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="CostCalculator.php" method="post">
<h4>End Date</h4>
<input type="date" name="startDate"><br>
<h4>Start Date</h4>
<input type="date" name="endDate"><br><br>
<input type="submit">
</form>
</div>
{/strip}
then the data is passed to the CostsCalculator.php where i need to make calculations
use App\Controller\Action;
use App\Request;
class Cars_CostsCalculator_Action extends Action
{
public function checkPermission(Request $request): void
{
}
public function process(Request $request): void
{
$startDate = $request->get('startDate');
$endDate = $request->get('endDate');
#Calculations
$response = new Vtiger_Response();
$response->setResult('success');
$response->emit();
}
}
I know that i need to do query and download the records but,I have no idea how to download only records that are in the data frame specified by the user
Can anyone help me?
source https://stackoverflow.com/questions/70354186/downloading-data-records-only-between-specified-date-frame
Comments
Post a Comment