|
@@ 3430-3445 (lines=16) @@
|
| 3427 |
|
$sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date) = ".$month." AND YEAR(start_date) = ".$year." AND access_url_id = $current_access_url_id ORDER BY start_date ASC"; |
| 3428 |
|
} |
| 3429 |
|
// 2. creating the SQL statement for getting the personal agenda items in WEEK view |
| 3430 |
|
if ($type == "week_view") { // we are in week view |
| 3431 |
|
$start_end_day_of_week = self::calculate_start_end_of_week( |
| 3432 |
|
$week, |
| 3433 |
|
$year |
| 3434 |
|
); |
| 3435 |
|
$start_day = $start_end_day_of_week['start']['day']; |
| 3436 |
|
$start_month = $start_end_day_of_week['start']['month']; |
| 3437 |
|
$start_year = $start_end_day_of_week['start']['year']; |
| 3438 |
|
$end_day = $start_end_day_of_week['end']['day']; |
| 3439 |
|
$end_month = $start_end_day_of_week['end']['month']; |
| 3440 |
|
$end_year = $start_end_day_of_week['end']['year']; |
| 3441 |
|
// in sql statements you have to use year-month-day for date calculations |
| 3442 |
|
$start_filter = $start_year."-".$start_month."-".$start_day." 00:00:00"; |
| 3443 |
|
$start_filter = api_get_utc_datetime($start_filter); |
| 3444 |
|
|
| 3445 |
|
$end_filter = $end_year."-".$end_month."-".$end_day." 23:59:59"; |
| 3446 |
|
$end_filter = api_get_utc_datetime($end_filter); |
| 3447 |
|
$sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND access_url_id = $current_access_url_id "; |
| 3448 |
|
} |
|
@@ 3565-3579 (lines=15) @@
|
| 3562 |
|
|
| 3563 |
|
// 2. creating the SQL statement for getting the personal agenda items in WEEK view |
| 3564 |
|
// we are in week view |
| 3565 |
|
if ($type == "week_view") { |
| 3566 |
|
$start_end_day_of_week = self::calculate_start_end_of_week( |
| 3567 |
|
$week, |
| 3568 |
|
$year |
| 3569 |
|
); |
| 3570 |
|
$start_day = $start_end_day_of_week['start']['day']; |
| 3571 |
|
$start_month = $start_end_day_of_week['start']['month']; |
| 3572 |
|
$start_year = $start_end_day_of_week['start']['year']; |
| 3573 |
|
$end_day = $start_end_day_of_week['end']['day']; |
| 3574 |
|
$end_month = $start_end_day_of_week['end']['month']; |
| 3575 |
|
$end_year = $start_end_day_of_week['end']['year']; |
| 3576 |
|
// in sql statements you have to use year-month-day for date calculations |
| 3577 |
|
$start_filter = $start_year."-".$start_month."-".$start_day." 00:00:00"; |
| 3578 |
|
$start_filter = api_get_utc_datetime($start_filter); |
| 3579 |
|
$end_filter = $end_year."-".$end_month."-".$end_day." 23:59:59"; |
| 3580 |
|
$end_filter = api_get_utc_datetime($end_filter); |
| 3581 |
|
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' AND date>='".$start_filter."' AND date<='".$end_filter."'"; |
| 3582 |
|
} |