✏️ 正在编辑: NotificacaoChamado.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/models/NotificacaoChamado.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_NotificacaoChamado { protected $fields = array(); protected $params = array(); protected $tableHTML = ''; protected $status = true; public function __construct($params) { $this->params = $params->toArray(); } protected function preparaDados() {} public function mensagem() { if (!$this->status) return ''; $this->preparaDados(); $this->montarTabelaHTML(); return $this->tableHTML; } protected function montarTabelaHTML() { $this->_iniciaTabela() ->_montaHeaderBody() ->_finalizaTabela(); } private function _montaHeaderBody() { $htmlHeader = "<thead> <tr style='background: #666; color: #FFF;'>"; $htmlBody = "<tbody> <tr>"; foreach ($this->fields as $field) { $coluna = $this->_preparaColuna($field); $htmlHeader .= "<th style='border-radius: 3px;'>$coluna</th>"; $htmlBody .= "<td align='center'>{$this->params[$field]}</td>"; } $htmlHeader .= "</tr></thead>"; $htmlBody .= "</tr></tbody>"; $this->tableHTML .= $htmlHeader . $htmlBody; return $this; } private function _iniciaTabela() { $styleDiv = "style='border: 1px solid silver; border-radius: 3px; margin-bottom: 10px; margin-top: 10px;'"; $styleTable = "style='font-size: 12px; margin: 0; '"; $this->tableHTML = "<div $styleDiv ><table $styleTable width='100%'>"; return $this; } private function _finalizaTabela() { $this->tableHTML .= '</table></div>'; return $this; } private function _preparaColuna($value) { return ucwords(str_replace('_', ' ', $value)); } }
💾 保存文件
← 返回文件管理器