Maybe I'm doing this wrong or maybe I'm making this more complicated than it should be? I'm not sure but I downloaded Agile toolkit to make a basic database report grid that some less tech savvy people can look at nicely as I was just going to make an ugly simple one with some queries. However I'm having a hard time of understanding what needs to be changed and altered in the kit once downloaded.
I found a nice example on this site but it seems like a copy paste thing that makes things even more confusing for me. - Any good PHP MySQL-compatible reporting frameworks out there?
I make a SEPARATE config file at the ROOT of the app?
<?php
$config["atk"]["base_path"]="./atk4/";
$config["dsn"]='mysql://root:root@localhost/project';
$config['url_postfix']='.php';
?>
I was under the assumption that I add the name of the database I connect to in place of the 'project'. The root:root us indeed the user and password I use on my localhost so that's fine.
It seems the example in the other question wants me to include this set up in the ROOT index.php and NOT the one in the page sub-directory. Which does generate the admin control login.
<?php
include'atk4/loader.php';
class MyApp extends ApiFrontend {
function init(){
parent::init();
$this->add('jUI');
$this->add('BasicAuth')->allow('demo','demo')->check();
$this->add('Menu',null,'Menu')
->addMenuItem('report','index')
->addMenuItem('logout');
}
function page_index($p){
$this->dbConnect();
$f=$p->add('Filter',null,null,array('form_empty'));
$f->addField('line','name');
$f->addField('line','surname');
$f->addSubmit('Search');
$g=$p->add('Grid');
$g->setSource('user');
$g->addColumn('text','gender')->makeSortable();
$g->addColumn('text','name')->makeSortable();
$g->addColumn('text','surname')->makeSortable();
$g->addPaginator(25);
$f->useDQ($g->dq);
}
}
$api=new MyApp('myapp');
$api->main();
I know the source parameter is where I insert the name of the table I want to query, but I'm not sure if I make a file with my queries or where it's even suppose to go if I do. The tool book seems a little confusing in regards to how it flows and I would be better off watching specific project demos via a video.
If all of that extra stuff is needed I would assume that it would have been mentioned in the answer. Yet if I do as the answer suggests. I get the following error - SQLSTATE[42000] [1049] Unknown database 'example'
I'm not sure where it is pulling the example database from or why my config file is not effecting anything. If I could get some help with what files I should be messing with I would greatly appreciate it. Thank you.