Rod_ Posted October 24, 2008 Share Posted October 24, 2008 That's it. Who knows how can I add a new tab on the admin panel and how to create a page for it?.Thx =) Link to comment Share on other sites More sharing options...
Paul C Posted October 24, 2008 Share Posted October 24, 2008 Rod_ you need a new class file in [admin]/tabs. I suggest you pick a "simple" one as your base You then need to install it via the Tools-> Tabs pane. Click add new Paul Link to comment Share on other sites More sharing options...
Rod_ Posted October 25, 2008 Author Share Posted October 25, 2008 Thx Paul. It works.But now going in to the code... How does the "__construct()" function work?. I'm a bit confused trying to get some values from my DB.Is "$this->table = 'xxxxxx'" this the database table name or what?. Where do I put the DB table name of the query? (FROM). Link to comment Share on other sites More sharing options...
Paul C Posted October 25, 2008 Share Posted October 25, 2008 The tables are encapsulated by objects though, so unless you're creating new tables in the database you shouldn't normally be worried about the $this->table property. If you want to create a new table, then you would create a class for it (e.g. the Supplier class in /classes/Supplier.php).If you need data from tables, then you would use the member functions of an object of the correct class. In the example of getting supplier data, you would instantiate a supplier object : $mysupplier = new Supplier(); The you can use any of the member functions in the supplier class to obtain data from the database.You can also just execute queries directly on the database, using the Db class: $query = 'SELECT * FROM '._DB_PREFIX_.'supplier;'; $result = Db::getInstance()->ExecuteS($query); Note that if you make changes to the database using the second example, then you'd be bypassed the application logic, and your database may no longer be consistent.[/code]Hope this helps!Paul Link to comment Share on other sites More sharing options...
Recommended Posts