✏️ 正在编辑: exportar.phtml
路径:
/srv/systems_dir/yuppiecred/application/views/scripts/folha-ponto/exportar.phtml
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php if ($this->folhas): $data = explode('/', $this->mesAno); $data = mktime(0, 0, 0, $data[0] + 1, 0, $data[1]); $this->mesAno = date('Y-m', $data); ?> <?php foreach ($this->folhas as $funcionario): ?> <table> <tr> <th colspan="5"><h3 class="tit_local">Folha de Ponto referente ao mês de <?php echo strftime('%B de %Y', strtotime($this->mesAno)); ?></h3></th> </tr> <tr> <th>Funcionário:</th> <th colspan="4"><?php echo $funcionario['nome'] ?></th> </tr> </table> <table> <thead> <tr class="top_list"> <th>Dia</th> <th>Chegada no Trabalho</th> <th>Saída do trabalho</th> <th>Total horas trabalhadas </th> <th>Total Folga</th> </tr> </thead> <tbody> <?php $semana = []; $mes = []; $folgaMes = []; $folgaSemana = []; $data = explode('/', $this->mesAno); $lastDay = (new DateTime($data[1] . '-' . $data[0]))->format('t'); $mensal = $semanal = 0; for($i = 1; $i <= $lastDay; $i++): $ponto = isset($funcionario['pontos'][$i]) ? $funcionario['pontos'][$i] : null; $classTd = ''; $blank = '-'; $isFolga = $funcionario['folgas'] && isset($funcionario['folgas']->$i); $isFolgaCompleta = $isFolga && $funcionario['folgas']->$i['isCompleta']; $isFolgaHoras = $isFolga && !$funcionario['folgas']->$i['isCompleta']; if ($ponto && !$isFolgaCompleta) { $semana[] = $this->somaHorario($ponto); $mes[] = $this->somaHorario($ponto); } if ($isFolga) { $folgaMes[] = $funcionario['folgas']->$i['horas']; $folgaSemana[] = $funcionario['folgas']->$i['horas']; } ?> <tr> <td ><?php echo $i ?></td> <?php if ($isFolgaCompleta): ?> <td colspan="2" class="folga-data-td"> FOLGA: <?php echo $funcionario['folgas']->$i['descricao']; ?> </td> <?php endif; ?> <?php if ($isFolgaHoras) { $blank = 'FOLGA: ' . $funcionario['folgas']->$i['descricao']; $isFolgaHoras = true; $classTd = 'folga-td'; } ?> <?php if (!$isFolgaCompleta): ?> <td class="<?php echo empty($funcionario['pontos'][$i]['chegada_trabalho']) ? $classTd : ''; ?>"> <?php echo $funcionario['pontos'][$i]['chegada_trabalho'] ?? $blank ?> </td> <td class="<?php echo empty($funcionario['pontos'][$i]['saida_trabalho']) ? $classTd : ''; ?>"> <?php echo $funcionario['pontos'][$i]['saida_trabalho'] ?? $blank ?> </td> <?php endif; ?> <td> <?php echo !$isFolgaCompleta ? $this->somaHorario($ponto) : '00:00:00'; ?> </td> <td> <?php echo $isFolga ? $funcionario['folgas']->$i['horas'] : '00:00:00' ?> </td> </tr> <?php if(date("N", strtotime("$data[1]-$data[0]-$i")) == 6 || $i == $lastDay ): ?> <tr class="folha-ponto-total-semanal"> <td colspan="3">TOTAL SEMANAL</td> <td><?php echo $this->calculateTime($semana); ?></td> <td><?php echo $this->calculateTime($folgaSemana); ?></td> </tr> <?php $semana = []; $folgaSemana = []; endif; ?> <?php endfor; ?> <tr class="top_list"> <th colspan="3" style="font-weight: bold">TOTAL MENSAL</th> <th style="font-weight: bold "><?php echo $this->calculateTime($mes); ?></th> <th style="font-weight: bold "><?php echo $this->calculateTime($folgaMes); ?></th> </tr> </tbody> </table> <p></p> <?php endforeach; ?> <?php endif; ?>
💾 保存文件
← 返回文件管理器