} $optionUser .= " value=\"" . $userResult[$i]['UserID'] . "\">" . $userResult[$i]['LastName'] . ", " . $userResult[$i]['FirstName'] . "</option>"; } //Get list of events $eventResult = DBAccess::getEvents(1); $rows = count($eventResult, 0); $optionEvent = ""; $optionEvent .= "<option value=\"0\">NO EVENT</option>"; for ($i = 0; $i < $rows; $i++) { $optionEvent .= "<option "; if ($eventResult[$i]['EventID'] == $_POST['targetEventID']) { $optionEvent .= "selected=selected"; } $optionEvent .= " value=\"" . $eventResult[$i]['EventID'] . "\">" . $eventResult[$i]['EventDate'] . ", " . $eventResult[$i]['EventName'] . "</option>"; } //Get list of types $classResult = DBAccess::getClassTypes(); $rows = count($classResult, 0); $optionClass = ""; $optionClass .= "<option value=\"0\">NO CLASS</option>"; for ($i = 0; $i < $rows; $i++) { $optionClass .= "<option "; if ($classResult[$i]['ClassID'] == $_POST['targetClassID']) { $optionClass .= "selected=selected"; } $optionClass .= " value=\"" . $classResult[$i]['ClassID'] . "\">" . $classResult[$i]['ClassValue'] . ": " . $classResult[$i]['ClassName'] . "</option>"; } $title = 'Create Event'; $head = ''; $content = "\n<h3 class=\"heading\">Upload a photo (member or general)</h3>\t\n\n<div class='container'>\n\t<form name=\"newEvent\" action=\"addPhoto.php\" method=\"POST\" enctype=\"multipart/form-data\">\n\t\t<label class=\"formLabel\">Photo Name</label>\n\t\t<input type=\"text\" style=\"" . $photoNameErrorStyle . "\" name=\"photoName\" class=\"formField\" value=\"" . $photoName . "\">\n\t\t<label class=\"formError\">" . $photoNameErrorText . "</label>\n\t\t\n\t\t<label class=\"formLabel\">Photo Description</label>\n\t\t<input type=\"text\" style=\"" . $photoDescriptionErrorStyle . "\" name=\"photoDescription\" class=\"formField\" value=\"" . $photoDescription . "\">\n\t\t<label class=\"formError\">" . $photoDescriptionErrorText . "</label>\n\t\t\n\t\t<label class=\"formLabel\">Photo Date</label>\n\t\t<input type=\"text\" style=\"" . $photoDateErrorStyle . "\" name=\"photoDate\" id=\"datepicker\" class=\"formField\" value=\"" . $photoDate . "\">\n\t\t<label class=\"formError\">" . $photoDateErrorText . "</label>\n\t\t\n\t\t<label class=\"formLabel\">Created by</label>\n\t\t<select class=\"formField\" name=\"targetUserID\" >\n\t\t" . $optionUser . "\n\t\t</select>\n\t\t<label class=\"formError\">" . $userIDErrorText . "</label>\n\t\t\n\t\t\n\t\t<label class=\"formLabel\">Event Name</label>\n\t\t<select class=\"formField\" name=\"targetEventID\" >\n\t\t" . $optionEvent . "\n\t\t</select>\n\t\t<label class=\"formError\">" . $eventIDErrorText . "</label>\n\t\t\n\t\t<label class=\"formLabel\">Picture Class</label>\n\t\t<select class=\"formField\" name=\"targetClassID\" >\n\t\t" . $optionClass . "\n\t\t</select>\n\t\t<label class=\"formError\">" . $classIDErrorText . "</label> \n\t\t\n\t\t\n\t\t<label class=\"formLabel\">Picture</label>\n\t\t<input type=\"file\" name=\"file\" class=\"formField\" id=\"file\">\n\t\t<label class=\"formError\">." . $classPicErrorText . "</label>\n\t\t\t\t\n\t\t<input type=\"hidden\" name=\"Submitted\" value=\"submitted\">\n\t\t\n\t\t<input type=\"submit\" value=\"Submit\" class=\"formLabel\">\n\t</form>\n\t<label class=\"error\">" . $feedBack . "</label>\n\t<span style=\"clear: left; display: block;\"></span>\n</div>\n\n"; require '../template/adminTemplate.php';