<form action="edit_subject.php?subj=<?php echo urlencode($sel_subject['id']); ?> " method="post"> <p> Subject name: <input type="text" name="menu_name" value="<?php echo $sel_subject['menu_name']; ?> " id="menu_name" /> </p> <p> Position: <select name="position"> <?php $subject_set = get_all_subjects(); $subject_count = mysql_num_rows($subject_set); for ($count = 1; $count <= $subject_count + 1; $count++) { echo "<option value=\"{$count}\""; if ($sel_subject['position'] == $count) { echo " selected"; } echo ">{$count}</option>"; } ?> </select> </p> <p> Visible: <input type="radio" name="visible" value="0" <?php if ($sel_subject['visible'] == 0) {
?> </select> <span class="help-block"><?php echo has_message("csyearlevelId") ? get_message("csyearlevelId") : ""; ?> </span> </div> </div> <div class="form-group <?php echo has_error("cssubjectId", "has-error", has_success("cssubjectId", "has-success")); ?> "> <label for="subjectIdinput" class=" control-label col-sm-4">Subject</label> <div class="col-sm-7"> <?php $all_subjects = get_all_subjects(); ?> <select class="form-control" name="cssubjectId" id="subjectIdinput" > <option value=""></option> <?php if ($all_subjects && is_array($all_subjects) && count($all_subjects) > 0) { foreach ($all_subjects as $subjecti => $subjectinfo) { echo '<option value="' . $subjectinfo->getSubjectid() . '" ' . (has_value("cssubjectUnit") ? get_value("cssubjectId") == $subjectinfo->getSubjectid() ? ' selected = "selected" ' : "" : set_select("cssubjectId", $subjectinfo->getSubjectid())) . '>'; echo $subjectinfo->subject_code . " ( " . $subjectinfo->subject_description . " )"; echo '</option>'; } } ?> </select> <span class="help-block"><?php echo has_message("cssubjectId") ? get_message("cssubjectId") : "";
function public_navigation($select_sub, $select_page, $public = true) { $output = "<ul class=\"subjects\">"; // 3. Izvrsiti query $sub_set = get_all_subjects($public); // 4. Ispsi podatke iz baze while ($menu = mysql_fetch_array($sub_set)) { $output .= "<li "; if ($menu["id"] == $select_sub["id"]) { $output .= "class=\"selected sel\" "; } $output .= "><a href=\"index.php?subj=" . urlencode($menu["id"]) . "\">{$menu['menu_name']}</a>"; if ($menu["id"] == $select_sub["id"]) { $page_set = get_all_pages_for_subject($menu["id"], $public); $output .= "<ul class=\"pages\">"; while ($page = mysql_fetch_array($page_set)) { $output .= "<li "; if ($page["id"] == $select_page["id"]) { $output .= "class=\"selected\" "; } $output .= "><a href=\"index.php?page=" . urlencode($page["id"]) . "\">{$page['menu_name']}</a></li>"; } $output .= "</ul>"; } $output .= "</li>"; } $output .= "<br/><br/>"; $output .= "<li><a href=\"staff.php\"> Staff page </a></li>"; $output .= "</ul>"; return $output; }
function public_navigation($sel_subject, $sel_page, $public = true) { $output = '<ul class="subjects">'; $subject_set = get_all_subjects($public); while ($subject = mysql_fetch_array($subject_set)) { $output .= "<li"; if ($subject["id"] == $sel_subject['id']) { $output .= " class=\"selected\""; } $output .= "><a href=\"index.php?subj=" . urlencode($subject["id"]) . "\">{$subject["menu_name"]}</a></li>"; if ($subject["id"] == $sel_subject['id']) { $page_set = get_pages_for_subject($subject["id"], $public); $output .= "<ul class=\\pages\">"; while ($page = mysql_fetch_array($page_set)) { $output .= "<li"; if ($page["id"] == $sel_page['id']) { $output .= " class=\"selected\""; } $output .= "><a href=\"index.php?page=" . urlencode($page["id"]) . "\">{$page["menu_name"]}</a></li>"; } $output .= "</ul>"; } } $output .= "</ul>"; return $output; }
function set_menu($lang) { $replace = array('/', ' ', 'Í'); $subject_set = get_all_subjects($lang); echo "<ul>"; while ($subject = mysqli_fetch_array($subject_set)) { echo "<li><a href=" . strtolower(str_replace($replace, '', $subject["url"])) . ".php>" . strtoupper($subject["menu_name"]) . "</a></li>"; } echo "</ul>"; }