本文整理汇总了PHP中Control::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::model方法的具体用法?PHP Control::model怎么用?PHP Control::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionInforme
public function actionInforme()
{
if ($_POST["start"]) {
set_time_limit(600);
# mPDF
$pdf = Yii::app()->ePdf->mpdf('', 'A4', '', '', '', '', '', '', '', '', 'P');
$pdf->writeHTMLfooter = false;
$pdf->writeHTMLheader = false;
$pdf->DeflMargin = 5;
$pdf->DefrMargin = 5;
$pdf->tMargin = 5;
$pdf->bMargin = 5;
$pdf->w = 297;
//manually set width
$pdf->h = 209.8;
//manually set height
# render (full page)
$pdf->WriteHTML($this->renderPartial('_cover', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_temperature', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_storage', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_clean', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_oil', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_rats', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_chlorine', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_verification', array(), true));
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_verification2', array(), true));
// Custom controls
$criteria = new CDbCriteria();
$criteria->condition = "UserID = :userid";
$criteria->params = array(':userid' => Yii::app()->user->ID);
$modelControls = Control::model()->findAll($criteria);
if (count($modelControls) > 0) {
foreach ($modelControls as $control) {
$pdf->Addpage();
$pdf->WriteHTML($this->renderPartial('_control', array('model' => $control), true));
}
}
# Outputs ready PDF
$pdf->Output('APPC_' . date("d/m/Y") . '.pdf', 'D');
} else {
$this->render('selector');
}
}
示例2: Top
public function Top($num)
{
$criteria = new CDbCriteria();
$criteria->condition = "UserID = :userid";
$criteria->params = array(':userid' => Yii::app()->user->ID);
$criteria->limit = $num;
$model = Control::model()->findAll($criteria);
$result = "";
$result .= "<table cellpadding='5' cellspacing='0' border='0' style='border-collapse: collapse;'>";
$result .= "<tr><td><b>Punto critico</b></td><td><b>Control</b></td></tr>";
foreach ($model as $customer) {
$result .= "<tr>";
$result .= "<td><a href='" . Yii::app()->createURL('/APPC/point/update/', array('id' => $customer->ID)) . "'>" . Functions::stringCut($customer->point->Name, 25) . "</a></td>";
$result .= "<td><a href='" . Yii::app()->createURL('/APPC/point/update/', array('id' => $customer->ID)) . "'>" . Functions::stringCut($customer->Name, 25) . "</a></td>";
$result .= "</tr>";
}
$result .= "</table>";
return $result;
}
示例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 the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Control::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例4: date
<td><b>Fecha de comienzo:</b></td><td><?php
echo date("d/m/Y", strtotime($model->Startdate));
?>
</td>
<td><b>Fecha de finalizacion:</b></td><td><?php
echo date("d/m/Y", strtotime($model->Enddate));
?>
</td>
</tr>
<tr>
<td><b>Empleado:</b></td><td><?php
echo $model->worker->Fullname;
?>
</td>
<td><b>Frecuencia:</b></td><td><?php
echo Control::model()->giveFrecuency($model->Frecuency);
?>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"><b>Tarea:</b></td>
</tr>
<tr>
<td colspan="4"><?php
echo $model->Task;
?>
</td>
</tr>