Exemplo n.º 1
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $year = intval($requests['year']);
     $month = intval($requests['month']);
     // ----------
     if (!$year) {
         $year = date('Y');
     }
     if (!$month) {
         $month = date('n');
     }
     if ($year == date('Y') && $month == date('n')) {
         $is_curr = true;
         $curr_day = date('d');
     }
     if ($year < date('Y') || $year > intval(date('Y')) + 1) {
         $this->set('add_schedule', false);
     } else {
         $this->set('add_schedule', true);
     }
     $this->set('inc_navi', fetch_inc_navi('h'));
     // イベント
     $event_list = db_schedule_event4c_member_id($year, $month, $u);
     // 誕生日
     $birth_list = db_schedule_birth4c_member_id($month, $u);
     include_once 'Calendar/Month/Weekdays.php';
     $Month = new Calendar_Month_Weekdays($year, $month, 0);
     $Month->build();
     $calendar = array();
     $i = 0;
     while ($Day = $Month->fetch()) {
         if ($Day->isFirst()) {
             $i++;
         }
         if ($Day->isEmpty()) {
             $calendar[$i][] = array();
         } else {
             $day = $Day->thisDay();
             $item = array('day' => $day, 'now' => false, 'birth' => $birth_list[$day], 'event' => $event_list[$day], 'schedule' => db_schedule_c_schedule_list4date($year, $month, $day, $u), 'holiday' => db_c_holiday_list4date($month, $day));
             $item['day'] = $day;
             if ($is_curr && $item['day'] == $curr_day) {
                 $item['now'] = true;
             }
             $calendar[$i][] = $item;
         }
     }
     $ym = array('year_disp' => $year, 'month_disp' => $month, 'year_prev' => date('Y', $Month->prevMonth(true)), 'month_prev' => date('n', $Month->prevMonth(true)), 'year_next' => date('Y', $Month->nextMonth(true)), 'month_next' => date('n', $Month->nextMonth(true)));
     $this->set("ym", $ym);
     $this->set("year", $year);
     $this->set("month", $month);
     $this->set("calendar", $calendar);
     $c_member = db_member_c_member4c_member_id($u);
     $this->set("pref_list", p_regist_prof_c_profile_pref_list4null());
     $this->set("c_member", $c_member);
     return 'success';
 }
Exemplo n.º 2
0
function p_h_calendar_birth4c_member_id($month, $c_member_id)
{
    return db_schedule_birth4c_member_id($month, $c_member_id);
}
Exemplo n.º 3
0
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $this->set('tail', $GLOBALS['KTAI_URL_TAIL']);
     $c_member_secure = db_member_c_member_secure4c_member_id($u);
     $prof_id = $requests['prof_id'];
     $w = $requests['w'];
     if (empty($requests['target_id']) || $requests['target_id'] == $u) {
         //自分自身
         $target_id = $u;
         $this->set('is_h', true);
         //判別フラグ
     } else {
         //他人
         $target_id = $requests['target_id'];
         $this->set('is_f', true);
         //判別フラグ
     }
     require_once 'Calendar/Week.php';
     $w = intval($requests['w']);
     if (empty($w)) {
         $w = 0;
     }
     $this->set('w', $w);
     $time = strtotime($w . " week");
     $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), 0);
     $Week->build();
     $calendar = array();
     $schedule = array();
     $dayofweek = array('日', '月', '火', '水', '木', '金', '土');
     $i = 0;
     $n = 0;
     while ($Day = $Week->fetch()) {
         $y = sprintf("%02d", $Day->thisYear());
         $m = sprintf("%02d", $Day->thisMonth());
         $d = sprintf("%02d", $Day->thisDay());
         $m_disp = sprintf("%2d", $Day->thisMonth());
         if ($i == 0) {
             $this->set("y_disp", $y);
             $this->set("m_disp", $m_disp);
         }
         //イベント
         $event_list = db_commu_event4c_member_id($y, $m, $d, $target_id);
         // 誕生日
         $birth_list = db_schedule_birth4c_member_id($m, $target_id);
         //スケジュール
         $schedule = biz_getDateMemberSchedule($y, $m, $d, $target_id, $u);
         $banner = biz_isBannerSchedule($y, $m, $d, $target_id);
         if (!empty($banner)) {
             foreach ($banner as $value) {
                 array_push($schedule, $value);
             }
         }
         $item = array('year' => $y, 'month' => $m, 'day' => $d, 'dayofweek' => $dayofweek[$i++], 'now' => false, 'event' => $event_list, 'birth' => $birth_list[intval($d)], 'schedule' => $schedule);
         if ($w == 0 && $d == date('d')) {
             $item['now'] = true;
         }
         $calendar[] = $item;
     }
     $this->set("calendar", $calendar);
     $c_member = db_member_c_member4c_member_id($target_id);
     $this->set("pref_list", p_regist_prof_c_profile_pref_list4null());
     $this->set("c_member", $c_member);
     $this->set("msg", $requests['msg']);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $year = $requests['year'];
     $month = $requests['month'];
     $pref_id = $requests['pref_id'];
     // ----------
     if (empty($requests['target_id']) || $requests['target_id'] == $u) {
         //自分自身
         $target_id = $u;
         $this->set('is_h', true);
         //判別フラグ
         $this->set('inc_navi', fetch_inc_navi('h'));
     } else {
         //他人
         $target_id = $requests['target_id'];
         $this->set('is_f', true);
         //判別フラグ
         $this->set('inc_navi', fetch_inc_navi('f', $target_id));
     }
     if (!$year) {
         $year = date('Y');
     }
     if (!$month) {
         $month = date('n');
     }
     if ($year == date('Y') && $month == date('n')) {
         $is_curr = true;
         $curr_day = date('d');
     }
     // イベント
     $event_list = db_schedule_event4c_member_id($year, $month, $target_id);
     // 誕生日
     $birth_list = db_schedule_birth4c_member_id($month, $target_id);
     // Todo
     $todo_list = biz_schedule_todo4c_member_id($u, $target_id, $year, $month);
     require_once 'Calendar/Month/Weekdays.php';
     $Month = new Calendar_Month_Weekdays($year, $month, 0);
     $Month->build();
     $calendar = array();
     $schedule = array();
     $i = 0;
     while ($Day = $Month->fetch()) {
         if ($Day->isFirst()) {
             $i++;
         }
         if ($Day->isEmpty()) {
             $calendar[$i][] = array();
         } else {
             $day = $Day->thisDay();
             $schedule = biz_getDateMemberSchedule($year, sprintf("%02d", $month), sprintf("%02d", $day), $target_id, $u);
             $banner = biz_isBannerSchedule($year, sprintf("%02d", $month), sprintf("%02d", $day), $target_id);
             if (!empty($banner)) {
                 foreach ($banner as $value) {
                     array_push($schedule, $value);
                 }
             }
             $item = array('day' => $day, 'now' => false, 'birth' => $birth_list[$day], 'event' => $event_list[$day], 'schedule' => $schedule, 'todo' => $todo_list[$day], 'holiday' => db_c_holiday_list4date($month, $day));
             $item['day'] = $day;
             if ($is_curr && $item['day'] == $curr_day) {
                 $item['now'] = true;
             }
             $calendar[$i][] = $item;
         }
     }
     $ym = array('year_disp' => $year, 'month_disp' => $month, 'year_prev' => date('Y', $Month->prevMonth(true)), 'month_prev' => date('n', $Month->prevMonth(true)), 'year_next' => date('Y', $Month->nextMonth(true)), 'month_next' => date('n', $Month->nextMonth(true)));
     $this->set("ym", $ym);
     $this->set("year", $year);
     $this->set("month", $month);
     $this->set("calendar", $calendar);
     $c_member = db_member_c_member4c_member_id($target_id);
     $this->set("pref_list", p_regist_prof_c_profile_pref_list4null());
     $this->set("c_member", $c_member);
     return 'success';
 }