function reqhtml($id_requirement, $id_layout, $capacities, $types, $roomsByName, $cvicenie, &$req, $student_count, $poziadavka_prebrata) { $id = $id_requirement . $id_layout; $display = $cvicenie == 1 || $req ? "block" : "none"; $disabledReq = hasAttr(!$req, "disabled"); if ($req) { //nacitame povodne hodnoty $pract_hours = $req["pract_hours"]; $pract_paralell = $req["pract_paralell"]; $comment = $req["comment"]; $notebook = hasAttr($req["equipment"]["notebook"], "checked"); $beamer = hasAttr($req["equipment"]["beamer"], "checked"); } else { //defaultne hodnoty $pract_hours = 2; $pract_paralell = 2; $comment = ""; $notebook = ""; $beamer = ""; } $group1 = grouphtml($id_requirement, $id_layout, $capacities, $types, $roomsByName, '1', $req['rooms']['1'], $student_count, $poziadavka_prebrata); $group2 = grouphtml($id_requirement, $id_layout, $capacities, $types, $roomsByName, '2', $req['rooms']['2'], $student_count, $poziadavka_prebrata); $html = ' <div id="heading' . $id . '" style="display: ' . $display . ';">Cvičenie: ' . $cvicenie . '</div> <div id="lecture' . $id . '" class="color2" style="display: ' . $display . ';"> <div class="row"> <div class="left_side">Rozsah cvičenia:</div> <div class="right_side"><input size="5" value="' . $pract_hours . '" class="common_input" name="requirement[layouts][' . $id_layout . '][requirement][' . $id_requirement . '][pract_hours]" ' . $disabledReq . '/> hodiny</div> </div> <div class="row"> <div class="left_side">Maximálny počet cvičení súčasne:</div> <div class="right_side"><input size="5" value="' . $pract_paralell . '" class="common_input" name="requirement[layouts][' . $id_layout . '][requirement][' . $id_requirement . '][pract_paralell]" ' . $disabledReq . '/></div> </div> <div class="row"> <div class="left_side">Vybavenie miestnosti:</div> <div class="right_side"> <input type="checkbox" style="margin-left: 0px;" class="common_input" name="requirement[layouts][' . $id_layout . '][requirement][' . $id_requirement . '][equipment][notebook]" ' . $disabledReq . ' ' . $notebook . '/> notebook <div style="width:190px;float:right;"> <input type="checkbox" style="margin-left: 0px;" class="common_input" name="requirement[layouts][' . $id_layout . '][requirement][' . $id_requirement . '][equipment][beamer]" ' . $disabledReq . ' ' . $beamer . '/> projektor </div> </div> </div> ' . $group1 . ' ' . $group2 . ' <div class="row"> <div class="left_side">Poznámka:</div><br/> <div class="right_side"><textarea rows="3" style="height:52px;" cols="70" name="requirement[layouts][' . $id_layout . '][requirement][' . $id_requirement . '][comment]" ' . $disabledReq . '>' . $comment . '</textarea></div> </div> </div> '; return $html; }
function reqhtml($id_requirement, $id_layout, $cvicenie, $req, $rooms_nazvy, $types) { if (empty($req)) { return; } $id = $id_requirement . $id_layout; $pract_hours = $req["pract_hours"]; $pract_paralell = $req["pract_paralell"]; $comment = $req["comment"]; $group1 = grouphtml($id_requirement, $id_layout, '1', $req['rooms']['1'], $rooms_nazvy, $types); $group2 = grouphtml($id_requirement, $id_layout, '2', $req['rooms']['2'], $rooms_nazvy, $types); $html = ' <div id="heading' . $id . '" style="display: block;">Cvičenie: ' . $cvicenie . '</div> <div id="lecture' . $id . '" class="color2" style="display: block;"> <div class="row"> <div class="left_side">Rozsah cvičenia:</div> <div class="right_side"><input size="5" readonly="readonly" value="' . $pract_hours . '" /> hodiny</div> </div> <div class="row"> <div class="left_side">Maximálny počet cvičení súčasne:</div> <div class="right_side"><input size="5" readonly="readonly" value="' . $pract_paralell . '" /></div> </div> ' . $group1 . ' ' . $group2 . ' <div class="row" style="width: 400px;"> <div class="left_side" style="width: 400px;">Poznámka:</div><br/> <div class="right_side" style="width: 400px;"><textarea readonly="readonly" rows="3" style="height:52px;" cols="70">' . $comment . '</textarea></div> </div> </div> '; return $html; }