<th width="22%">Tình trạng</th> <th width="55%">Camera</th> </tr> <?php if (!empty($model->sensor_status)) { $no = 1; $countSensor = count($model->sensor_status); foreach ($model->sensor_status as $status) { $value = $status['value']; $label = $value; if ($status['type'] == Sensor::TYPE_VALUE) { continue; } else { if ($status['type'] == Sensor::TYPE_CONFIGURE) { $message = Message::getMessageBySensor($status['sensor_id'], $value); $label = $value == 0 ? Show::decorateString($message, 'bad') : Show::decorateString($message, 'good'); } } ?> <tr> <th style="text-align: center"><?php echo $no; ?> </th> <td> <div class="kv-attribute"><?php echo $status['name']; ?> </div> </td>
public function actionGetMessage() { $sensorID = Yii::$app->request->post('sensor_id'); $sensorValue = Yii::$app->request->post('sensor_value'); print Message::getMessageBySensor($sensorID, $sensorValue); }