public function filterProjectContext($filterChain) { if (!isset(Yii::app()->session["visit"])) { Viewcounts::model()->newVisit(); Yii::app()->session["visit"] = "visited"; } if (Yii::app()->user->isGuest) { $this->layout = '//layouts/column1'; } else { $this->layout = '//layouts/column2'; } $filterChain->run(); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Viewcounts the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Viewcounts::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
} ?> <!-- <a href="#" class="textmndichvu">Hỗ trợ trực tuyến</a><br> <a href="#" class="textmndichvu">Chính sách vận chuyển</a><br> <a href="#" class="textmndichvu">Đặt hàng</a><br> <a href="#" class="textmndichvu">Thanh toán</a><br> --> </div> </div> <div id="footerbox3"> <div class="footerheading"> <h4 class="footerheading">Thống kê truy cập</h4> </div> <div class="footertxt"> <?php $visited = Viewcounts::model()->visited(); echo '<a href="#" class="textmndichvu">Trực tuyến: ' . $visited['total'] . '</a><br />'; echo '<a href="#" class="textmndichvu">Lượt truy cập: ' . $visited['total'] . '</a><br />'; ?> </div> </div> </div> </div> </div> <div id="footer-bg"> <div id="footerblank"> <div id="footerlinks"> <p> <h3 style="margin-bottom: 10px;">Công ty TNHH thực phẩm Fresh Food Việt Nam</h3>