--- a/common.inc.php +++ b/common.inc.php @@ -3,11 +3,10 @@ try { $conn = new PDO("pgsql:dbname=scannr;user=postgres;password=snmc;host=localhost"); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -} -catch(PDOException $e) { +} catch (PDOException $e) { die('Unable to connect to database server.'); } -catch(Exception $e) { +catch (Exception $e) { die('Unknown error in ' . __FILE__ . '.'); } $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); @@ -15,11 +14,12 @@ $DATA_DIR = "./data"; /** Returns the offset from the origin timezone to the remote timezone, in seconds. - * @param $remote_tz; - * @param $origin_tz; If null the servers current timezone is used as the origin. - * @return int; + * @param $remote_tz; + * @param $origin_tz; If null the servers current timezone is used as the origin. + * @return int; */ -function get_timezone_offset($remote_tz, $origin_tz = null) { +function get_timezone_offset($remote_tz, $origin_tz = null) +{ if ($origin_tz === null) { if (!is_string($origin_tz = date_default_timezone_get())) { return false; // A UTC timestamp was returned -- bail out! @@ -34,60 +34,69 @@ } +function include_header($title) +{ + global $basePath; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -function include_header($title) { - global $basePath; - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -