protected function renderContent() { //echo 'Notice Content'; /* $result=ImportantNotice::model()->findAll(array('limit'=>1,'order'=>'notice_id desc')); foreach($result as $data) */ $notice; $id = Yii::app()->user->getState('org_id'); if (!empty($id)) { $maxOrderNumber = Yii::app()->db->createCommand()->select('max(notice_id) as max')->from('important_notice')->where('notice_organization_id=' . $id)->queryScalar(); if ($maxOrderNumber) { $notice_id = $maxOrderNumber; $notice = ImportantNotice::model()->findByPk($notice_id); $notice = $notice->notice; $notice = substr($notice, 0, 50) . "..."; $this->widget('ext.bbcnewsticker.EBBCNewsTicker', array('items' => array(CHtml::link($notice, array('/importantNotice/print_notice', 'id' => $notice_id), array('id' => 'hello'))), 'wrapperHtmlOptions' => array('id' => "hello"))); //$this->widget('ext.eticker.ETicker',array('data'=>array($notice, CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1'))))); //echo CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1')); $config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () { return window . location . reload(); }); $this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#hello', 'config' => $config)); //echo CHtml::link('View',array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'hello')); } } else { echo '<div id="stud_doc_id1">'; echo '</div>'; } }
protected function renderContent() { $notice; $id = Yii::app()->user->getState('org_id'); if (!empty($id)) { $criteria = new CDbCriteria(); $criteria->condition = "notice_organization_id = " . Yii::app()->user->getState('org_id'); $criteria->limit = 5; $criteria->order = 'notice_id desc'; $notice = ImportantNotice::model()->findAll($criteria); foreach ($notice as $list) { $imp_notice = substr($list['notice'], 0, 150) . "..."; echo CHtml::link($imp_notice, array('/importantNotice/print_notice', 'id' => $list['notice_id']), array('id' => 'hello')) . '<br /><br />'; } $config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () { return window . location . reload(); }); $this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#hello', 'config' => $config)); } else { echo '<div id="stud_doc_id1">'; echo '</div>'; } }
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = ImportantNotice::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
</div> </div> </div> </div> </div> </div> <!--===============================Attendance end============================--> <!--===============================Notice board Boxes start============================--> <div class="span3"> <div class="dashbox blue"> <div class="box-header blue"> <span class="title"><i class="fa fa-clipboard"></i> Notice board</span> </div> <div class="box-content"> <?php $notice = ImportantNotice::model()->findAll(array("order" => "notice_id DESC","limit" => 4)); ?> <?php if(!empty($notice)) { $i = 1; foreach($notice as $list) { ?> <div class="box-section"> <div class="avatar blue" style="background-color:#01CB99"><?php echo $i; ?></div> <div class="news-content"> <div class="news-text-one"> <?php echo CHtml::link(substr($list['notice'], 0, 70).'...', Yii::app()->createUrl('importantNotice/view', array('id'=>$list['notice_id'])), array('target'=>'_blank')); ?> </div> </div> </div> <?php $i++; }