MySqlLogon($appDB, "userid", "password"); // MS SQL //$oDB->Dialect="TSQL"; //return $oDB->MSSqlLogon("computer/instance", $appDB, "userid", "password"); // ODBC - MS Access //$oDB->Dialect="Access"; //return $oDB->OdbcLogon("northwindDSN","Northwind","userid","password"); // Oracle //$oDB->Dialect="Oracle"; //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"]="ricoQuery.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 "

".str_replace("",$GLOBALS['oDB']->Dialect,$hdg)."

"; } ?>