mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 08:53:23 -05:00
Adds better error output, fixes #34.
This commit is contained in:
parent
a2a0b10077
commit
8ba910b37b
@ -483,11 +483,22 @@ function currency_format($value, $places = 2){
|
||||
// Time zones must be setup in mysql for this to work: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
|
||||
set_time_zone();
|
||||
function set_time_zone() {
|
||||
global $database_YBDB, $YBDB;
|
||||
|
||||
mysql_select_db($database_YBDB, $YBDB);
|
||||
$query = "SET time_zone='" . TIMEZONE . "';";
|
||||
$Recordset1 = mysql_query($query, $YBDB) or die(mysql_error());
|
||||
global $database_YBDB, $YBDB;
|
||||
|
||||
mysql_select_db($database_YBDB, $YBDB);
|
||||
$query = "SET time_zone='" . TIMEZONE . "';";
|
||||
$Recordset1 = mysql_query($query, $YBDB);
|
||||
|
||||
$error = "<p>YBDB relies heavily on accurate time calculations.</p>" .
|
||||
"<p>Make sure you have installed time zone support for mysql or mariadb as explained " .
|
||||
'<a href="https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html">here</a>.<br> ' .
|
||||
"In GNU/Linux you run the mysql_tzinfo_to_sql program from the commandline:</p>" .
|
||||
"<code>mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql.</code>";
|
||||
|
||||
if(!$Recordset1) {
|
||||
echo mysql_error() . "\n" . $error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//function to convert server time to local time. To be used by all other current date / time requests.
|
||||
@ -584,6 +595,12 @@ function list_15min($start_time, $start_offset_min, $form_name, $hours, $display
|
||||
}
|
||||
|
||||
// replacement for the hardwired list_min15()
|
||||
// $start_time = time_in
|
||||
// $start_offset_min = 0
|
||||
// $form_name = time_out
|
||||
// $hours = 0
|
||||
// $display_elapsed_hours = 1
|
||||
// $default_value = $row_Recordset1['time_out']
|
||||
function list_min($start_time, $start_offset_min, $form_name, $hours, $display_elapsed_hours, $default_value, $min=15){
|
||||
list($date, $time) = split('[ ]', $start_time);
|
||||
list($Y, $m, $d) = split('[-]', $date);
|
||||
|
Loading…
x
Reference in New Issue
Block a user