本文整理汇总了PHP中Worker::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Worker::model方法的具体用法?PHP Worker::model怎么用?PHP Worker::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Worker
的用法示例。
在下文中一共展示了Worker::model方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionWorkers
function actionWorkers()
{
//$worker_model = new Worker;
$workers = Worker::model()->with('department', 'position')->findAll();
$this->render('workers', array('workers' => $workers));
}
示例2: array
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'control-form', 'enableAjaxValidation' => false));
?>
<?php
echo $form->hiddenField($model, 'UserID', array('value' => Yii::app()->user->ID));
?>
<div class="row" style="float: left;margin-right:52px;">
<?php
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');
示例3: array
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'control-form', 'enableAjaxValidation' => false));
?>
<?php
echo $form->hiddenField($model, 'UserID', array('value' => Yii::app()->user->ID));
?>
<div class="row" style="float: left;width:31%;">
<?php
echo $form->labelEx($model, 'WorkerID');
?>
<?php
echo $form->dropDownList($model, 'WorkerID', CHtml::listData(Worker::model()->findAll($criteria), 'ID', 'Fullname'), array('empty' => '-- Selecciona un trabajador --', 'style' => 'width: 100%;'));
?>
<?php
echo $form->error($model, 'WorkerID');
?>
</div>
<div class="row" style="float: left;width:60%;margin-left: 8%;">
<?php
echo $form->labelEx($model, 'PointID');
?>
<?php
echo $form->dropDownList($model, 'PointID', CHtml::listData(Point::model()->findAll($criteria), 'ID', 'Name'), array('empty' => '-- Selecciona el punto critico --', 'style' => 'width: 100%;'));
?>
<?php
echo $form->error($model, 'PointID');
示例4: actionDeleteWorker
public function actionDeleteWorker()
{
$id = intval($_GET['id']) > 0 ? intval($_GET['id']) : 0;
if ($id == 0) {
throw new CHttpException(1000, 'Работник не найден');
} else {
$cu = User::model()->deleteByPk($id);
if ($cu > 0) {
$cw = Worker::model()->deleteByPk($id);
if ($cw <= 0) {
throw new CHttpException(1001, 'В процессе удаления произошла ошибка');
} else {
$this->renderPartial('view', array('data' => 'Ur-data'), false, true);
}
} else {
throw new CHttpException(1001, User::model()->getErrors());
}
}
}
示例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 the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Worker::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例6: strtotime
</tr>
<tr>
<td>Fecha</td>
<td>Superficie</td>
<td>Metodo y materiales</td>
<td>Eficacia de la limpieza</td>
<td>Empleado</td>
<td>Medida correctora</td>
<td>Firma responsable</td>
</tr>
<?php
for ($i = 0; $i < $dias; $i++) {
?>
<?php
$newFecha = strtotime($_POST["start"]) + $i * 86400;
$Worker = Worker::model()->findByAttributes(array("UserID" => Yii::app()->user->ID));
?>
<tr>
<td><?php
echo date("d-m-Y", $newFecha);
?>
</td>
<td>Suelos</td>
<td>Fregado con detergente</td>
<td>OK</td>
<td><?php
echo $Worker->Fullname;
?>
</td>
<td></td>
<td></td>