Location: PHPKode > scripts > ER Manager > ermanager/company.php
<?PHP

require_once "session.php";
require_once "functions.php";

//load existing data
if($id) {
	$get_company = "SELECT * FROM er_companies WHERE id = ".$id."";
	$result_company = runSQL($get_company);

	$get_todos = "select * from er_todos where company_id='$id' and (status !='1' or status is NULL) order by deadline";
	$result_todos = runSQL($get_todos);

	$get_notes = "select * from er_notes where company_id='$id' order by date desc";
	$result_notes = runSQL($get_notes);
	
	$get_todos_done = "select * from er_todos where company_id='$id' and status='1' order by deadline desc";
	$result_todos_done = runSQL($get_todos_done);
	
	$get_forma_info = "select * from er_forma where company_id='$id' order by year desc";
	$result_forma_info = runSQL($get_forma_info);
	
} //end if id

//prepare
tpl_edit_company($result_company);
tpl_list_forma_info($result_forma_info);
tpl_list_todos($result_todos);
tpl_list_notes($result_notes);
tpl_list_todos_done($result_todos_done);
tpl_footer();
tpl_header('browse');

//display templates
$smarty->display('header.tpl');
flush();

$smarty->display('company.tpl');
$smarty->display('footer.tpl');

?>
Return current item: ER Manager