?> ><?php echo $Lfemale[$lang]; ?> </OPTION> </SELECT> </div> <!-- 検索条件 --> <div class="form-group"> <label><?php echo $Lname[$lang]; ?> ,WCA ID</label> <input type='text' class='form-control' name='search' value='<?php echo $search; ?> '> </div> <button type="submit" class="btn btn-primary form-control-static"><?php echo $Lsubmit[$lang]; ?> </button> </form> <?php getPersons(); ?> </div> </body> </html>
$query->execute(array('photo' => $imageName)); // insert new persons $persons = array_filter(explode(',', $_POST['persons'])); $query = $db->prepare('INSERT INTO photo2person (photo, person) VALUES (:photo, :person)'); foreach ($persons as $person) { $query->execute(array('photo' => $imageName, 'person' => $person)); } } // load persons $query = $db->prepare('SELECT person FROM photo2person WHERE photo = :photo ORDER BY person ASC'); $query->execute(array('photo' => $imageName)); $persons = array_map(function ($person) { return $person['person']; }, $query->fetchAll()); // load all persons $allPersons = getPersons(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="../css/selectize.css"> <script src="../js/jquery.js"></script> <script src="../js/selectize.js"></script> </head> <body> <img style="max-width: 100%;" src="../photos/large/<?php echo $imageName; ?> " /> <form method="POST">
$template->set_attribute('edit_role', $role->getId()); } else if (Request::submitted('choosePreset')) { $template->set_attribute('role_data', array('name' => Request::quoted('presetName'))); } $template->set_attribute('show_search_and_members_form', !LockRules::Check($range_id, 'participants')); // quickfilters foreach (getPersons($range_id, 'sem') as $k=>$v) { $quickfilter_sem[] = $k; } $template->set_attribute('quickfilter_sem', $quickfilter_sem); foreach (getPersons($range_id, 'sem_no_group') as $k=>$v) { $quickfilter_sem_no_group[] = $k; } $template->set_attribute('quickfilter_sem_no_group', $quickfilter_sem_no_group); foreach (getPersons($range_id, 'inst') as $k=>$v) { $quickfilter_inst[] = $k; } $template->set_attribute('quickfilter_inst', $quickfilter_inst); // search $search_obj = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM auth_user_md5 " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . "WHERE " . "username LIKE :input OR Vorname LIKE :input " . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR {$GLOBALS['_fullname_sql']['full_rev']} LIKE :input " . " ORDER BY fullname ASC", _("Nutzer suchen"), "user_id"); $template->set_attribute('search_obj', $search_obj);
if (!empty($_POST['persons'])) { $hash = hash('sha1', uniqid(rand(), true)); // insert new persons $persons = array_filter(explode(',', $_POST['persons'])); $query = $db->prepare('INSERT INTO person2hash (hash, person) VALUES (:hash, :person)'); foreach ($persons as $person) { $query->execute(array('hash' => $hash, 'person' => $person)); } header('Location: ' . Config::HOST . Config::BASE_URI . 'manage/generateQRCode.php?hash=' . $hash); exit; } if (!empty($_GET['delete'])) { $query = $db->prepare('DELETE FROM person2hash WHERE hash = :hash'); $query->execute(array('hash' => $_GET['delete'])); } $persons = getPersons(); // get active hashes $query = $db->prepare('SELECT GROUP_CONCAT(person ORDER BY person ASC SEPARATOR ", ") as persons, hash FROM person2hash GROUP BY hash'); $query->execute(); $hashes = $query->fetchAll(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="../css/selectize.css"> <script src="../js/jquery.js"></script> <script src="../js/selectize.js"></script> </head> <body> <?php
function addMetaElement(&$object, $namespace, $elementName, $elementAttributeArray, $elementContent, $elementType = "", $format = "xml") { $addStatus = false; if (!empty($elementName) and !empty($elementContent)) { // Preprocess element contents (if necessary): // - 'creator', 'contributor': if (preg_match("/^(creator|contributor)\$/", $elementName)) { $elementContent = getPersons($elementContent); } elseif ($elementName == "identifier" and $elementType == "doi") { $elementContent = "info:doi/" . $elementContent; } elseif ($elementName == "identifier" and $elementType == "pmid") { // extract any PubMed ID from the given '$elementContent': // NOTE: should this better be done in the calling function? $pubmedID = preg_replace("/.*?PMID *: *(\\d+).*/i", "\\1", $elementContent); $elementContent = "info:pmid/" . $pubmedID; } elseif ($elementName == "identifier" and $elementType == "arxiv") { // extract any arXiv ID from the given '$elementContent': // NOTE: see note for PMID $arxivID = preg_replace("/.*?arXiv *: *([^ ;]+).*/i", "\\1", $elementContent); $elementContent = "info:arxiv/" . $arxivID; } elseif ($elementName == "identifier" and $elementType == "isbn") { $elementContent = "urn:ISBN:" . $elementContent; } elseif ($elementName == "identifier" and $elementType == "issn") { $elementContent = "urn:ISSN:" . $elementContent; } elseif ($elementName == "identifier" and $elementType == "openurl") { if (!preg_match("/^openurl:/", $elementContent)) { $elementContent = "openurl:" . $elementContent; } // use "openurl:" prefix if doesn't already exist in the given OpenURL } elseif ($elementName == "identifier" and $elementType == "url") { $elementContent = "url:" . $elementContent; } elseif ($elementName == "identifier" and $elementType == "citekey") { $elementContent = "citekey:" . $elementContent; } elseif ($elementName == "identifier" and $elementType == "citation") { $elementContent = "citation:" . $elementContent; } elseif ($elementName == "source" and $elementType == "series") { $elementContent = "series:" . $elementContent; } elseif ($elementName == "source" and $elementType == "issn") { $elementContent = "urn:ISSN:" . $elementContent; } elseif ($elementName == "relation" and $elementType == "url") { $elementContent = "url:" . $elementContent; } elseif ($elementName == "relation" and $elementType == "file") { $elementContent = "file:" . $elementContent; } elseif ($elementName == "type") { if (preg_match("/^((Simple|oai)?[- _]?(dc|Dublin[- _]?Core)[- _]?(terms)?)\$/i", $namespace)) { // Map refbase types to the corresponding eprint/resource types suggested for Simple // Dublin Core (<http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/#type>): $dcTypesArray = mapDCTypes(); // NOTE: for '$elementName="type"', variable '$elementType' is supposed to contain the // thesis type from the refbase 'thesis' field (e.g. "Ph.D. thesis") if (isset($dcTypesArray[$elementContent]) and empty($elementType)) { $elementContent = $dcTypesArray[$elementContent]; } elseif (!empty($elementType)) { $elementContent = $dcTypesArray["Thesis"]; } } } // - 'subject': if ($elementName == "subject") { $elementContent = preg_split("/\\s*;\\s*/", $elementContent, -1, PREG_SPLIT_NO_EMPTY); } // get an array of all keywords // - 'language': // TODO: convert to ISO notation (i.e. "en" instead of "English", etc) // see <http://www.loc.gov/standards/iso639-2/php/code_list.php> if ($elementName == "language") { $elementContent = preg_split("/\\s*[;,]\\s*/", $elementContent, -1, PREG_SPLIT_NO_EMPTY); } // get an array of all languages // Prefix element name with given namespace: if (!empty($namespace)) { $elementName = $namespace . ":" . $elementName; } // Add metadata element(s) to the given object: if (is_array($elementContent)) { foreach ($elementContent as $singleElement) { addNewBranch($object, $elementName, $elementAttributeArray, $singleElement); } } else { // add string in '$elementContent' as a new element: addNewBranch($object, $elementName, $elementAttributeArray, $elementContent); } $addStatus = true; } return $addStatus; }