예제 #1
0
    default:
        $body_background = 'background:#eee';
        $body_class = '';
        break;
}
define('BODY_BACKGROUND', $body_background);
define('BODY_CLASS', $body_class);
//$body_background='#ffe url('.IMAGEROOT.'/fontys_fish.png)';
/* Database connection stuff. */
require_once 'peerpgdbconnection.php';
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
require_once '/home/etc/peerpassword';
$host = '';
$proto = 'pgsql';
$tutor_code = '';
$dbConn = new PeerPGDBConnection($proto);
if (!$dbConn->Connect($host, $dbUser, $pass, $db_name)) {
    die("sorry, cannot connect to database {$db_name} because " . $dbConn->ErrorMsg());
}
// get database time
$sql = "select date_trunc('seconds',now()) as database_time";
$resultSet = $dbConn->Execute($sql);
extract($resultSet->fields);
//$dbConn->setLogFilename($site_home.'/log/updatelog.txt');
$dbConn->setSqlLogModifyingQuery(true);
$dbConn->setSqlLogging(true);
require_once 'peerutils.inc';
//$dbConn->setLogFilename($site_home.'/log/updatelog.txt');
$dbConn->setSqlLogModifyingQuery(true);
$dbConn->setSqlLogging(true);
// must include next line before any session start
예제 #2
0
<?php

if (!isset($db_name)) {
    $db_name = 'sebiassessment';
}
$dbUser = '******';
$host = 'localhost';
$proto = 'pgsql';
$pass = '******';
$include_path = ini_get('include_path');
$include_path = '/home/hom/peerweb/peer/peerlib/:' . $include_path . ':/usr/share/php/PHPExcel/';
$include_path = ini_set('include_path', $include_path);
require_once 'peerpgdbconnection.php';
$dbConn = new PeerPGDBConnection($proto);
if (!$dbConn->Connect('localhost', $dbUser, $pass, $db_name)) {
    die("sorry, cannot connect to database {$db_name} because " . $dbConn->ErrorMsg());
}
예제 #3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->connection = new PeerPGDBConnection();
     $this->connection->Connect("localhost", "muk", "muk", "mak");
 }