<form class="navbar-search pull-left"> <input type="text" class="search-query" data-provide="typeahead" data-items="4" data-source='["Taylor","Drew","Tot"]'> </form> </li> <li class="divider-vertical"></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <?php echo getuser(); ?> <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#editProfile">My Profile</a></li> <li><a href="php/logOut.php">Log Out</a></li> <li class="divider"><li> <?php foreach (choirs() as $id => $name) { echo "<li><a href='#' onclick='setChoir(\"{$id}\")' style='" . ($id == $CHOIR ? "font-weight: bold" : "") . "'>{$name}</a></li>"; } ?> </ul> </li> <?php } ?> </ul> </div> </div> </div> <div class="span11 block" id="main" style='margin-bottom: 100px'></div> </div> </div>
$userinfo = array(); if ($USER) { $userinfo = mysql_fetch_array(mysql_query("select * from `member` where `email` = '{$USER}'")); $query = mysql_query("select `enrollment` from `activeSemester` where `member` = '{$USER}' and `semester` = '{$SEMESTER}'"); if (mysql_num_rows($query) == 0) { $userinfo["registration"] = "inactive"; } else { $res = mysql_fetch_array($query); $userinfo["registration"] = $res['enrollment']; } $query = mysql_fetch_array(mysql_query("select `section` from `activeSemester` where `member` = '{$USER}' and `semester` = '{$SEMESTER}' and choir = '{$CHOIR}'")); $userinfo["section"] = $query["section"]; } $fields = array(array("firstName", "First Name", "text", 1), array("prefName", "Preferred Name", "text", 0), array("lastName", "Last Name", "text", 1), array("section", "Section", "select", 1, $USER ? sections() : array()), array("email", "Email", "text", 1), array("password", "Password", "password", 1), array("password2", "Confirm password", "password", 1), array("phone", "Phone number (digits only)", "text", 1), array("picture", "Picture (URL)", "text", 0), array("registration", "Are you in the class or club?", "radio", 1, array("class" => "Class", "club" => "Club")), array("passengers", "How many passengers (<i>aside from yourself</i>) can ride in your car? (0 if you don't have a car)", "number", 1), array("onCampus", "Do you live on campus?", "bool", 1), array("location", "Where do you live? (for carpool purposes)", "text", 1), array("about", "About you (public)", "text", 0), array("major", "Your major", "text", 1), array("minor", "Your minor", "text", 0), array("hometown", "Your hometown", "text", 1), array("techYear", "How many years have you been at GT?", "number", 0), array("gChat", "GChat screen name", "text", 0), array("twitter", "Twitter handle", "text", 0), array("gatewayDrug", "How did you hear about this organization?", "text", 0), array("conflicts", "Any conflicts we should know about", "text", 0)); if (!$USER) { array_splice($fields, 3, 0, array(array("choir", "Organization (If you are in several, choose one to start and add yourself to the others later)", "select", 1, choirs()))); } $form = ""; foreach ($fields as $field) { $name = $field[0]; echo "<div class='control-group'><label class='control-label wider" . ($field[3] ? " required" : "") . "' for='" . $name . "'>" . $field[1] . "</label><div class='controls'>"; if ($field[2] == "text" || $field[2] == "password" || $field[2] == "number" || $field[2] == "date") { echo "<input type='" . $field[2] . "' name='" . $name . "'" . ($USER && $field[2] != "password" ? " value='" . $userinfo[$name] . "'" : "") . ">"; } else { if ($field[2] == "bool") { echo "<input type='checkbox' name='" . $name . "'" . ($USER && $userinfo[$name] != 0 ? " checked" : "") . ">"; } else { if ($field[2] == "select") { echo dropdown($field[4], $name, $USER ? $userinfo[$name] : ""); } else { if ($field[2] == "radio") {