|
@@ 3415-3430 (lines=16) @@
|
| 3412 |
|
$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"; |
| 3413 |
|
} |
| 3414 |
|
// 2. creating the SQL statement for getting the personal agenda items in WEEK view |
| 3415 |
|
if ($type == "week_view") { // we are in week view |
| 3416 |
|
$start_end_day_of_week = self::calculate_start_end_of_week( |
| 3417 |
|
$week, |
| 3418 |
|
$year |
| 3419 |
|
); |
| 3420 |
|
$start_day = $start_end_day_of_week['start']['day']; |
| 3421 |
|
$start_month = $start_end_day_of_week['start']['month']; |
| 3422 |
|
$start_year = $start_end_day_of_week['start']['year']; |
| 3423 |
|
$end_day = $start_end_day_of_week['end']['day']; |
| 3424 |
|
$end_month = $start_end_day_of_week['end']['month']; |
| 3425 |
|
$end_year = $start_end_day_of_week['end']['year']; |
| 3426 |
|
// in sql statements you have to use year-month-day for date calculations |
| 3427 |
|
$start_filter = $start_year."-".$start_month."-".$start_day." 00:00:00"; |
| 3428 |
|
$start_filter = api_get_utc_datetime($start_filter); |
| 3429 |
|
|
| 3430 |
|
$end_filter = $end_year."-".$end_month."-".$end_day." 23:59:59"; |
| 3431 |
|
$end_filter = api_get_utc_datetime($end_filter); |
| 3432 |
|
$sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND access_url_id = $current_access_url_id "; |
| 3433 |
|
} |
|
@@ 3550-3564 (lines=15) @@
|
| 3547 |
|
|
| 3548 |
|
// 2. creating the SQL statement for getting the personal agenda items in WEEK view |
| 3549 |
|
// we are in week view |
| 3550 |
|
if ($type == "week_view") { |
| 3551 |
|
$start_end_day_of_week = self::calculate_start_end_of_week( |
| 3552 |
|
$week, |
| 3553 |
|
$year |
| 3554 |
|
); |
| 3555 |
|
$start_day = $start_end_day_of_week['start']['day']; |
| 3556 |
|
$start_month = $start_end_day_of_week['start']['month']; |
| 3557 |
|
$start_year = $start_end_day_of_week['start']['year']; |
| 3558 |
|
$end_day = $start_end_day_of_week['end']['day']; |
| 3559 |
|
$end_month = $start_end_day_of_week['end']['month']; |
| 3560 |
|
$end_year = $start_end_day_of_week['end']['year']; |
| 3561 |
|
// in sql statements you have to use year-month-day for date calculations |
| 3562 |
|
$start_filter = $start_year."-".$start_month."-".$start_day." 00:00:00"; |
| 3563 |
|
$start_filter = api_get_utc_datetime($start_filter); |
| 3564 |
|
$end_filter = $end_year."-".$end_month."-".$end_day." 23:59:59"; |
| 3565 |
|
$end_filter = api_get_utc_datetime($end_filter); |
| 3566 |
|
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' AND date>='".$start_filter."' AND date<='".$end_filter."'"; |
| 3567 |
|
} |