[eluser]minoh[/eluser]
Hello guys,
I'm trying to use CI Table library to generate 2 tables elements. the problem is that in the second table i get seconde table data but also first table data.
this is my code :
Code:
// first table
$this->load->library('table');
$this->table->set_empty(' ');
$this->table->set_heading('No','Fourniture','Quantity','Price');
$f = 0 + $offset;
if(isset($_SESSION['fournitures']))
{
$f_sess = $_SESSION['fournitures'];
foreach($f_sess as $fourniture)
{
$this->table->add_row(++$f, fourniture['fourniture'], $fourniture['qt'],
$fourniture['pr'].' '.'€');
}
}
$data['fournitures_table'] = $this->table->generate();
// second table
$this->table->set_empty(' ');
$this->table->set_heading('No','Other Fourniture','Quantity','Price');
$of = 0 + $offset;
if(isset($_SESSION['other_fournitures']))
{
$of_sess = $_SESSION['other_fournitures'];
foreach($of_sess as $other_fourniture)
{
$this->table->add_row(++$of, other_fourniture['other_fourniture'], $other_fourniture['qt'], $other_fourniture['pr'].' '.'€');
}
}
$data['other_fournitures_table'] = $this->table->generate();