mike.morgan%oregonstate.edu c69f8fa925 Added multi-app support per requests made in bug 331632. Also separated out forms so we can localize things in the future. :)
git-svn-id: svn://10.0.0.236/trunk@194619 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-18 18:51:59 +00:00

54 lines
1.0 KiB
PHP

<?php
/**
* Init script.
*
* @package survey
* @subpackage inc
*/
/**
* Require config and required libraries.
*/
require_once('config.php');
require_once(ROOT_PATH.'/lib/sql.class.php');
require_once(ROOT_PATH.'/lib/survey.class.php');
/**
* Configure database.
*/
class Survey_SQL extends SQL {
function Survey_SQL() {
require_once("DB.php");
$dsn = array (
'phptype' => 'mysql',
'dbsyntax' => 'mysql',
'username' => DB_USER,
'password' => DB_PASS,
'hostspec' => DB_HOST,
'database' => DB_NAME,
'port' => DB_PORT
);
$this->connect($dsn);
// Test connection; display "gone fishing" on failure.
if (DB::isError($this->db)) {
require_once('../webroot/unavailable.php');
exit;
}
}
}
/**
* Set global variables.
*/
$db = new Survey_SQL();
$app = new Survey();
/**
* Set up arrays to hold cleaned inputs.
*/
$clean = array();
$html = array();
$sql = array();
?>