I have a question. Currently I have a timeline in html which shows me one on the right and the other on the left, but I want to integrate it with dynamic data.
To put right start only with <li>
But to put it to the left I start it with <li class="time-inverted">
What I want is the first one I put it on the left and the next one on the right and so on, depending on the amount I bring.
This is my php query:
public function historial() {
$id_activo = $this->input->post('id_activo');
$historial = $this->stock->historial($id_activo);
$resp = '';
foreach ($historial as $row) {
$resp .= "<ul class='timeline'>
<li>
<div class='timeline-panel'>
<div class='timeline-heading'>
<h4 class='timeline-title'>" . $row ['nombre_completo'] . "</h4>
</div>
<p><small class='text-muted'><i class='glyphicon glyphicon-time'></i> " . $row ['fecha_asignada'] . "</small></p>
<div class='timeline-body'>
<p>" . $row ['tipo'] . " - " . $row ['descripcion'] . "</div>
</div>
</li>
</ul>";
}
echo json_encode($resp);
}
As you can see here I only use in <li>
but the query returns 2 data or in other cases more data, I do not know how to put the second parameter in <li class="time-inverted">
and the one that follows it to the right and in that way