v1.5.24bb Added comments

This commit is contained in:
2021-05-21 12:28:38 +02:00
parent 20fe7dbcee
commit 3b0b2ff759
7 changed files with 99 additions and 8 deletions
@@ -214,19 +214,25 @@ class MenuPlanController extends Controller
* @return RedirectResponse
*/
public function genPDF($Id){
//get the menuplan with the matching id
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
//Sub string cap
$var = 250;
//Substring the data
$menuPlan->monday = substr($menuPlan->monday, 0, $var);
$menuPlan->tuesday = substr($menuPlan->tuesday, 0, $var);
$menuPlan->wednesday = substr($menuPlan->wednesday, 0, $var);
$menuPlan->thursday = substr($menuPlan->thursday, 0, $var);
//Pass the substring data to the genPDF pages
$pdf = PDF::loadView('pdf.menuplan', ["menuPlan" => $menuPlan]);
//PDF config
$pdf->setPaper('A4', 'portrait');
//return the pdf
return $pdf->stream("menuplan_uge_".$menuPlan->week.".pdf");
}