1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class biz_page_s_list extends OpenPNE_Action |
---|
8 | { |
---|
9 | function execute($requests) |
---|
10 | { |
---|
11 | $u = $GLOBALS['AUTH']->uid(); |
---|
12 | |
---|
13 | // --- リクエスト変数 |
---|
14 | // ---------- |
---|
15 | |
---|
16 | $this->set("list", biz_getShisetsuList()); |
---|
17 | //カレンダー表示用 |
---|
18 | require_once 'Calendar/Week.php'; |
---|
19 | $w = intval($_REQUEST['w']); |
---|
20 | if (empty($w)) { |
---|
21 | $w = 0; |
---|
22 | } |
---|
23 | $this->set('w', $w); |
---|
24 | $time = strtotime($w . " week"); |
---|
25 | $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), 0); |
---|
26 | $Week->build(); |
---|
27 | $calendar = array(); |
---|
28 | $dayofweek = array('日','月','火','水','木','金','土'); |
---|
29 | $i = 0; |
---|
30 | |
---|
31 | $schedule = array(); |
---|
32 | |
---|
33 | while ($Day = $Week->fetch()) { |
---|
34 | |
---|
35 | $y = sprintf("%02d",$Day->thisYear()); |
---|
36 | $m = sprintf("%02d",$Day->thisMonth()); |
---|
37 | $d = sprintf("%02d",$Day->thisDay()); |
---|
38 | |
---|
39 | $schedule = biz_getShisetsuSchedule($y,$m,$d); |
---|
40 | |
---|
41 | $item = array( |
---|
42 | 'year'=> $y, |
---|
43 | 'month'=>$m, |
---|
44 | 'day' => $d, |
---|
45 | 'dayofweek'=>$dayofweek[$i++], |
---|
46 | 'now' => false, |
---|
47 | 'birth' => p_h_home_birth4c_member_id($m, $d, $u), |
---|
48 | 'event' => p_h_home_event4c_member_id($y, $m, $d, $u), |
---|
49 | 'schedule' => $schedule, |
---|
50 | ); |
---|
51 | if ($w == 0 && $d == date('d')) { |
---|
52 | $item['now'] = true; |
---|
53 | } |
---|
54 | |
---|
55 | $calendar[] = $item; |
---|
56 | } |
---|
57 | |
---|
58 | $list= biz_getShisetsuList(); |
---|
59 | |
---|
60 | $calendar = ''; |
---|
61 | foreach ($list as $key => $value) { |
---|
62 | $calendar .= biz_getScheduleWeek($value['biz_shisetsu_id'], $u, $requests['w'], 's_list', true, true, true); |
---|
63 | } |
---|
64 | |
---|
65 | $this->set('calendar', $calendar); |
---|
66 | |
---|
67 | $hours = biz_makeSerialArray(23); //時 |
---|
68 | $this->set("hours", $hours); |
---|
69 | |
---|
70 | $config = biz_getConfig(); |
---|
71 | |
---|
72 | $this->set('is_closed_shisetsu', $config['IS_CLOSED_SHISETSU']); |
---|
73 | |
---|
74 | return 'success'; |
---|
75 | } |
---|
76 | } |
---|
77 | |
---|
78 | ?> |
---|