예제 #1
0
?>

    <?php 
echo $form->textFieldGroup($model, 'description', array('wrapperHtmlOptions' => array('class' => 'col-sm-5')));
?>

    <?php 
echo $form->dropDownListGroup($weather, 'code', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => Weather::model()->getWeatherOptions(), 'htmlOptions' => array())));
?>

    <?php 
echo $form->dropDownListGroup($theme, 'id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => $model->getThemeOptions(), 'htmlOptions' => array())));
?>

    <?php 
echo $form->dropDownListGroup($commercial, 'id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => Commercial::model()->getCommercialOptions(), 'htmlOptions' => array())));
?>

    <?php 
echo $form->dropDownListGroup($model, 'monitor_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => Monitor::model()->getMonitorOptions(), 'htmlOptions' => array())));
?>

    <?php 
echo $form->dropDownListGroup($model, 'dongle_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => Dongle::model()->getDongleOptions(), 'htmlOptions' => array())));
?>


    <?php 
echo $form->dropDownListGroup($model, 'yeshuv_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => Yeshuv::model()->getYeshuvOptions(), 'htmlOptions' => array())));
?>
    
예제 #2
0
 /**
  * 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 Commercial the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Commercial::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('default', 'The requested page does not exist.'));
     }
     return $model;
 }
예제 #3
0
파일: view.php 프로젝트: nurielmeni/nymedia
/* @var $this ScreenController */
/* @var $model Screen */
$this->breadcrumbs = array(Yii::t('screen', 'Screens') => array('index'), $model->name);
$this->menu = array(array('label' => Yii::t('screen', 'List Screen'), 'url' => array('index')), array('label' => Yii::t('screen', 'Create Screen'), 'url' => array('create'), 'visible' => Yii::app()->user->checkAccess('ScreenAdministrating')), array('label' => Yii::t('screen', 'Update Screen'), 'url' => array('update', 'id' => $model->id), 'visible' => Yii::app()->user->checkAccess('ScreenAdministrating')), array('label' => Yii::t('screen', 'Delete Screen'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => Yii::t('default', 'Are you sure you want to delete this item?')), 'visible' => Yii::app()->user->checkAccess('ScreenAdministrating')), array('label' => Yii::t('screen', 'Manage Screen'), 'url' => array('admin'), 'visible' => Yii::app()->user->checkAccess('ScreenAdministrating')), array('label' => Yii::t('ad', 'Create Ad'), 'url' => array('Ad/Create', 'screen_id' => $model->id)));
?>

<h1>
<?php 
echo Yii::t('screen', 'View Screen') . ' #' . $model->id;
$admin = Yii::app()->user->checkAccess('Administrator');
if ($admin) {
    $this->widget('booster.widgets.TbButton', array('label' => Yii::t('screen', 'Display Screen'), 'id' => 'openDisplay', 'context' => 'primary', 'htmlOptions' => array('onclick' => 'js:window.open("' . Yii::app()->createUrl('display/' . $model->id) . '")', 'style' => 'float:left; margin-right:2px;')));
}
$this->widget('booster.widgets.TbButton', array('context' => 'success', 'htmlOptions' => array('style' => 'float:left;'), 'tooltip' => true, 'tooltipOptions' => array('placement' => 'top', 'title' => Yii::t('screen', 'Update Messages in the display'), 'delay' => array('show' => 400, 'hide' => 500)), 'id' => 'screenRefresh', 'label' => Yii::t('screen', 'Refresh'), 'buttonType' => 'ajaxSubmit', 'url' => Yii::app()->createUrl('Ajax/screenRefresh'), 'ajaxOptions' => array('type' => 'POST', 'data' => array('screen_id' => $model->id), 'success' => 'function(data) { 
                                    $("#screenRefresh").prop("disabled", true);
                    }')));
?>
</h1>

<?php 
$this->widget('booster.widgets.TbDetailView', array('type' => 'striped', 'data' => $model, 'attributes' => array('name', 'description', array('label' => Weather::model()->getAttributeLabel('Weather Area'), 'value' => empty($model->weatherCodes) ? null : $model->weatherCodes[0]->name_heb, 'visible' => $admin), array('label' => Theme::model()->getAttributeLabel('theme'), 'value' => empty($model->themes) ? null : $model->themes[0]->theme, 'visible' => $admin), array('label' => Commercial::model()->getAttributeLabel('id'), 'value' => empty($model->commercials) ? null : $model->commercials[0]->name, 'visible' => $admin), array('name' => 'monitor.name', 'visible' => $admin), array('name' => 'dongle.name', 'visible' => $admin), array('name' => 'yeshuv.name_heb', 'visible' => $admin), array('name' => 'url', 'visible' => $admin), array('name' => 'webkey_nickname', 'type' => 'raw', 'value' => CHtml::link($model->getAttribute('webkey_nickname'), 'http://webkey.cc/' . $model->getAttribute('webkey_nickname'), array('target' => '_blank')), 'visible' => $admin))));
?>
<br>
<h1><?php 
echo Yii::t('screen', 'Screen Ads');
?>
</h1>
<div class="clear"></div>
<?php 
$this->widget('booster.widgets.TbListView', array('dataProvider' => $adDataProvider, 'itemView' => '/ad/_view', 'viewData' => array('screen_id' => $model->id)));
예제 #4
0
 /**
  * Returns the List of Commercial Areas and Id to
  * Populate the drop down list.
  * * @return Commercial List
  */
 public function getCommercialOptions()
 {
     return CHtml::listData(Commercial::model()->findAll(array('order' => 'name')), 'id', 'name');
 }