Welcome Guest, Not a member yet? Register   Sign In
HowTo generate several table using CI Table library ?
#1

[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();


Messages In This Thread
HowTo generate several table using CI Table library ? - by El Forum - 10-19-2009, 08:51 AM
HowTo generate several table using CI Table library ? - by El Forum - 10-19-2009, 09:03 AM
HowTo generate several table using CI Table library ? - by El Forum - 10-19-2009, 09:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB