diff --git a/admin/displayappointments.php b/admin/displayappointments.php index 54d36ca1..12f66d89 100644 --- a/admin/displayappointments.php +++ b/admin/displayappointments.php @@ -127,11 +127,17 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(($_GET['new' xhtml_head($title,true,$css,$js_head,false,false,false,$subtitle); $lang = DEFAULT_LOCALE; + $sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate, CONVERT_TZ(s.end,'UTC',r.Time_zone_name) as enddate FROM `shift` as s, `case` as c, `respondent` as r WHERE s.questionnaire_id = c.questionnaire_id AND c.case_id = $case_id AND r.case_id = c.case_id ORDER BY s.end DESC LIMIT 1"; + $rs = $db->GetRow($sql); $startdate = $rs['startdate'];$enddate = $rs['enddate']; + print ""; if ($_GET['new'] =='new'){ - $start = date("Y-m-d H:m:s"); - $end = date("Y-m-d H:m:s", mktime(0,0,0,date("m"),date("d")+7,date("Y"))); + $start = $startdate; + $end = $enddate; $rtz = $_GET['rtz']; } if (isset($_GET['appointment_id'])) { @@ -189,7 +195,7 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(($_GET['new' print "