2 require "../../plugins/php/dbClass3.php";
\r
3 $appName="Northwind";
\r
6 function CreateDbClass() {
\r
8 $oDB = new dbClass();
\r
16 return $oDB->MySqlLogon($appDB, "userid", "password");
\r
19 //$oDB->Dialect="TSQL";
\r
20 //return $oDB->MSSqlLogon("computer/instance", $appDB, "userid", "password");
\r
23 //$oDB->Dialect="Access";
\r
24 //return $oDB->OdbcLogon("northwindDSN","Northwind","userid","password");
\r
27 //$oDB->Dialect="Oracle";
\r
28 //return $oDB->OracleLogon("XE","northwind","password");
\r
32 function OpenApp($title) {
\r
37 if (!empty($title)) {
\r
38 AppHeader($GLOBALS['appName']."-".$title);
\r
40 $GLOBALS['accessRights']="rw";
\r
41 // CHECK APPLICATION SECURITY HERE (in this example, "r" gives read-only access and "rw" gives read/write access)
\r
42 if (empty($GLOBALS['accessRights']) || !isset($GLOBALS['accessRights']) || substr($GLOBALS['accessRights'],0,1) != "r") {
\r
43 echo "<p class='error'>You do not have permission to access this application";
\r
52 function OpenTableEdit($tabname) {
\r
53 $obj= new TableEditClass();
\r
54 $obj->SetTableName($tabname);
\r
55 $obj->options["XMLprovider"]="ricoQuery.php";
\r
56 $obj->convertCharSet=true; // because sample database is ISO-8859-1 encoded
\r
61 function OpenGridForm($title, $tabname) {
\r
63 if (!OpenApp($title)) {
\r
66 $GLOBALS['oForm']= OpenTableEdit($tabname);
\r
67 $CanModify=($GLOBALS['accessRights'] == "rw");
\r
68 $GLOBALS['oForm']->options["canAdd"]=$CanModify;
\r
69 $GLOBALS['oForm']->options["canEdit"]=$CanModify;
\r
70 $GLOBALS['oForm']->options["canDelete"]=$CanModify;
\r
71 session_set_cookie_params(60*60);
\r
72 $GLOBALS['sqltext']='.';
\r
77 function CloseApp() {
\r
79 if (is_object($oDB)) $oDB->dbClose();
\r
81 $GLOBALS['oForm']=NULL;
\r
85 function AppHeader($hdg) {
\r
86 echo "<h2 class='appHeader'>".str_replace("<dialect>",$GLOBALS['oDB']->Dialect,$hdg)."</h2>";
\r