- Timestamp:
- 08/30/08 12:04:44 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
websites/events.php.gr.jp/branches/cake/app/controllers/events_controller.php
r18059 r18466 39 39 function show($id) 40 40 { 41 $id = (int)$id; 42 $this->set('event_id', $id); 43 41 44 $has_many = array( 42 45 'EventComment' => array( … … 60 63 ); 61 64 65 $has_one2 = array( 66 'User' => array( 67 'className' => 'User', 68 'foreignKey' => 'user_id', 69 ) 70 ); 71 62 72 $this->Event->bindModel(array('hasMany' => $has_many, 'hasOne' => $has_one)); 63 73 64 $re = $this->Event->findById($id); 74 $this->Event->EventComment->bindModel(array('belongsTo' => $has_one2)); 75 $this->Event->EventAttendee->bindModel(array('belongsTo' => $has_one2)); 76 77 $re = $this->Event->findById($id, null,null,2); 65 78 66 79 // WikiPageのレンダリング … … 72 85 foreach ($re['EventAttendee'] as $row) { 73 86 // 自分が参加していたらフラグをたてる 74 /* 75 if (isset($_SESSION['name']) && $row['account_name'] == $_SESSION['name']) { 76 $this->af->setApp('joined', true); 87 if ($this->Session->read('username') == $row['User']['username']) { 88 $this->set('joined', true); 77 89 if ($row['canceled'] == 1) { 78 $this->af->setApp('canceled', true); 90 $this->set('canceled', true); 91 } else { 92 $this->set('canceled', false); 79 93 } 94 } else { 95 $this->set('joined', false); 80 96 } 81 */82 97 83 98 if ($row['canceled'] != 1) { … … 88 103 $this->set('attendee_count', $attendee_count); 89 104 $this->set('attendee_nokori', $re['Event']['max_register'] - $attendee_count); 105 $this->set('is_over', $this->Event->isOver($id)); 90 106 $this->set('data', $re); 91 107 } 108 109 /** 110 * control 111 * 112 */ 113 function control() 114 { 115 // adminじゃなければさようなら 116 if ($this->Session->read('role') != 'admin') { 117 $this->redirect('/'); 118 } 119 120 $events = $this->Event->find('all', array('order' => 'Event.id DESC')); 121 $this->set('events', $events); 122 } 123 124 /** 125 * post 126 * 127 */ 128 function post() 129 { 130 if ($this->data) { 131 } 132 } 133 92 134 } 93 135 94 95 136 ?>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)