本文整理汇总了PHP中Point::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Point::model方法的具体用法?PHP Point::model怎么用?PHP Point::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::model方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// Create new field in your users table for store dashboard preference
// Set table name, user ID field name, user preference field name
$this->setTableParams('dashboard_page', 'user_id', 'title');
// set array of portlets
$this->setPortlets(array(array('id' => 1, 'title' => 'Ultimos clientes', 'content' => Customer::model()->Top(4)), array('id' => 2, 'title' => 'Ultimas reservas', 'content' => Book::model()->Top(4)), array('id' => 3, 'title' => 'Puntos críticos', 'content' => Point::model()->Top(4)), array('id' => 4, 'title' => 'Ultimos boletines', 'content' => Mail::model()->Top(4)), array('id' => 5, 'title' => 'Informes', 'content' => Functions::lastReports()), array('id' => 6, 'title' => 'Ultimas facturas', 'content' => Invoice::model()->Top(4))));
//set content BEFORE dashboard
$this->setContentBefore();
// uncomment the following to apply jQuery UI theme
// from protected/components/assets/themes folder
$this->applyTheme('ui-lightness');
// uncomment the following to change columns count
//$this->setColumns(4);
// uncomment the following to enable autosave
$this->setAutosave(true);
// uncomment the following to disable dashboard header
$this->setShowHeaders(false);
// uncomment the following to enable context menu and add needed items
/*
$this->menu = array(
array('label' => 'Index', 'url' => array('index')),
);
*/
}
示例2: actionUpdate
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id)
{
$model = $this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Net'])) {
$model->attributes = $_POST['Net'];
if ($model->save()) {
$pointsAttached = $_POST['Net']['pointsattached'];
$pointToNet = new PointToNet();
$pointToNet::model()->deleteAll('net_id = ' . $model->id);
foreach ($pointsAttached as $attached) {
$pointToNet->attributes = array('net_id' => $model->id, 'point_id' => $attached);
$pointToNet->save();
$PointModel = Point::model()->findByPk($attached);
$PointModel->CreateChannelsForWindows($model->screen_id, $attached);
unset($PointModel);
$pointToNet = new PointToNet();
}
$model->CreateChannelsForWindows($model->screen_id, $model->id);
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('update', array('model' => $model));
}
示例3: 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 Point the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Point::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例4: array
<?php
/* @var $this PointController */
/* @var $model Point */
/* @var $form CActiveForm */
if (Yii::app()->controller->action->id == "create") {
$id_point = $_GET['id'];
} else {
$id_point = $model->id_point;
}
$point = Point::model()->findByPk($id_point)->with('net');
$net = $point->net;
$playlists = $net->playlists;
$pls = array();
?>
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'point-form', 'enableAjaxValidation' => false));
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php
echo $form->errorSummary($model);
?>
<?
echo $form->hiddenField($model,'id_point', array('value'=>$id_point));
?>
示例5: array
echo $form->labelEx($model, 'WorkerID');
?>
<?php
echo $form->dropDownList($model, 'WorkerID', CHtml::listData(Worker::model()->findAll(), 'ID', 'Fullname'), array('empty' => '-- Selecciona un operario --', 'style' => 'width: 200px;'));
?>
<?php
echo $form->error($model, 'WorkerID');
?>
</div>
<div class="row" style="float: left;">
<?php
echo $form->labelEx($model, 'PointID');
?>
<?php
echo $form->dropDownList($model, 'PointID', CHtml::listData(Point::model()->findAll(), 'ID', 'Name'), array('empty' => '-- Selecciona el punto critico --', 'style' => 'width: 360px;'));
?>
<?php
echo $form->error($model, 'PointID');
?>
</div>
<div class="clear"></div>
<div class="row">
<?php
echo $form->labelEx($model, 'Name');
?>
<?php
echo $form->textField($model, 'Name', array('style' => 'width: 600px;', 'maxlength' => 150));
?>
示例6: actionDelete
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function actionDelete($id)
{
$this->loadModel($id)->delete();
$this->DeleteTVBlocks($id);
Point::model()->RemovePointSpoolPath($id);
// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if (!isset($_GET['ajax'])) {
//$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
$model = new Point('search');
$model->unsetAttributes();
// clear any default values
$this->redirect(array('point/index'), array('model' => $model));
}
}
示例7: actionGetWidgets
public function actionGetWidgets($id)
{
$point = Point::model()->findByPk($id);
if (!isset($point)) {
http_response_code(404);
echo sprintf('Point with id %s does not exist.', $id);
exit;
}
if (!$point->screen) {
http_response_code(500);
echo 'Point screen haven\'t been configured.';
exit;
}
$responce = ['responce_version' => '1'];
$screen = $point->screen;
$responce['screen'] = $screen->getInfo();
$channels = $point->channels;
$responce['widgets'] = [];
foreach ($channels as $channel) {
$widgetToChannel = $channel->widgetToChannel;
$window = $channel->window;
if ($widgetToChannel && $window && $widgetToChannel->widget) {
$widget = $widgetToChannel->widget;
$widgetObj = $this->widget('application.widgets.' . ucfirst($widget->name) . 'Widget', ['type' => 'showData', 'config' => json_decode($widget->config)]);
$responce['widgets'][] = ['window' => $window->getInfo(), 'config' => $widget->getInfo(), 'content' => $widgetObj->showData()];
}
}
echo json_encode($responce);
exit;
}