html table class

#1
[eluser]misterdonut[/eluser]
$this->load->library('table');

Code:
$querystr = "SELECT id, fname, lname FROM cc_clients WHERE fname LIKE '%$searchstr%'
                OR lname LIKE '%$searchstr%'
                OR concat(lname,' ',fname) LIKE '%$searchstr%'
                OR concat(fname,' ',lname) LIKE '%$searchstr%'";
                    
    $query = $this->db->query($querystr);
    
    if ($query->num_rows() > 0)
    {
        echo $this->table->generate($query);
    }
so can i add something the table class dynamically?
like

like another table cell
<a href="client/check/5"> check </a>
where 5 is the id.

#2
[eluser]xwero[/eluser]
First of all you can't add the query object to the generate method. You have to create an array first.

If you want to manipulate the raw db content you can do this in the the sql statement or in php that choice is up to you.

#3
[eluser]misterdonut[/eluser]
i'm using echo $this->table->generate($query); right now
its working just fine

how come i can't add it?

#4
[eluser]xwero[/eluser]
It's not in mentioned in the documentation but i saw in the code the query object is processed.

So if you want to add the query object to the generate function there is no other way than to manipulate the data in you sql statement by using concat in the select part.

#5
[eluser]misterdonut[/eluser]
good idea thanks

#6
[eluser]llbbl[/eluser]
do a foreach on query->result as row

url = <a href="client/check/5"> check </a>

then this-table-add_row(row-blah, row-food, url)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.