$doc = new Doc(); $docS = new DocShared(); $promo = new Promo(); $semestre = 1; if ($semestre == 1) { if ($level == 1 || $level == 2) { $cours_l = $cours->CoursListProfS1($userid); $doc_l = $docS->allyeardocProfS1($userid); } else { $promo_id = $promo->user_promo_id($userid); $cours_l = $cours->CoursListPS1($promo_id[0]['promo_id']); $doc_l = $docS->allyeardocS1($promo_id[0]['promo_id']); } } else { if ($level == 1 || $level == 2) { $cours_l = $cours->CoursListProfS2($userid); $doc_l = $docS->allyeardocProfS2($userid); } else { $promo_id = $promo->user_promo_id($userid); $cours_l = $cours->CoursListPS2($promo_id[0]['promo_id']); $doc_l = $docS->allyeardocS2($promo_id[0]['promo_id']); } } //var_dump($cours_l); //var_dump($doc_l); if ($level == 1 || $level == 2) { $doc_l_p = $doc->getAll($userid); echo $twig->render("mes_cours.html.twig", array("cours" => $cours_l, "doc" => $doc_l, "docf" => $doc_l_p)); } else { echo $twig->render("mes_cours.html.twig", array("cours" => $cours_l, "doc" => $doc_l)); }