// first we get the schedule of the assigned round. $round_id = 1; $scheduleround = $page->getRoundSchedule($round_id); // var_dump(count($scheduleround)); for ($i = 0; count($scheduleround) > $i; $i++) { $players[$scheduleround[$i]['player_id']] = $scheduleround[$i]['surname']; } // first get the players of this session_id in sequence how it is scheduled. if (count($players) == 0) { if ($_GET['alternative']) { $page->m_smarty->assign("message", "The selected round is already judged, please choose another..."); } $page->m_smarty->assign("noplayers", "true"); $page->addItem("DropDown", "roundname", "in_template"); $page->m_items['roundname']->changeOnSubmit(); $page->m_items['roundname']->setValues($page->getRounds()); $page->m_items['roundname']->startEmpty("------"); $page->m_items['roundname']->addValidation("IsInt"); $page->m_items['roundname']->m_validationrule->setErrorMessage("Please select a round"); } else { $page->addItem("InputFieldNoEdit", "roundname", "in_template"); $page->m_items['roundname']->setValue($scheduleround[0]['name']); $page->m_items['roundname']->setSize("20"); $page->addItem("InputFieldNoEdit", "roundhill", "in_template"); $page->m_items['roundhill']->setValue($scheduleround[0]['hill']); $page->m_items['roundhill']->setSize("20"); $page->addItem("InputFieldNoEdit", "kpoint", "in_template"); $page->m_items['kpoint']->setValue($scheduleround[0]['kpoint']); $page->m_items['kpoint']->setSize("20"); $page->addItem("InputFieldNoEdit", "meterpoint", "in_template"); $page->m_items['meterpoint']->setValue($scheduleround[0]['meterpoint']);