Ejemplo n.º 1
0
// Meteor Pi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meteor Pi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Meteor Pi.  If not, see <http://www.gnu.org/licenses/>.
// -------------------------------------------------
require "php/imports.php";
require_once "php/html_getargs.php";
$getargs = new html_getargs(true);
$pageInfo = ["pageTitle" => "Search for still images", "pageDescription" => "Meteor Pi", "activeTab" => "search", "teaserImg" => null, "cssextra" => null, "includes" => [], "linkRSS" => null, "options" => []];
// Paging options
$pageSize = 24;
$pageNum = 1;
if (array_key_exists("page", $_GET) && is_numeric($_GET["page"])) {
    $pageNum = $_GET["page"];
}
// Read which time range to cover
$t2 = time();
$t1 = $t2 - 3600 * 24 * 5;
$tmin = $getargs->readTime('year1', 'month1', 'day1', 'hour1', 'min1', null, $const->yearMin, $const->yearMax, $t1);
$tmax = $getargs->readTime('year2', 'month2', 'day2', 'hour2', 'min2', null, $const->yearMin, $const->yearMax, $t2);
// Which observatory are we searching for images from?
$obstory = $getargs->readObservatory("obstory");
// Swap times if they are the wrong way round
Ejemplo n.º 2
0
// Meteor Pi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meteor Pi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Meteor Pi.  If not, see <http://www.gnu.org/licenses/>.
// -------------------------------------------------
require "php/imports.php";
require_once "php/html_getargs.php";
$getargs = new html_getargs(false);
// Fetch list of observatories
$obstories = $getargs->obstory_objlist;
$obstory = $getargs->readObservatory("id");
$obstory_name = $getargs->obstory_objs[$obstory]['name'];
// Get oldest observation
$stmt = $const->db->prepare("\nSELECT o.obsTime FROM archive_observations o\nINNER JOIN archive_observatories l ON o.observatory = l.uid\nWHERE l.publicId=:o\nORDER BY obsTime ASC LIMIT 1;");
$stmt->bindParam(':o', $o, PDO::PARAM_STR, strlen($obstory));
$stmt->execute(["o" => $obstory]);
$oldest_obs = $stmt->fetch();
if ($oldest_obs) {
    $oldest_obs_date = date("d M Y - H:i", $oldest_obs['obsTime']);
} else {
    $oldest_obs_date = "&ndash;";
}
// Get newest observation
Ejemplo n.º 3
0
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meteor Pi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Meteor Pi.  If not, see <http://www.gnu.org/licenses/>.
// -------------------------------------------------
require "php/imports.php";
require_once "php/html_getargs.php";
require_once "php/set_metadata.php";
$getargs = new html_getargs(true);
// Get ID for event to display
$id = "";
if (array_key_exists("id", $_GET)) {
    $id = $_GET["id"];
}
// Get the observation
$stmt = $const->db->prepare("\nSELECT o.uid, o.observatory, o.obsTime, s.name AS semanticType\nFROM archive_observations o\nINNER JOIN archive_semanticTypes s ON o.obsType = s.uid\nWHERE publicId=:i;");
$stmt->bindParam(':i', $i, PDO::PARAM_INT);
$stmt->execute(['i' => $id]);
$observations = $stmt->fetchAll();
// Check observation exists
if (count($observations) != 1) {
    die("Requested file does not have associated observation.");
}
$observation = $observations[0];
Ejemplo n.º 4
0
// Meteor Pi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meteor Pi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Meteor Pi.  If not, see <http://www.gnu.org/licenses/>.
// -------------------------------------------------
require_once "php/imports.php";
require_once "php/html_getargs.php";
$getargs = new html_getargs(false);
// Read which month to cover
$tmin = $getargs->readTime('year', 'month', null, null, null, null, $const->yearMin, $const->yearMax);
$month_name = date('F Y', $tmin['utc'] + 1);
$month = date('n', $tmin['utc'] + 1);
$year = date('Y', $tmin['utc'] + 1);
$prev_month = date('n', $tmin['utc'] - 10 * 24 * 3600);
$prev_month_year = date('Y', $tmin['utc'] - 10 * 24 * 3600);
$next_month = date('n', $tmin['utc'] + 40 * 24 * 3600);
$next_month_year = date('Y', $tmin['utc'] + 40 * 24 * 3600);
$days_in_month = date('t', $tmin['utc'] + 1);
$day_offset = date('w', $tmin['utc'] + 1);
$period = 24 * 3600;
$obstories = $getargs->obstory_objlist;
$obstory = $getargs->readObservatory("id");
$obstory_name = $getargs->obstory_objs[$obstory]['name'];