Esempio n. 1
0
<thead>
<tr>
  <th>Serie/Numero</th>
  <th>Fecha</th>
  <th>Cliente</th>
  <th>Estado</th>
  <th>Notas</th>
  <th>Acciones</th>
</tr>
</thead>
<tbody>
<?php 
//Generar los registros obtenidos de pedidos.
$modelo = new pedido();
foreach ($registros as $indice => $registro) {
    $modelo->cargarRegistro($registro);
    echo '<tr class="' . ($indice % 2 == 0 ? 'par' : 'impar') . '">';
    //Columna SERIE/NUMERO
    echo '<td class="cen">' . html::encode(sprintf('%s/%06d', $modelo->serie, $modelo->numero)) . '</td>';
    //Columna FECHA
    $fecha = strtotime($modelo->fecha);
    $fecha = $fecha === false ? '' : date('d-m-Y', $fecha);
    echo '<td class="cen">' . html::encode($fecha) . '</td>';
    //Columna CLIENTE
    $cliente = $modelo->refCli;
    if ($modelo->cargarCliente()) {
        $cliente .= ' - ' . $modelo->cliente->apellidos . ', ' . $modelo->cliente->nombre;
    } else {
        $cliente = '*' . $cliente;
    }
    //indicar una referencia que no existe en la bd.