/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveFinder.php(1307)
1295 1296 private function queryOneMany() 1297 { 1298 $relation=$this->relation; 1299 $model=CActiveRecord::model($relation->className); 1300 $builder=$model->getCommandBuilder(); 1301 $schema=$builder->getSchema(); 1302 $table=$model->getTableSchema(); 1303 $parent=$this->_parent; 1304 $pkTable=$parent->model->getTableSchema(); 1305 1306 $fks=preg_split('/\s*,\s*/',$relation->foreignKey,-1,PREG_SPLIT_NO_EMPTY); 1307 if(count($fks)!==count($pkTable->primaryKey)) 1308 throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key. The columns in the key must match the primary keys of the table "{table}".', 1309 array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{table}'=>$pkTable->name))); 1310 1311 // set up mapping between fk and pk columns 1312 $map=array(); // pk=>fk 1313 foreach($fks as $i=>$fk) 1314 { 1315 if(!isset($table->columns[$fk])) 1316 throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key "{key}". There is no such column in the table "{table}".', 1317 array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{key}'=>$fk, '{table}'=>$table->name))); 1318 1319 if(isset($table->foreignKeys[$fk]))
#0 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveFinder.php(1293): CStatElement->queryOneMany() 1288 public function query() 1289 { 1290 if(preg_match('/^\s*(.*?)\((.*)\)\s*$/',$this->relation->foreignKey,$matches)) 1291 $this->queryManyMany($matches[1],$matches[2]); 1292 else 1293 $this->queryOneMany(); 1294 } 1295 1296 private function queryOneMany() 1297 { 1298 $relation=$this->relation; |
#1 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveFinder.php(430): CStatElement->query() 425 $pk[$name]=$baseRecord->$name; 426 $this->records[serialize($pk)]=$baseRecord; 427 } 428 429 foreach($this->stats as $stat) 430 $stat->query(); 431 432 if(empty($this->children)) 433 return; 434 435 $child=reset($this->children); |
#2 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveFinder.php(166): CJoinElement->lazyFind(Activity) 161 * This method is internally invoked by {@link CActiveRecord} to support lazy loading. 162 * @param CActiveRecord $baseRecord the base record whose related objects are to be loaded 163 */ 164 public function lazyFind($baseRecord) 165 { 166 $this->_joinTree->lazyFind($baseRecord); 167 if(!empty($this->_joinTree->children)) 168 { 169 $child=reset($this->_joinTree->children); 170 $child->afterFind(); 171 } |
#3 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveRecord.php(240): CActiveFinder->lazyFind(Activity) 235 else 236 $r=$name; 237 unset($this->_related[$name]); 238 239 $finder=new CActiveFinder($this,$r); 240 $finder->lazyFind($this); 241 242 if(!isset($this->_related[$name])) 243 { 244 if($relation instanceof CHasManyRelation) 245 $this->_related[$name]=array(); |
#4 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveRecord.php(108): CActiveRecord->getRelated("registered") 103 else if(isset($this->getMetaData()->columns[$name])) 104 return null; 105 else if(isset($this->_related[$name])) 106 return $this->_related[$name]; 107 else if(isset($this->getMetaData()->relations[$name])) 108 return $this->getRelated($name); 109 else 110 return parent::__get($name); 111 } 112 113 /** |
#5 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/protected/models/Activity.php(84): CActiveRecord->__get("registered") 79 'users' => array(self::MANY_MANY, 'User', 'activity_user(activity_id, user_id)'), 80 'reportlogs' => array(self::HAS_MANY, 'ReportLog', 'activity_id'), 81 ); 82 } 83 public function getRemaining() { 84 return max(0, $this->slots - $this->registered); 85 } 86 public function hasUser($user) { 87 return ActivityUser::model()->find('activity_id=:activity_id AND user_id=:user_id', array( 88 ':activity_id' => $this->id, 89 ':user_id' => $user->id, |
#6 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/base/CComponent.php(112): Activity->getRemaining() 107 */ 108 public function __get($name) 109 { 110 $getter='get'.$name; 111 if(method_exists($this,$getter)) 112 return $this->$getter(); 113 else if(strncasecmp($name,'on',2)===0 && method_exists($this,$name)) 114 { 115 // duplicating getEventHandlers() here for performance 116 $name=strtolower($name); 117 if(!isset($this->_e[$name])) |
#7 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveRecord.php(110): CComponent->__get("remaining") 105 else if(isset($this->_related[$name])) 106 return $this->_related[$name]; 107 else if(isset($this->getMetaData()->relations[$name])) 108 return $this->getRelated($name); 109 else 110 return parent::__get($name); 111 } 112 113 /** 114 * PHP setter magic method. 115 * This method is overridden so that AR attributes can be accessed like properties. |
#8 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/helpers/CHtml.php(1671): CActiveRecord->__get("remaining") 1666 public static function value($model,$attribute,$defaultValue=null) 1667 { 1668 foreach(explode('.',$attribute) as $name) 1669 { 1670 if(is_object($model)) 1671 $model=$model->$name; 1672 else if(is_array($model) && isset($model[$name])) 1673 $model=$model[$name]; 1674 else 1675 return $defaultValue; 1676 } |
#9 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/grid/CDataColumn.php(134): CHtml::value(Activity, "remaining") 129 protected function renderDataCellContent($row,$data) 130 { 131 if($this->value!==null) 132 $value=$this->evaluateExpression($this->value,array('data'=>$data,'row'=>$row)); 133 else if($this->name!==null) 134 $value=CHtml::value($data,$this->name); 135 echo $value===null ? $this->grid->nullDisplay : $this->grid->getFormatter()->format($value,$this->type); 136 } 137 } |
#10 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/grid/CGridColumn.php(135): CDataColumn->renderDataCellContent(0, Activity) 130 $options['class'].=' '.$class; 131 else 132 $options['class']=$class; 133 } 134 echo CHtml::openTag('td',$options); 135 $this->renderDataCellContent($row,$data); 136 echo '</td>'; 137 } 138 139 /** 140 * Renders the footer cell. |
#11 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/grid/CGridView.php(460): CGridColumn->renderDataCell(0) 455 else if(is_array($this->rowCssClass) && ($n=count($this->rowCssClass))>0) 456 echo '<tr class="'.$this->rowCssClass[$row%$n].'">'; 457 else 458 echo '<tr>'; 459 foreach($this->columns as $column) 460 $column->renderDataCell($row); 461 echo "</tr>\n"; 462 } 463 464 /** 465 * @return boolean whether the table should render a footer. |
#12 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/grid/CGridView.php(433): CGridView->renderTableRow(0) 428 echo "<tbody>\n"; 429 430 if($n>0) 431 { 432 for($row=0;$row<$n;++$row) 433 $this->renderTableRow($row); 434 } 435 else 436 { 437 echo '<tr><td colspan="'.count($this->columns).'">'; 438 $this->renderEmptyText(); |
#13 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/grid/CGridView.php(346): CGridView->renderTableBody() 341 if($this->dataProvider->getItemCount()>0 || $this->showTableOnEmpty) 342 { 343 echo "<table class=\"{$this->itemsCssClass}\">\n"; 344 $this->renderTableHeader(); 345 $this->renderTableFooter(); 346 $this->renderTableBody(); 347 echo "</table>"; 348 } 349 else 350 $this->renderEmptyText(); 351 } |
#14 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/CBaseListView.php(158): CGridView->renderItems() 153 protected function renderSection($matches) 154 { 155 $method='render'.$matches[1]; 156 if(method_exists($this,$method)) 157 { 158 $this->$method(); 159 $html=ob_get_contents(); 160 ob_clean(); 161 return $html; 162 } 163 else |
#15 |
unknown(0): CBaseListView->renderSection(array("{items}", "items"))
|
#16 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/CBaseListView.php(141): preg_replace_callback("/{(\w+)}/", array(ActivityGridView, "renderSection"), "{summary}
{items}
{pager}") 136 * The rendering results will replace the corresponding placeholders in {@link template}. 137 */ 138 public function renderContent() 139 { 140 ob_start(); 141 echo preg_replace_callback("/{(\w+)}/",array($this,'renderSection'),$this->template); 142 ob_end_flush(); 143 } 144 145 /** 146 * Renders a section. |
#17 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/zii/widgets/CBaseListView.php(127): CBaseListView->renderContent() 122 $this->registerClientScript(); 123 124 echo CHtml::openTag($this->tagName,$this->htmlOptions)."\n"; 125 126 $this->renderKeys(); 127 $this->renderContent(); 128 129 echo CHtml::closeTag($this->tagName); 130 } 131 132 /** |
#18 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/protected/widgets/ActivityGridView.php(98): CBaseListView->run() 093 ), 094 ); 095 DtQTip::tooltip('#' . $this->id . ' .can-register', array('style' => array('name' => 'green')) + $baseconfig); 096 DtQTip::tooltip('#' . $this->id . ' .cannot-register', array('style' => array('name' => 'red')) + $baseconfig); 097 DtQTip::tooltip('#' . $this->id . ' .is-owner', array('style' => array('name' => 'cream')) + $baseconfig); 098 return parent::run(); 099 } 100 101 } 102 103 |
#19 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CBaseController.php(166): ActivityGridView->run() 161 return ob_get_clean(); 162 } 163 else 164 { 165 $widget=$this->createWidget($className,$properties); 166 $widget->run(); 167 return $widget; 168 } 169 } 170 171 /** |
#20 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/protected/views/activity/index.php(9): CBaseController->widget("ActivityGridView") 04 ?> 05 06 <h1><?php echo Yii::t('activity', 'All Activities'); ?></h1> 07 08 <?php 09 $this->widget('ActivityGridView'); 10 ?> 11 12 <?php if ($this->user && $this->user->admin): ?> 13 <?php echo CHtml::link(DtHtml::button(Yii::t('activity', 'New Activity'), array('color' => 'default')), array('create')); ?> 14 <?php endif; ?> |
#21 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CBaseController.php(119): require("/home/activity/domains/activities.rwb.ac.th/public_html/protecte...") 114 $data=$_data_; 115 if($_return_) 116 { 117 ob_start(); 118 ob_implicit_flush(false); 119 require($_viewFile_); 120 return ob_get_clean(); 121 } 122 else 123 require($_viewFile_); 124 } |
#22 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CBaseController.php(88): CBaseController->renderInternal("/home/activity/domains/activities.rwb.ac.th/public_html/protecte...", null, true) 83 { 84 $widgetCount=count($this->_widgetStack); 85 if(($renderer=Yii::app()->getViewRenderer())!==null && $renderer->fileExtension==='.'.CFileHelper::getExtension($viewFile)) 86 $content=$renderer->renderFile($this,$viewFile,$data,$return); 87 else 88 $content=$this->renderInternal($viewFile,$data,$return); 89 if(count($this->_widgetStack)===$widgetCount) 90 return $content; 91 else 92 { 93 $widget=end($this->_widgetStack); |
#23 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CController.php(833): CBaseController->renderFile("/home/activity/domains/activities.rwb.ac.th/public_html/protecte...", null, true) 828 */ 829 public function renderPartial($view,$data=null,$return=false,$processOutput=false) 830 { 831 if(($viewFile=$this->getViewFile($view))!==false) 832 { 833 $output=$this->renderFile($viewFile,$data,true); 834 if($processOutput) 835 $output=$this->processOutput($output); 836 if($return) 837 return $output; 838 else |
#24 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CController.php(746): CController->renderPartial("index", null, true) 741 */ 742 public function render($view,$data=null,$return=false) 743 { 744 if($this->beforeRender($view)) 745 { 746 $output=$this->renderPartial($view,$data,true); 747 if(($layoutFile=$this->getLayoutFile($this->layout))!==false) 748 $output=$this->renderFile($layoutFile,array('content'=>$output),true); 749 750 $this->afterRender($view,$output); 751 |
#25 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/protected/controllers/ActivityController.php(13): CController->render("index") 08 'ownerOnly + edit' 09 ); 10 } 11 12 public function actionIndex() { 13 $this->render('index'); 14 } 15 16 public function actionCreate() { 17 $model = new Activity; 18 $action = 'create'; |
#26 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/actions/CInlineAction.php(57): ActivityController->actionIndex() 52 throw new CHttpException(400,Yii::t('yii','Your request is invalid.')); 53 } 54 $method->invokeArgs($controller,$params); 55 } 56 else 57 $controller->$methodName(); 58 } 59 } |
#27 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CController.php(300): CInlineAction->run() 295 { 296 $priorAction=$this->_action; 297 $this->_action=$action; 298 if($this->beforeAction($action)) 299 { 300 $action->run(); 301 $this->afterAction($action); 302 } 303 $this->_action=$priorAction; 304 } 305 |
#28 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/filters/CFilterChain.php(133): CController->runAction(CInlineAction) 128 $filter=$this->itemAt($this->filterIndex++); 129 Yii::trace('Running filter '.($filter instanceof CInlineFilter ? get_class($this->controller).'.filter'.$filter->name.'()':get_class($filter).'.filter()'),'system.web.filters.CFilterChain'); 130 $filter->filter($this); 131 } 132 else 133 $this->controller->runAction($this->action); 134 } 135 } |
#29 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CController.php(283): CFilterChain->run() 278 $this->runAction($action); 279 else 280 { 281 $priorAction=$this->_action; 282 $this->_action=$action; 283 CFilterChain::create($this,$action,$filters)->run(); 284 $this->_action=$priorAction; 285 } 286 } 287 288 /** |
#30 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CController.php(257): CController->runActionWithFilters(CInlineAction, array("adminOnly + update, create, teachers", "ownerOnly + edit")) 252 { 253 if(($parent=$this->getModule())===null) 254 $parent=Yii::app(); 255 if($parent->beforeControllerAction($this,$action)) 256 { 257 $this->runActionWithFilters($action,$this->filters()); 258 $parent->afterControllerAction($this,$action); 259 } 260 } 261 else 262 $this->missingAction($actionID); |
#31 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CWebApplication.php(328): CController->run("index") 323 { 324 list($controller,$actionID)=$ca; 325 $oldController=$this->_controller; 326 $this->_controller=$controller; 327 $controller->init(); 328 $controller->run($actionID); 329 $this->_controller=$oldController; 330 } 331 else 332 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', 333 array('{route}'=>$route===''?$this->defaultController:$route))); |
#32 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/web/CWebApplication.php(121): CWebApplication->runController("activity/index") 116 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 117 $_GET[$name]=$value; 118 } 119 else 120 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 121 $this->runController($route); 122 } 123 124 /** 125 * Registers the core application components. 126 * This method overrides the parent implementation by registering additional core components. |
#33 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/framework/base/CApplication.php(155): CWebApplication->processRequest() 150 */ 151 public function run() 152 { 153 if($this->hasEventHandler('onBeginRequest')) 154 $this->onBeginRequest(new CEvent($this)); 155 $this->processRequest(); 156 if($this->hasEventHandler('onEndRequest')) 157 $this->onEndRequest(new CEvent($this)); 158 } 159 160 /** |
#34 |
+
–
/home/activity/domains/activities.rwb.ac.th/public_html/index.php(13): CApplication->run() 08 defined('YII_DEBUG') or define('YII_DEBUG',true); 09 // specify how many levels of call stack should be shown in each log message 10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); 11 12 require_once($yii); 13 Yii::createWebApplication($config)->run(); |