/?php require_once('config.php'); require_once PATH.'WACT/wact-0.1a/framework/common.inc.php'; require_once WACT_ROOT . '/template/template.inc.php'; require_once WACT_ROOT . '/controllers/formcontroller.inc.php'; require_once(PATH.'include/global_inc.php'); require_once(PATH.'include/main_view.class.php'); if(!($_GET['page'] > 0)){ $_GET['page'] = 0; } $db =& DBManager::connection('main'); $db->connect(); $sql="SELECT DISTINCT state FROM business_customers WHERE published='on' ORDER BY state ASC"; $rs = new MySqlRecordSet($db,$sql); $rs->reset(); $state_options=""; if ($_GET['state']){ $state=addslashes($_GET['state']); if ($state !=''){ $sql="SELECT * FROM business_customers WHERE state = '$state' ORDER BY customer ASC"; $rs = new MySqlRecordSet($db,$sql); } }else{ $sql="SELECT * FROM business_customers ORDER BY customer ASC"; $rs = new MySqlRecordSet($db,$sql); } $View = new Template(TEMPLATE_PATH.'business_customers.tpl'); $mv = new MainView($View,1); $form =& $View->getChild('form'); $form->set('state_options',$state_options); $pager =& $View->getChild('pagenav'); $rs->paginate($pager); $customers =& $View->findChild('customers'); $customers->registerDataSet($rs); $View->display(); ?>