Example #1
0
function loadRequest()
{
    $field = "structure";
    $data = openJson($field);
    $request = "http://api.archives-ouvertes.fr/search/?q=";
    /* Laboratoire */
    $id = 0;
    foreach ($data->{$field} as $building) {
        foreach ($_GET[$building->{"building"}] as $labo) {
            if ($id == 0) {
                $request = $request . 'collCode_s:' . str_replace('"', '%22', $labo);
            } else {
                $request = $request . "%20OR%20" . str_replace('"', '%22', $labo);
            }
            $id = $id + 1;
        }
    }
    /* Searcher */
    if ($id != 0) {
        $request = $request . "&fq=";
    }
    $id = 0;
    foreach ($_GET["searcherUPEM"] as $searcher) {
        if ($id == 0) {
            $request = $request . 'authFullName_t:' . str_replace('"', '%22', $searcher);
        } else {
            $request = $request . "%20OR%20" . str_replace('"', '%22', $searcher);
        }
        $id++;
    }
    /* Date */
    if ($id != 0) {
        $request = $request . "&fq=";
    }
    $request = $request . "producedDateY_i:[" . $_GET["begin"] . "%20TO%20" . $_GET["end"] . "]";
    if ($_GET["publication"] != "") {
        if ($id != 0) {
            $request = $request . "&fq=";
        }
        $request = $request . $_GET["publication"];
    }
    return $request . '&rows=100000000000000&fl=label_s,structHasAlphaAuthId_fs,labStructAddress_s,labStructCountry_s,halId_s,labStructNameId_fs,labStructAcronym_s,fr_keyword_s&indent=true';
}
Example #2
0
function publicationForm()
{
    $field = "publication";
    $name = 'code';
    $value = 'param';
    $title = 'name';
    headingForm($field);
    $result = openJson($field);
    $id = 0;
    foreach ($result->{$field} as $data) {
        $str = indent(7);
        $str = $str . '<label title="' . $data->{$title} . '">';
        $str = $str . '<input onclick="' . createFunction($field, $id) . '" ';
        $str = $str . 'type="radio" name="' . $field . '[]" value="' . $data->{$value} . '" />';
        $str = $str . $data->{$name} . "</label>\n";
        echo $str;
        $id++;
    }
}