X-Git-Url: https://git.infodrom.org/?p=misc%2Fkostenrechnung;a=blobdiff_plain;f=lib%2Fdbase.php;h=d493968cbf2bd07753b241a32a8c095dbd5647c6;hp=bfbc55b881f2d8c44a34a0cb2a4cb512da1d0767;hb=deaf08b6e3fc5c35d139b83db7f4951f4685eb30;hpb=01201a49ac1f069e5ac15fce28383e32fc031b5e diff --git a/lib/dbase.php b/lib/dbase.php index bfbc55b..d493968 100644 --- a/lib/dbase.php +++ b/lib/dbase.php @@ -1,100 +1,38 @@ Dialect="MySQL" // this is the default, so you can leave it commented //$oDB->Dialect="Oracle"; //$oDB->Dialect="TSQL"; //$oDB->Dialect="Access"; -} + $oDB->Dialect="PostgreSQL"; + } function OpenDB() { global $oDB; CreateDbClass(); - + // This is where the database connection is made // Uncomment the appropriate line for your database - + // Using MySQL // $oDB->Provider="MySQLremoveserver" // required if MySQL is remote - return $oDB->MySqlLogon($GLOBALS['appDB'], "userid", "password"); - + return $oDB->PostgreSqlLogon(DBNAME, DBUSER, DBPASS); + // Connect via ODBC to a DSN //return $oDB->OdbcLogon("northwindDSN","Northwind","userid","password"); - + // Connect to Oracle XE // Make sure the Oracle database is loaded with the sample database // $oDB->Provider="MySQLremoveserver" // required if Oracle is remote //return $oDB->OracleLogon("XE","northwind","password"); } -function OpenApp($title) { - $_retval=false; - if (!OpenDB()) { - return $_retval; - } - if (!empty($title)) { - AppHeader($GLOBALS['appName']."-".$title); - } - $GLOBALS['accessRights']="rw"; - // CHECK APPLICATION SECURITY HERE (in this example, "r" gives read-only access and "rw" gives read/write access) - if (empty($GLOBALS['accessRights']) || !isset($GLOBALS['accessRights']) || substr($GLOBALS['accessRights'],0,1) != "r") { - echo "
You do not have permission to access this application"; - } - else { - $_retval=true; - } - return $_retval; -} - -function OpenTableEdit($tabname) { - $obj= new TableEditClass(); - $obj->SetTableName($tabname); - $obj->options["XMLprovider"]="ricoXMLquery.php"; - $obj->convertCharSet=true; // because sample database is ISO-8859-1 encoded - return $obj; -} - -function OpenGridForm($title, $tabname) { - $_retval=false; - if (!OpenApp($title)) { - return $_retval; - } - $GLOBALS['oForm']= OpenTableEdit($tabname); - $CanModify=($GLOBALS['accessRights'] == "rw"); - $GLOBALS['oForm']->options["canAdd"]=$CanModify; - $GLOBALS['oForm']->options["canEdit"]=$CanModify; - $GLOBALS['oForm']->options["canDelete"]=$CanModify; - session_set_cookie_params(60*60); - $GLOBALS['sqltext']='.'; - return true; -} - -function CloseApp() { - global $oDB; - if (is_object($oDB)) $oDB->dbClose(); - $oDB=NULL; - $GLOBALS['oForm']=NULL; -} - -function AppHeader($hdg) { - echo "