当前位置: 首页>>代码示例>>PHP>>正文


PHP Monitor::model方法代码示例

本文整理汇总了PHP中Monitor::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Monitor::model方法的具体用法?PHP Monitor::model怎么用?PHP Monitor::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Monitor的用法示例。


在下文中一共展示了Monitor::model方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetMonitorOptions

 public function testGetMonitorOptions()
 {
     $monitors = Monitor::model()->getMonitorOptions();
     $this->assertTrue(3 === count($monitors));
     $this->assertTrue(is_array($monitors));
     $this->assertTrue(in_array('monitor1', $monitors));
     $this->assertFalse(in_array('monitor4', $monitors));
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:8,代码来源:ScreenTest.php

示例2: actionSort

 public function actionSort()
 {
     $return = array('sukses' => false);
     if (isset($_POST['mon'])) {
         Monitor::model()->updateOrder($_POST['mon']);
         $return = array('sukses' => true);
     }
     $this->renderJSON($return);
 }
开发者ID:sufehmi,项目名称:ahadmon,代码行数:9,代码来源:DashboardController.php

示例3: actionMonitorDetail

 public function actionMonitorDetail($id, $serverId)
 {
     $namaTabel = "{$serverId}_{$id}";
     $model = new MonitorDetail($namaTabel);
     $model->scenario = 'search';
     $monitor = Monitor::model()->findByPk($id);
     $server = Server::model()->findByPk($serverId);
     $this->render('monitor_detail', ['model' => $model, 'server' => $server, 'monitor' => $monitor]);
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:9,代码来源:DashboardController.php

示例4: run

 public function run()
 {
     $servers = ServerMonitor::model()->ambilServers($this->monitorId);
     $monitor = Monitor::model()->findByPk($this->monitorId);
     $tipeOutput = $monitor->outputType->nama;
     $tipeView = $monitor->viewType->nama;
     switch ($tipeView) {
         case 'linechart':
             $view = 'boxMonitorLineChart';
             break;
         case 'onoffstatus':
             $view = 'boxMonitorOnOffStatus';
             break;
         case 'text':
             $view = 'boxMonitorText';
             break;
     }
     $this->render($view, array('title' => $this->title, 'monitorId' => $this->monitorId, 'servers' => $servers, 'tipeOutput' => $tipeOutput));
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:19,代码来源:MonitorWidget.php

示例5: loadModel

 /**
  * 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 Monitor the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Monitor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:jencina,项目名称:checklist,代码行数:15,代码来源:MonitorController.php

示例6: updateOrder

 public function updateOrder($listIds)
 {
     $order = 0;
     foreach ($listIds as $listId) {
         Monitor::model()->updateByPk($listId, array('order' => $order));
         $order++;
     }
 }
开发者ID:sufehmi,项目名称:ahadmon,代码行数:8,代码来源:Monitor.php

示例7: array

?>

    <?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())));
?>
    
    <?php 
echo $form->textFieldGroup($model, 'url', array('wrapperHtmlOptions' => array('class' => 'col-sm-5', 'dir' => 'ltr')));
?>
开发者ID:nurielmeni,项目名称:nymedia,代码行数:30,代码来源:_form.php

示例8: getMonitorOptions

 public function getMonitorOptions()
 {
     return CHtml::listData(Monitor::model()->findAll(array('order' => 'name')), 'id', 'name');
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:4,代码来源:Monitor.php

示例9: getNamaMonitor

 public function getNamaMonitor()
 {
     $monitor = Monitor::model()->findByPk($this->monitor_id);
     return $monitor->nama;
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:5,代码来源:Notifikasi.php

示例10: actionLoadServer

 public function actionLoadServer()
 {
     if (!empty($_POST['Notifikasi']['monitor_id']) || $_POST['Notifikasi']['monitor_id'] == '0') {
         $monitorId = $_POST['Notifikasi']['monitor_id'];
         if ($monitorId == 0) {
             /* Untuk uptime monitor, tampilkan semua server */
             $servers = CHtml::listData(Server::model()->findAll(array('select' => 'id, nama', 'order' => 'nama')), 'id', 'nama');
             foreach ($servers as $id => $nama) {
                 echo CHtml::tag('option', array('value' => $id), CHtml::encode($nama), true);
             }
         } else {
             $monitor = Monitor::model()->findByPk($monitorId);
             $servers = $monitor->listServerAktif();
             foreach ($servers as $server) {
                 echo CHtml::tag('option', array('value' => $server['id']), CHtml::encode($server['nama']), true);
             }
         }
     } else {
         echo CHtml::tag('option', array('value' => ''), CHtml::encode('Pilih monitor..'), true);
     }
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:21,代码来源:NotifikasiController.php

示例11: getInfo

 public function getInfo()
 {
     /* Items allocated*/
     $commodity['consumable'] = Consumable::model()->findAll();
     $commodity['monitor'] = Monitor::model()->findAll();
     $commodity['printers'] = Printers::model()->findAll();
     $commodity['devices'] = Devices::model()->findAll();
     $dup = $commodity;
     /* Items available on Loan*/
     $availableOnLoan = 0;
     $thresholdItems = 0;
     $content = '';
     foreach ($commodity as $key => $commo) {
         foreach ($commo as $item) {
             if ($item['available_on_loan'] == 1 || $item['available_on_loan'] == 'Yes') {
                 ++$availableOnLoan;
             }
             if ($key == 'consumable') {
                 $commodity = Commodity::model()->findByAttributes(array('name' => $key));
                 $allocates = Allocate::model()->findAllByAttributes(array('commodity_id' => $commodity['id'], 'cons_id' => $item['id']));
                 if (count($allocates) < $item['threshold']) {
                     ++$thresholdItems;
                 }
             }
         }
     }
     /** Allocated and unallocated **/
     $countAllocated = 0;
     $countUnAllocated = 0;
     $commodity = $dup;
     $unAllocated = Allocate::model()->findAllByAttributes(array('date_out' => NULL));
     $allocated = Allocate::model()->findAll('date_out IS NOT NULL');
     $countAllocated += count($allocated);
     $countUnAllocated += count($unAllocated);
     $content .= '<b style="color:red">' . $availableOnLoan . '</b> item available on loan<br/>';
     $content .= '<b style="color:red">' . $thresholdItems . '</b> item below threshold<br/>';
     $content .= '<b style="color:red">' . $countAllocated . '</b> item allocated<br/>';
     $content .= '<b style="color:red">' . $countUnAllocated . '</b> item unallocated<br/>';
     /* Items below threshold*/
     return $content;
 }
开发者ID:anjanababu,项目名称:Asset-Management,代码行数:41,代码来源:DashController.php

示例12: array

                    <div class="col-md-6">
                        <?php 
        echo $form->textFieldGroup($migracion, 'disco_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5')));
        ?>
                    </div>


                    <div class="col-md-6">
                        <?php 
        echo $form->dropDownListGroup($migracion, 'cpu_id_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Cpu::model()->findAll(), 'id', 'procesador', 'marca'), 'htmlOptions' => array('prompt' => 'Seleccione Cpu'))));
        ?>
                    </div>

                    <div class="col-md-6">
                        <?php 
        echo $form->dropDownListGroup($migracion, 'monitor_id_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Monitor::model()->findAll(), 'id', 'modelo', 'marca'), 'htmlOptions' => array('prompt' => 'Seleccione Monitor'))));
        ?>
                    </div>


                </div>
            </div>
        </div>
        <?php 
    }
    ?>
        <!-- FIN MIGRACION-->

    <?php 
}
?>
开发者ID:jencina,项目名称:checklist,代码行数:31,代码来源:update.php

示例13: installMonitor

 public function installMonitor()
 {
     $monitor = Monitor::model()->findByPk($this->monitor_id);
     $resultTableDef = $monitor->outputType->table_def;
     $transaction = $this->dbConnection->beginTransaction();
     try {
         if ($this->save()) {
             Yii::app()->db->createCommand()->createTable($this->getResultTableName(), array('id' => 'bigint(20) unsigned NOT NULL AUTO_INCREMENT', 'result' => $resultTableDef, 'waktu' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 'keterangan' => 'varchar(512) DEFAULT NULL', 'PRIMARY KEY (`id`)'), 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
             $transaction->commit();
             return true;
         } else {
             throw new Exception("Gagal Install Monitor");
         }
     } catch (Exception $e) {
         $transaction->rollback();
         throw $e;
     }
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:18,代码来源:ServerMonitor.php


注:本文中的Monitor::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。