- Timestamp:
- Mar 5, 2010, 8:52:50 PM (15 years ago)
- Location:
- branches/web
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/web
- Property svn:ignore
-
old new 3 3 *.o 4 4 backup 5 6 5 index.cgi 7 8 6 index.compiled 9 10 7 UConfig.pas 8 bin
-
- Property svn:ignore
-
branches/web/UBill.pas
r158 r279 153 153 procedure TBill.Store; 154 154 var 155 Data: TAssoc Array;156 begin 157 Data := TAssoc Array.Create;155 Data: TAssociativeArray; 156 begin 157 Data := TAssociativeArray.Create; 158 158 Data.AddKeyValue('BillCode', BillCode); 159 159 Data.AddKeyValue('time_due', IntToStr(DateTimeToUnix(TimeDue))); … … 312 312 procedure TBillItem.Store; 313 313 var 314 DbRows: TDbRows; 315 Data: TAssocArray; 316 begin 317 Data := TAssocArray.Create; 314 Data: TAssociativeArray; 315 begin 316 Data := TAssociativeArray.Create; 318 317 Data.AddKeyValue('Quantitiy', IntToStr(Quantity)); 319 318 Data.AddKeyValue('Description', Description); -
branches/web/UCore.pas
r139 r279 36 36 37 37 uses 38 pwenvvar, pwmain,SysUtils, UConfig;38 SysUtils, UConfig; 39 39 40 40 procedure RegisterPage(Name: string; Producer: TPageProducer); … … 54 54 Navigace: string; 55 55 begin 56 Navigace := CgiEnvVar.RequestURI;56 //Navigace := CgiEnvVar.RequestURI; 57 57 Result := '<?xml version="1.0" encoding="utf-8"?>' + 58 58 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + -
branches/web/UDatabase.pas
r158 r279 20 20 FDatabase: TDatabase; 21 21 FId: Integer; 22 FRow: TAssoc Array;23 procedure WriteProperty(Instance: TDbObject; PropInfo: PPropInfo; Data: TAssoc Array; Depth: Integer);22 FRow: TAssociativeArray; 23 procedure WriteProperty(Instance: TDbObject; PropInfo: PPropInfo; Data: TAssociativeArray; Depth: Integer); 24 24 procedure DeleteProperty(Instance: TDbObject; PropInfo: PPropInfo); 25 25 procedure DestroyProperty(Instance: TDbObject; PropInfo: PPropInfo; Depth: Integer); 26 procedure ReadProperty(Instance: TObject; PropInfo: PPropInfo; Data: TAssoc Array; Depth: Integer);26 procedure ReadProperty(Instance: TObject; PropInfo: PPropInfo; Data: TAssociativeArray; Depth: Integer); 27 27 function SearchPropertyByPointer(P: Pointer): string; 28 28 public … … 33 33 procedure LoadById(Id: Integer; Depth: Integer = 1); 34 34 procedure Load(Depth: Integer = 1); 35 procedure LoadFromRow(Row: TAssoc Array; Depth: Integer = 1);35 procedure LoadFromRow(Row: TAssociativeArray; Depth: Integer = 1); 36 36 destructor Destroy(Depth: Integer = 100); virtual; 37 37 property Database: TDatabase read FDatabase write FDatabase; … … 126 126 { TDbObject } 127 127 128 procedure TDbObject.WriteProperty(Instance: TDbObject; PropInfo: PPropInfo; Data: TAssoc Array; Depth: Integer);128 procedure TDbObject.WriteProperty(Instance: TDbObject; PropInfo: PPropInfo; Data: TAssociativeArray; Depth: Integer); 129 129 var 130 130 PropType: PTypeInfo; … … 259 259 260 260 261 procedure TDbObject.ReadProperty(Instance: TObject; PropInfo: PPropInfo; Data: TAssoc Array; Depth: Integer);261 procedure TDbObject.ReadProperty(Instance: TObject; PropInfo: PPropInfo; Data: TAssociativeArray; Depth: Integer); 262 262 const 263 263 NilMethod: TMethod = (Code: nil; Data: nil); … … 434 434 procedure TDbObject.Store(Depth: Integer = 1); 435 435 var 436 Data: TAssoc Array;436 Data: TAssociativeArray; 437 437 I, Count: Integer; 438 438 PropInfo: PPropInfo; … … 442 442 LogMessage('Write class: ' + Self.ClassName); 443 443 if Depth >= 0 then begin 444 Data := TAssoc Array.Create;444 Data := TAssociativeArray.Create; 445 445 if Self.ClassInfo = nil then raise Exception.Create('Trida '+Self.ClassName+' neposkytuje RTTI informace!'); 446 446 Count := GetTypeData(Self.ClassInfo)^.PropCount; … … 585 585 var 586 586 I: Integer; 587 Data: TAssoc Array;587 Data: TAssociativeArray; 588 588 begin 589 589 if Depth >= 0 then begin … … 592 592 FDatabase.Delete(Self.ClassName, 'ListId='+IntToStr(FId)); 593 593 if Self.ClassName = 'tmeasurepointsetlist' then LogMessage('d'); 594 Data := TAssoc Array.Create;594 Data := TAssociativeArray.Create; 595 595 Data.AddKeyValue('ListId', IntToStr(FId)); 596 596 Data.AddKeyValue('ItemId', '0'); … … 617 617 begin 618 618 inherited; 619 inherited OnError := HandleError;620 619 end; 621 620 … … 626 625 end; 627 626 628 procedure TDbObject.LoadFromRow(Row: TAssoc Array; Depth: Integer = 1);627 procedure TDbObject.LoadFromRow(Row: TAssociativeArray; Depth: Integer = 1); 629 628 var 630 629 I, Count: Integer; -
branches/web/UFinance.pas
r135 r279 25 25 Notice: string; 26 26 Inet: Boolean; 27 procedure LoadFromDbRecord(DbRow: TAssoc Array);27 procedure LoadFromDbRecord(DbRow: TAssociativeArray); 28 28 function FullName: string; 29 29 end; … … 39 39 PriceUnits: Double; 40 40 SpeedFactor: Double; 41 procedure LoadFromDbRecord(DbRow: TAssoc Array);41 procedure LoadFromDbRecord(DbRow: TAssociativeArray); 42 42 function Agregation: Double; 43 43 end; … … 68 68 implementation 69 69 70 uses71 pwmain;72 73 70 { TMember } 74 71 75 procedure TMember.LoadFromDbRecord(DbRow: TAssoc Array);72 procedure TMember.LoadFromDbRecord(DbRow: TAssociativeArray); 76 73 begin 77 74 Id := StrToInt(DbRow.Values['id']); … … 85 82 InetTariffNow := StrToInt(DbRow.Values['inet_tarif_now']); 86 83 InetTariffNext := StrToInt(DbRow.Values['inet_tarif_next']); 87 MembershipDate := MysqlDateToDateTime(DbRow.Values['membership_date']);84 //MembershipDate := MysqlDateToDateTime(DbRow.Values['membership_date']); 88 85 Hardware := StrToBool(DbRow.Values['hw']); 89 86 Overheads := StrToBool(DbRow.Values['overheads']); … … 99 96 { TTariff } 100 97 101 procedure TTariff.LoadFromDbRecord(DbRow: TAssoc Array);98 procedure TTariff.LoadFromDbRecord(DbRow: TAssociativeArray); 102 99 begin 103 100 Name := DbRow.Values['name']; … … 144 141 BaseTariffPrice := StrToInt(DbRows[0].Values['BaseTariffPrice']); 145 142 DbRows.Free; 146 WebWriteLn('1');143 // WebWriteLn('1'); 147 144 148 145 DbRows := Database.Query('SELECT COUNT(*) FROM users WHERE inet=1 AND role=2'); … … 154 151 InternetSegmentId := 21; 155 152 DbRows.Free; 156 WebWriteLn('2');153 // WebWriteLn('2'); 157 154 158 155 DbRows := Database.Query('SELECT SUM(consumption) FROM network_segments'); … … 165 162 TotalPaid := StrToInt(DbRows[0].Values['real']); 166 163 167 WebWriteLn('3');164 // WebWriteLn('3'); 168 165 LoadTariffs(0); 169 166 end; … … 199 196 TariffList.Add(NewTariff); 200 197 end; 201 WebWriteLn('4');198 // WebWriteLn('4'); 202 199 203 200 if Period = 0 then Column := 'now' else Column := 'next'; … … 209 206 with TTariff(TariffList[I]) do 210 207 begin 211 WebWriteLn('5');208 // WebWriteLn('5'); 212 209 DbRows := Database.Select('users', 'COUNT(*)', 'inet_tarif_' + Column + '=' + IntToStr(I) + ' AND inet=1 AND role=2'); 213 210 UserCount := StrToInt(DbRows[0].ValuesAtIndex[0]); … … 237 234 SpeedPerUnit := ResidualSpeed * 1024 / TotalTarifSpeedUnits; 238 235 239 WebWriteLn('7');236 //WebWriteLn('7'); 240 237 // Recalculate price 241 238 for I := 0 to TariffList.Count - 1 do -
branches/web/UFinancePage.pas
r158 r279 24 24 25 25 uses 26 USqlDatabase, UCore, SysUtils, pwmain,UFinance;26 USqlDatabase, UCore, SysUtils, UFinance; 27 27 28 28 function FinanceOverviewPage: string; -
branches/web/UNews.pas
r158 r279 16 16 Title: string; 17 17 Permission: Integer; 18 procedure LoadFromDbRecord(DbRow: TAssoc Array);18 procedure LoadFromDbRecord(DbRow: TAssociativeArray); 19 19 procedure Store; 20 20 end; … … 30 30 IPAddress: string; 31 31 Category: Integer; 32 procedure LoadFromDbRecord(DbRow: TAssoc Array);32 procedure LoadFromDbRecord(DbRow: TAssociativeArray); 33 33 procedure Store; 34 34 end; … … 49 49 50 50 uses 51 URSS, pwmain,dateutils;51 URSS, dateutils; 52 52 53 53 { TNewsItem } 54 54 55 procedure TNewsItem.LoadFromDbRecord(DbRow: TAssoc Array);55 procedure TNewsItem.LoadFromDbRecord(DbRow: TAssociativeArray); 56 56 begin 57 57 Id := StrToInt(DbRow.Values['id']); … … 66 66 procedure TNewsItem.Store; 67 67 var 68 Values: TAssoc Array;69 begin 70 Values := TAssoc Array.Create;68 Values: TAssociativeArray; 69 begin 70 Values := TAssociativeArray.Create; 71 71 Values.AddKeyValue('content', Content); 72 72 Values.AddKeyValue('title', Title); … … 112 112 *) 113 113 114 if GetCgiVar('select') = '' then Select := '' else Select := GetCgiVar('select');114 //if GetCgiVar('select') = '' then Select := '' else Select := GetCgiVar('select'); 115 115 SelectParts := Explode('-', Select); 116 116 Where := ''; … … 182 182 { TNewsCategory } 183 183 184 procedure TNewsCategory.LoadFromDbRecord(DbRow: TAssoc Array);184 procedure TNewsCategory.LoadFromDbRecord(DbRow: TAssociativeArray); 185 185 begin 186 186 Id := StrToInt(DbRow.Values['id']); … … 191 191 procedure TNewsCategory.Store; 192 192 var 193 Values: TAssoc Array;194 begin 195 Values := TAssoc Array.Create;193 Values: TAssociativeArray; 194 begin 195 Values := TAssociativeArray.Create; 196 196 Values.AddKeyValue('permission', IntToStr(Permission)); 197 197 Values.AddKeyValue('title', Title); -
branches/web/UNewsPage.pas
r139 r279 12 12 13 13 uses 14 USqlDatabase, UCore, SysUtils, pwmain,UNews, UConfig;14 USqlDatabase, UCore, SysUtils, UNews, UConfig; 15 15 16 16 function NewsChannelBuild: string; … … 23 23 Result := ShowHeader('<strong>ZděchovNET</strong> - komunitní počítačová síť', 'Aktuality'); 24 24 URL := ''; 25 Count := CountCgiVars;25 //Count := CountCgiVars; 26 26 for I := 0 to Count - 1 do begin 27 Index := FetchCgiVarName(I);27 //Index := FetchCgiVarName(I); 28 28 if Copy(Index, 1, 8) = 'category' then URL := URL + '-' + Copy(Index, 9, Length(Index)); 29 29 end; … … 67 67 NewsItem := TNewsItem.Create; 68 68 Result := ShowHeader('<strong>ZděchovNET</strong> - komunitní počítačová síť', 'Aktuality'); 69 if GetCgiVar('id') = '' then Id := 1 else Id := StrToInt(GetCgiVar('id'));69 //if GetCgiVar('id') = '' then Id := 1 else Id := StrToInt(GetCgiVar('id')); 70 70 DbRows := Database.Query('SELECT `news`.*, UNIX_TIMESTAMP(`news`.date) as time, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`=' + IntToStr(Id)); 71 71 if DbRows.Count > 0 then begin … … 110 110 begin 111 111 Result := ShowHeader('<strong>ZděchovNET</strong> - komunitní počítačová síť', 'Aktuality'); 112 if GetCgiVar('category') = '' then Category := 1 else Category := StrToInt(GetCgiVar('category')); 112 // if GetCgiVar('category') = '' then Category := 1 else Category := StrToInt(GetCgiVar('category')); 113 113 NewsItem := TNewsItem.Create; 114 114 DbRows := TDbRows.Create; … … 116 116 PageMax := StrToInt(DbRows[0].ValuesAtIndex[0]); 117 117 DbRows.Free; 118 if GetCgiVar('page') = '' then Page := 0 else Page := StrToInt(GetCgiVar('page'));118 // if GetCgiVar('page') = '' then Page := 0 else Page := StrToInt(GetCgiVar('page')); 119 119 CategoryName := ''; 120 120 Result := Result + '<strong>Seznam aktualit kategorie ' + CategoryName + ':</strong><div style="font-size: small;">'; -
branches/web/URSS.pas
r139 r279 6 6 7 7 uses 8 Classes, SysUtils, pwmain,dateutils;8 Classes, SysUtils, dateutils; 9 9 10 10 type … … 56 56 with TRSSChannelItem(Items[I]) do begin 57 57 Result := Result + '<item>' + 58 '<title>' + FilterHTML(Title) + '</title>' +59 '<description>' + FilterHTML(Description) + '</description>' +58 //'<title>' + FilterHTML(Title) + '</title>' + 59 //'<description>' + FilterHTML(Description) + '</description>' + 60 60 '<pubDate>' + RFC2822TimeFormat(Time) + '</pubDate>' + 61 61 '<link>' + Link + '</link>' + -
branches/web/USqlDatabase.pas
r142 r279 1 1 unit USqlDatabase; 2 2 3 {$mode delphi}{$H+} 3 {$mode Delphi}{$H+} 4 // Upraveno: 16.12.2009 4 5 5 6 interface 6 7 7 8 uses 8 SysUtils, Classes, mysql50, TypInfo;9 SysUtils, Classes, Dialogs, mysql50, TypInfo; 9 10 10 11 type 12 EQueryError = Exception; 13 11 14 TClientCapabilities = (_CLIENT_LONG_PASSWORD, _CLIENT_FOUND_ROWS, 12 15 _CLIENT_LONG_FLAG, _CLIENT_CONNECT_WITH_DB, _CLIENT_NO_SCHEMA, … … 16 19 TSetClientCapabilities = set of TClientCapabilities; 17 20 18 TAssoc Array = class(TStringList)21 TAssociativeArray = class(TStringList) 19 22 private 20 23 function GetValues(Index: string): string; … … 32 35 TDbRows = class(TList) 33 36 private 34 function GetData(Index: Integer): TAssoc Array;35 procedure SetData(Index: Integer; const Value: TAssoc Array);37 function GetData(Index: Integer): TAssociativeArray; 38 procedure SetData(Index: Integer; const Value: TAssociativeArray); 36 39 public 37 property Data[Index: Integer]: TAssoc Array read GetData write SetData; default;40 property Data[Index: Integer]: TAssociativeArray read GetData write SetData; default; 38 41 destructor Destroy; override; 39 42 end; … … 44 47 FSession: PMYSQL; 45 48 FConnected: Boolean; 46 FOnError: TNotifyEvent;47 49 FDatabase: string; 48 50 function GetConnected: Boolean; … … 52 54 function GetCharset: string; 53 55 procedure SetDatabase(const Value: string); 54 { Private declarations }55 56 public 56 57 Hostname: string; 57 58 UserName: string; 58 59 Password: string; 60 Encoding: string; 59 61 Table: string; 60 62 RepeatLastAction: Boolean; … … 62 64 procedure CreateDatabase; 63 65 procedure CreateTable(Name: string); 64 procedure CreateColumn( ATable, ColumnName: string; ColumnType: TTypeKind);66 procedure CreateColumn(Table, ColumnName: string; ColumnType: TTypeKind); 65 67 function Query(Data: string): TDbRows; 66 68 function Select(ATable: string; Filter: string = '*'; Condition: string = '1'): TDbRows; 67 69 procedure Delete(ATable: string; Condition: string = '1'); 68 procedure Insert(ATable: string; Data: TAssoc Array);69 procedure Update(ATable: string; Data: TAssoc Array; Condition: string = '1');70 procedure Replace(ATable: string; Data: TAssoc Array);70 procedure Insert(ATable: string; Data: TAssociativeArray); 71 procedure Update(ATable: string; Data: TAssociativeArray; Condition: string = '1'); 72 procedure Replace(ATable: string; Data: TAssociativeArray); 71 73 procedure Connect; 72 74 procedure Disconnect; … … 75 77 property LastErrorNumber: Integer read GetLastErrorNumber; 76 78 property Connected: Boolean read GetConnected; 77 property OnError: TNotifyEvent read FOnError write FOnError;78 79 constructor Create; 79 80 destructor Destroy; override; … … 84 85 function MySQLFloatToStr(F: Real): string; 85 86 function MySQLStrToFloat(S: string): Real; 86 function MySQLDateToDateTime(Date: string): TDateTime;87 87 88 88 implementation … … 105 105 CLIENT_TRANSACTIONS = 8192; // Client knows about transactions 106 106 107 { TDataModule2 }108 109 function MySQLDateToDateTime(Date: string): TDateTime;110 begin111 Result := 0;112 end;113 114 107 function MySQLFloatToStr(F: Real): string; 115 108 var … … 117 110 begin 118 111 S := FloatToStr(F); 119 if Pos(',', S) > 0 then S[Pos(',',S)] := '.';112 if Pos(',', S) > 0 then S[Pos(',',S)] := '.'; 120 113 Result := S; 121 114 end; … … 123 116 function MySQLStrToFloat(S: string): Real; 124 117 begin 125 if Pos('.', S) > 0 then S[Pos('.',S)] := ',';118 if Pos('.', S) > 0 then S[Pos('.',S)] := ','; 126 119 Result := StrToFloat(S); 127 120 end; 121 122 { TSqlDatabase } 128 123 129 124 procedure TSqlDatabase.Connect; … … 143 138 end else FConnected := False; 144 139 CheckError; 145 Rows := Query('SET NAMES cp1250');140 Rows := Query('SET NAMES ' + Encoding); 146 141 Rows.Free; 147 142 end; 148 143 149 procedure TSqlDatabase.Insert(ATable: string; Data: TAssoc Array);144 procedure TSqlDatabase.Insert(ATable: string; Data: TAssociativeArray); 150 145 var 151 146 DbNames: string; … … 153 148 I: Integer; 154 149 Value: string; 155 DbR ows: TDbRows;150 DbResult: TDbRows; 156 151 begin 157 152 Table := ATable; 158 153 DbNames := ''; 159 154 DbValues := ''; 160 for I := 0 to Data.Count -1 do begin155 for I := 0 to Data.Count - 1 do begin 161 156 Value := Data.ValuesAtIndex[I]; 162 157 StringReplace(Value, '"', '\"', [rfReplaceAll]); … … 167 162 System.Delete(DbNames, 1, 1); 168 163 System.Delete(DbValues, 1, 1); 169 DbR ows:= Query('INSERT INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');170 DbR ows.Free;164 DbResult := Query('INSERT INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')'); 165 DbResult.Free; 171 166 end; 172 167 … … 176 171 DbResult: PMYSQL_RES; 177 172 DbRow: MYSQL_ROW; 178 type179 PMYSQL_ROW2 = ^TMYSQL_ROW2; // return data as array of strings180 TMYSQL_ROW2 = array[0..MaxInt div SizeOf(pChar) - 1] of pChar;181 173 begin 182 174 //DebugLog('SqlDatabase query: '+Data); … … 194 186 if Assigned(DbResult) then begin 195 187 Result.Count := mysql_num_rows(DbResult); 196 for I := 0 to Result.Count -1 do begin188 for I := 0 to Result.Count - 1 do begin 197 189 DbRow := mysql_fetch_row(DbResult); 198 Result[I] := TAssoc Array.Create;190 Result[I] := TAssociativeArray.Create; 199 191 with Result[I] do begin 200 for II := 0 to mysql_num_fields(DbResult)-1 do begin 201 Add(mysql_fetch_field_direct(DbResult, II)^.name + NameValueSeparator + PMYSQL_ROW2(DbRow)^[II]); 192 for II := 0 to mysql_num_fields(DbResult) - 1 do begin 193 Add(mysql_fetch_field_direct(DbResult, II)^.Name + 194 NameValueSeparator + PChar((DbRow + II)^)); 202 195 end; 203 196 end; … … 215 208 end; 216 209 217 procedure TSqlDatabase.Replace(ATable: string; Data: TAssoc Array);210 procedure TSqlDatabase.Replace(ATable: string; Data: TAssociativeArray); 218 211 var 219 212 DbNames: string; … … 221 214 Value: string; 222 215 I: Integer; 223 DbR ows: TDbRows;216 DbResult: TDbRows; 224 217 begin 225 218 Table := ATable; 226 219 DbNames := ''; 227 220 DbValues := ''; 228 for I := 0 to Data.Count -1 do begin221 for I := 0 to Data.Count - 1 do begin 229 222 Value := Data.ValuesAtIndex[I]; 230 223 StringReplace(Value, '"', '\"', [rfReplaceAll]); … … 235 228 System.Delete(DbNames, 1, 1); 236 229 System.Delete(DbValues, 1, 1); 237 DbR ows:= Query('REPLACE INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');238 DbR ows.Free;230 DbResult := Query('REPLACE INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')'); 231 DbResult.Free; 239 232 end; 240 233 … … 245 238 end; 246 239 247 procedure TSqlDatabase.Update(ATable: string; Data: TAssoc Array; Condition: string = '1');240 procedure TSqlDatabase.Update(ATable: string; Data: TAssociativeArray; Condition: string = '1'); 248 241 var 249 242 DbValues: string; 250 243 Value: string; 251 244 I: Integer; 252 DbR ows: TDbRows;245 DbResult: TDbRows; 253 246 begin 254 247 Table := ATable; 255 248 DbValues := ''; 256 for I := 0 to Data.Count -1 do begin249 for I := 0 to Data.Count - 1 do begin 257 250 Value := Data.ValuesAtIndex[I]; 258 251 StringReplace(Value, '"', '\"', [rfReplaceAll]); … … 261 254 end; 262 255 System.Delete(DbValues, 1, 1); 263 DbR ows:= Query('UPDATE `' + Table + '` SET (' + DbValues + ') WHERE ' + Condition);264 D BRows.Free;256 DbResult := Query('UPDATE `' + Table + '` SET (' + DbValues + ') WHERE ' + Condition); 257 DbResult.Free; 265 258 end; 266 259 … … 270 263 end; 271 264 272 { TAssocArray }273 274 procedure TAssocArray.AddKeyValue(Key, Value: string);275 begin276 Add(Key + NameValueSeparator + Value);277 end;278 279 constructor TAssocArray.Create;280 begin281 NameValueSeparator := '|';282 end;283 284 destructor TAssocArray.Destroy;285 begin286 inherited;287 end;288 289 function TAssocArray.GetAllValues: string;290 var291 I: Integer;292 begin293 Result := '';294 for I := 0 to Count-1 do begin295 Result := Result + Names[I] + '=' + ValuesAtIndex[I] + ',';296 end;297 end;298 299 function TAssocArray.GetValues(Index: string): string;300 begin301 Result := inherited Values[Index];302 end;303 304 function TAssocArray.GetValuesAtIndex(Index: Integer): string;305 begin306 Result := inherited Values[Names[Index]];307 end;308 309 265 procedure TSqlDatabase.Delete(ATable: string; Condition: string = '1'); 310 266 var 311 DbR ows: TDbRows;267 DbResult: TDbRows; 312 268 begin 313 269 Table := ATable; 314 DbR ows:= Query('DELETE FROM `' + Table + '` WHERE ' + Condition);315 DbR ows.Free;270 DbResult := Query('DELETE FROM `' + Table + '` WHERE ' + Condition); 271 DbResult.Free; 316 272 end; 317 273 … … 331 287 inherited; 332 288 FSession := nil; 333 end; 334 335 procedure TAssocArray.SetValues(Index: string; const Value: string); 336 begin 337 inherited Values[Index] := Value; 338 end; 339 340 { TDbRows } 341 342 destructor TDbRows.Destroy; 343 var 344 I: Integer; 345 begin 346 for I := 0 to Count - 1 do Data[I].Free; 347 inherited; 348 end; 349 350 function TDbRows.GetData(Index: Integer): TAssocArray; 351 begin 352 Result := Items[Index]; 353 end; 354 355 procedure TDbRows.SetData(Index: Integer; const Value: TAssocArray); 356 begin 357 Items[Index] := Value; 289 Encoding := 'utf8'; 358 290 end; 359 291 … … 376 308 begin 377 309 Result := LastErrorNumber <> 0; 378 if Result and Assigned(OnError) then OnError(Self); 310 if Result then 311 raise EQueryError.Create('Database query error: "' + LastErrorMessage + '"'); 379 312 end; 380 313 … … 394 327 begin 395 328 Query('CREATE TABLE `' + Name + '`' + 396 ' (` id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));');397 end; 398 399 procedure TSqlDatabase.CreateColumn( ATable, ColumnName: string;329 ' (`Id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`Id`));'); 330 end; 331 332 procedure TSqlDatabase.CreateColumn(Table, ColumnName: string; 400 333 ColumnType: TTypeKind); 401 334 const … … 423 356 end; 424 357 358 { TAssociativeArray } 359 360 procedure TAssociativeArray.AddKeyValue(Key, Value: string); 361 begin 362 Add(Key + NameValueSeparator + Value); 363 end; 364 365 constructor TAssociativeArray.Create; 366 begin 367 NameValueSeparator := '|'; 368 end; 369 370 destructor TAssociativeArray.Destroy; 371 begin 372 inherited; 373 end; 374 375 function TAssociativeArray.GetAllValues: string; 376 var 377 I: Integer; 378 begin 379 Result := ''; 380 for I := 0 to Count - 1 do begin 381 Result := Result + Names[I] + '=' + ValuesAtIndex[I] + ','; 382 end; 383 end; 384 385 function TAssociativeArray.GetValues(Index: string): string; 386 begin 387 Result := inherited Values[Index]; 388 end; 389 390 function TAssociativeArray.GetValuesAtIndex(Index: Integer): string; 391 begin 392 Result := inherited Values[Names[Index]]; 393 end; 394 395 procedure TAssociativeArray.SetValues(Index: string; const Value: string); 396 begin 397 inherited Values[Index] := Value; 398 end; 399 400 { TDbRows } 401 402 destructor TDbRows.Destroy; 403 var 404 I: Integer; 405 begin 406 for I := 0 to Count - 1 do 407 Data[I].Free; 408 inherited; 409 end; 410 411 function TDbRows.GetData(Index: Integer): TAssociativeArray; 412 begin 413 Result := Items[Index]; 414 end; 415 416 procedure TDbRows.SetData(Index: Integer; const Value: TAssociativeArray); 417 begin 418 Items[Index] := Value; 419 end; 420 425 421 end. 426 422 -
branches/web/UUser.pas
r158 r279 26 26 IC: Integer; 27 27 DIC: string; 28 procedure LoadFromDbRecord(DbRow: TAssoc Array);28 procedure LoadFromDbRecord(DbRow: TAssociativeArray); 29 29 procedure Store; 30 30 end; … … 41 41 { TUser } 42 42 43 procedure TUser.LoadFromDbRecord(DbRow: TAssoc Array);43 procedure TUser.LoadFromDbRecord(DbRow: TAssociativeArray); 44 44 begin 45 45 Id := StrToInt(DbRow.Values['id']); … … 54 54 procedure TUser.Store; 55 55 var 56 Values: TAssoc Array;56 Values: TAssociativeArray; 57 57 begin 58 Values := TAssoc Array.Create;58 Values := TAssociativeArray.Create; 59 59 Values.AddKeyValue('second_name', SecondName); 60 60 Values.AddKeyValue('first_name', FirstName); -
branches/web/index.lpi
r167 r279 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <PathDelim Value="/"/> 5 <Version Value="6"/> 4 <Version Value="7"/> 6 5 <General> 7 6 <Flags> … … 9 8 <MainUnitHasCreateFormStatements Value="False"/> 10 9 <MainUnitHasTitleStatement Value="False"/> 10 <LRSInOutputDirectory Value="False"/> 11 11 </Flags> 12 12 <MainUnit Value="0"/> 13 <IconPath Value="./"/>14 13 <TargetFileExt Value=".exe"/> 15 <ActiveEditorIndexAtStart Value=" 5"/>14 <ActiveEditorIndexAtStart Value="7"/> 16 15 </General> 17 16 <VersionInfo> 18 < ProjectVersion Value=""/>17 <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> 19 18 </VersionInfo> 20 19 <PublishOptions> … … 35 34 <IsPartOfProject Value="True"/> 36 35 <UnitName Value="Index"/> 37 <CursorPos X="29" Y="7"/> 38 <TopLine Value="1"/> 39 <EditorIndex Value="5"/> 40 <UsageCount Value="95"/> 41 <Loaded Value="True"/> 36 <CursorPos X="53" Y="22"/> 37 <TopLine Value="1"/> 38 <EditorIndex Value="7"/> 39 <UsageCount Value="96"/> 40 <Loaded Value="True"/> 41 <SyntaxHighlighter Value="Delphi"/> 42 42 </Unit0> 43 43 <Unit1> … … 47 47 <CursorPos X="80" Y="21"/> 48 48 <TopLine Value="1"/> 49 <UsageCount Value="95"/> 49 <UsageCount Value="96"/> 50 <SyntaxHighlighter Value="Delphi"/> 50 51 </Unit1> 51 52 <Unit2> … … 53 54 <IsPartOfProject Value="True"/> 54 55 <UnitName Value="USqlDatabase"/> 55 <CursorPos X=" 3" Y="111"/>56 <TopLine Value=" 1"/>56 <CursorPos X="46" Y="338"/> 57 <TopLine Value="319"/> 57 58 <EditorIndex Value="0"/> 58 <UsageCount Value="95"/> 59 <Loaded Value="True"/> 59 <UsageCount Value="96"/> 60 <Loaded Value="True"/> 61 <SyntaxHighlighter Value="Delphi"/> 60 62 </Unit2> 61 63 <Unit3> 62 64 <Filename Value="UXmlClasses.pas"/> 63 65 <IsPartOfProject Value="True"/> 64 <UsageCount Value="95"/> 66 <UsageCount Value="96"/> 67 <SyntaxHighlighter Value="Delphi"/> 65 68 </Unit3> 66 69 <Unit4> … … 68 71 <IsPartOfProject Value="True"/> 69 72 <UnitName Value="UCore"/> 70 <CursorPos X="48" Y="104"/> 71 <TopLine Value="76"/> 72 <EditorIndex Value="7"/> 73 <UsageCount Value="95"/> 74 <Loaded Value="True"/> 73 <CursorPos X="5" Y="56"/> 74 <TopLine Value="37"/> 75 <EditorIndex Value="9"/> 76 <UsageCount Value="96"/> 77 <Loaded Value="True"/> 78 <SyntaxHighlighter Value="Delphi"/> 75 79 </Unit4> 76 80 <Unit5> … … 78 82 <IsPartOfProject Value="True"/> 79 83 <UnitName Value="UFinance"/> 80 <CursorPos X="1" Y="1"/> 81 <TopLine Value="81"/> 82 <UsageCount Value="95"/> 84 <CursorPos X="5" Y="236"/> 85 <TopLine Value="217"/> 86 <EditorIndex Value="11"/> 87 <UsageCount Value="96"/> 88 <Loaded Value="True"/> 89 <SyntaxHighlighter Value="Delphi"/> 83 90 </Unit5> 84 91 <Unit6> … … 86 93 <IsPartOfProject Value="True"/> 87 94 <UnitName Value="UFinancePage"/> 88 <CursorPos X="42" Y="101"/> 89 <TopLine Value="75"/> 90 <EditorIndex Value="8"/> 91 <UsageCount Value="95"/> 92 <Loaded Value="True"/> 95 <CursorPos X="34" Y="26"/> 96 <TopLine Value="6"/> 97 <EditorIndex Value="10"/> 98 <UsageCount Value="96"/> 99 <Loaded Value="True"/> 100 <SyntaxHighlighter Value="Delphi"/> 93 101 </Unit6> 94 102 <Unit7> … … 98 106 <CursorPos X="34" Y="30"/> 99 107 <TopLine Value="17"/> 100 <UsageCount Value="95"/> 108 <UsageCount Value="96"/> 109 <SyntaxHighlighter Value="Delphi"/> 101 110 </Unit7> 102 111 <Unit8> … … 104 113 <IsPartOfProject Value="True"/> 105 114 <UnitName Value="UNews"/> 106 <CursorPos X="1" Y="16"/> 107 <TopLine Value="12"/> 108 <UsageCount Value="95"/> 115 <CursorPos X="25" Y="195"/> 116 <TopLine Value="176"/> 117 <EditorIndex Value="2"/> 118 <UsageCount Value="96"/> 119 <Loaded Value="True"/> 120 <SyntaxHighlighter Value="Delphi"/> 109 121 </Unit8> 110 122 <Unit9> … … 112 124 <IsPartOfProject Value="True"/> 113 125 <UnitName Value="UNewsPage"/> 114 <CursorPos X="28" Y="149"/> 115 <TopLine Value="106"/> 116 <EditorIndex Value="6"/> 117 <UsageCount Value="95"/> 118 <Loaded Value="True"/> 126 <CursorPos X="102" Y="121"/> 127 <TopLine Value="102"/> 128 <EditorIndex Value="8"/> 129 <UsageCount Value="96"/> 130 <Loaded Value="True"/> 131 <SyntaxHighlighter Value="Delphi"/> 119 132 </Unit9> 120 133 <Unit10> 121 <Filename Value=" ../../../../../../../usr/share/fpcsrc/rtl/unix/sysutils.pp"/>134 <Filename Value="/usr/share/fpcsrc/rtl/unix/sysutils.pp"/> 122 135 <UnitName Value="sysutils"/> 123 136 <CursorPos X="10" Y="94"/> … … 126 139 </Unit10> 127 140 <Unit11> 128 <Filename Value=" ../../../../../../../usr/share/fpcsrc/rtl/objpas/sysutils/sysutils.inc"/>141 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/sysutils.inc"/> 129 142 <CursorPos X="26" Y="17"/> 130 143 <TopLine Value="121"/> … … 132 145 </Unit11> 133 146 <Unit12> 134 <Filename Value=" ../../../../../../../usr/share/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/>147 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/> 135 148 <CursorPos X="4" Y="33"/> 136 149 <TopLine Value="18"/> … … 148 161 <IsPartOfProject Value="True"/> 149 162 <UnitName Value="URSS"/> 150 <CursorPos X="56" Y="16"/> 151 <TopLine Value="1"/> 152 <UsageCount Value="83"/> 163 <CursorPos X="9" Y="59"/> 164 <TopLine Value="40"/> 165 <EditorIndex Value="3"/> 166 <UsageCount Value="84"/> 167 <Loaded Value="True"/> 168 <SyntaxHighlighter Value="Delphi"/> 153 169 </Unit14> 154 170 <Unit15> 155 <Filename Value=" ../../../../../../../usr/share/fpcsrc/rtl/objpas/sysutils/datih.inc"/>171 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/datih.inc"/> 156 172 <CursorPos X="10" Y="117"/> 157 173 <TopLine Value="115"/> … … 159 175 </Unit15> 160 176 <Unit16> 161 <Filename Value=" ../../../../../../../usr/share/fpcsrc/rtl/objpas/dateutil.inc"/>177 <Filename Value="/usr/share/fpcsrc/rtl/objpas/dateutil.inc"/> 162 178 <CursorPos X="3" Y="624"/> 163 179 <TopLine Value="34"/> … … 170 186 <CursorPos X="3" Y="14"/> 171 187 <TopLine Value="1"/> 172 <EditorIndex Value="9"/> 173 <UsageCount Value="70"/> 174 <Loaded Value="True"/> 188 <UsageCount Value="71"/> 189 <SyntaxHighlighter Value="Delphi"/> 175 190 </Unit17> 176 191 <Unit18> … … 179 194 <CursorPos X="1" Y="134"/> 180 195 <TopLine Value="108"/> 181 <UsageCount Value="7 0"/>196 <UsageCount Value="71"/> 182 197 <SyntaxHighlighter Value="None"/> 183 198 </Unit18> … … 187 202 <CursorPos X="1" Y="1"/> 188 203 <TopLine Value="1"/> 189 <UsageCount Value="7 0"/>204 <UsageCount Value="71"/> 190 205 <SyntaxHighlighter Value="JScript"/> 191 206 </Unit19> … … 194 209 <IsPartOfProject Value="True"/> 195 210 <UnitName Value="UDatabase"/> 196 <CursorPos X=" 17" Y="1129"/>197 <TopLine Value=" 1107"/>211 <CursorPos X="44" Y="627"/> 212 <TopLine Value="608"/> 198 213 <EditorIndex Value="1"/> 199 <UsageCount Value="64"/> 200 <Loaded Value="True"/> 214 <UsageCount Value="65"/> 215 <Loaded Value="True"/> 216 <SyntaxHighlighter Value="Delphi"/> 201 217 </Unit20> 202 218 <Unit21> … … 204 220 <IsPartOfProject Value="True"/> 205 221 <UnitName Value="UUser"/> 206 <CursorPos X="31" Y="36"/> 207 <TopLine Value="14"/> 208 <EditorIndex Value="3"/> 209 <UsageCount Value="64"/> 210 <Loaded Value="True"/> 222 <CursorPos X="25" Y="58"/> 223 <TopLine Value="39"/> 224 <EditorIndex Value="5"/> 225 <UsageCount Value="65"/> 226 <Loaded Value="True"/> 227 <SyntaxHighlighter Value="Delphi"/> 211 228 </Unit21> 212 229 <Unit22> … … 216 233 <CursorPos X="69" Y="19"/> 217 234 <TopLine Value="1"/> 218 <EditorIndex Value="2"/> 219 <UsageCount Value="60"/> 220 <Loaded Value="True"/> 235 <EditorIndex Value="4"/> 236 <UsageCount Value="61"/> 237 <Loaded Value="True"/> 238 <SyntaxHighlighter Value="Delphi"/> 221 239 </Unit22> 222 240 <Unit23> … … 224 242 <IsPartOfProject Value="True"/> 225 243 <UnitName Value="UBill"/> 226 <CursorPos X="36" Y="60"/> 227 <TopLine Value="34"/> 228 <EditorIndex Value="4"/> 229 <UsageCount Value="57"/> 230 <Loaded Value="True"/> 244 <CursorPos X="52" Y="8"/> 245 <TopLine Value="1"/> 246 <EditorIndex Value="6"/> 247 <UsageCount Value="58"/> 248 <Loaded Value="True"/> 249 <SyntaxHighlighter Value="Delphi"/> 231 250 </Unit23> 232 251 <Unit24> 233 <Filename Value=" ../../../../../../../usr/share/fpcsrc/packages/fv/src/dialogs.pas"/>252 <Filename Value="/usr/share/fpcsrc/packages/fv/src/dialogs.pas"/> 234 253 <UnitName Value="Dialogs"/> 235 254 <CursorPos X="19" Y="4"/> … … 240 259 <JumpHistory Count="30" HistoryIndex="29"> 241 260 <Position1> 242 <Filename Value="U Bill.pas"/>243 <Caret Line="1 46" Column="51" TopLine="136"/>261 <Filename Value="UFinance.pas"/> 262 <Caret Line="198" Column="3" TopLine="179"/> 244 263 </Position1> 245 264 <Position2> 246 <Filename Value="U Bill.pas"/>247 <Caret Line="2 8" Column="24" TopLine="3"/>265 <Filename Value="UFinance.pas"/> 266 <Caret Line="208" Column="3" TopLine="189"/> 248 267 </Position2> 249 268 <Position3> 250 <Filename Value="U Bill.pas"/>251 <Caret Line=" 25" Column="21" TopLine="6"/>269 <Filename Value="UNewsPage.pas"/> 270 <Caret Line="149" Column="28" TopLine="106"/> 252 271 </Position3> 253 272 <Position4> 254 <Filename Value="U Bill.pas"/>255 <Caret Line=" 37" Column="17" TopLine="28"/>273 <Filename Value="UNewsPage.pas"/> 274 <Caret Line="14" Column="34" TopLine="1"/> 256 275 </Position4> 257 276 <Position5> 258 <Filename Value="U Bill.pas"/>259 <Caret Line=" 33" Column="16" TopLine="19"/>277 <Filename Value="UNewsPage.pas"/> 278 <Caret Line="25" Column="5" TopLine="6"/> 260 279 </Position5> 261 280 <Position6> 262 <Filename Value="U Bill.pas"/>263 <Caret Line=" 66" Column="3" TopLine="48"/>281 <Filename Value="UNewsPage.pas"/> 282 <Caret Line="27" Column="7" TopLine="8"/> 264 283 </Position6> 265 284 <Position7> 266 <Filename Value="U Bill.pas"/>267 <Caret Line=" 78" Column="3" TopLine="60"/>285 <Filename Value="UNewsPage.pas"/> 286 <Caret Line="69" Column="5" TopLine="50"/> 268 287 </Position7> 269 288 <Position8> 270 <Filename Value="U Bill.pas"/>271 <Caret Line="1 37" Column="7" TopLine="105"/>289 <Filename Value="UNewsPage.pas"/> 290 <Caret Line="112" Column="3" TopLine="93"/> 272 291 </Position8> 273 292 <Position9> 274 <Filename Value="U Bill.pas"/>275 <Caret Line=" 151" Column="1" TopLine="124"/>293 <Filename Value="UUser.pas"/> 294 <Caret Line="36" Column="31" TopLine="14"/> 276 295 </Position9> 277 296 <Position10> 278 <Filename Value="U FinancePage.pas"/>279 <Caret Line=" 9" Column="50" TopLine="1"/>297 <Filename Value="UUser.pas"/> 298 <Caret Line="28" Column="51" TopLine="8"/> 280 299 </Position10> 281 300 <Position11> 282 <Filename Value="U FinancePage.pas"/>283 <Caret Line=" 8" Column="1" TopLine="1"/>301 <Filename Value="UUser.pas"/> 302 <Caret Line="43" Column="53" TopLine="24"/> 284 303 </Position11> 285 304 <Position12> 286 <Filename Value="U FinancePage.pas"/>287 <Caret Line=" 14" Column="3" TopLine="1"/>305 <Filename Value="UUser.pas"/> 306 <Caret Line="56" Column="23" TopLine="37"/> 288 307 </Position12> 289 308 <Position13> 290 <Filename Value="U FinancePage.pas"/>291 <Caret Line=" 16" Column="3" TopLine="14"/>309 <Filename Value="UBill.pas"/> 310 <Caret Line="60" Column="36" TopLine="34"/> 292 311 </Position13> 293 312 <Position14> 294 <Filename Value="U FinancePage.pas"/>295 <Caret Line="1 17" Column="10" TopLine="90"/>313 <Filename Value="UBill.pas"/> 314 <Caret Line="155" Column="21" TopLine="135"/> 296 315 </Position14> 297 316 <Position15> 298 <Filename Value="U FinancePage.pas"/>299 <Caret Line="1 23" Column="45" TopLine="91"/>317 <Filename Value="UBill.pas"/> 318 <Caret Line="157" Column="23" TopLine="138"/> 300 319 </Position15> 301 320 <Position16> 302 <Filename Value="U FinancePage.pas"/>303 <Caret Line=" 12" Column="1" TopLine="8"/>321 <Filename Value="UBill.pas"/> 322 <Caret Line="315" Column="21" TopLine="287"/> 304 323 </Position16> 305 324 <Position17> 306 <Filename Value=" UFinancePage.pas"/>307 <Caret Line=" 116" Column="34" TopLine="96"/>325 <Filename Value="index.pas"/> 326 <Caret Line="6" Column="45" TopLine="1"/> 308 327 </Position17> 309 328 <Position18> 310 <Filename Value=" UFinancePage.pas"/>311 <Caret Line="1 18" Column="45" TopLine="96"/>329 <Filename Value="index.pas"/> 330 <Caret Line="14" Column="3" TopLine="1"/> 312 331 </Position18> 313 332 <Position19> 314 <Filename Value=" UFinancePage.pas"/>315 <Caret Line=" 8" Column="21" TopLine="1"/>333 <Filename Value="index.pas"/> 334 <Caret Line="15" Column="5" TopLine="1"/> 316 335 </Position19> 317 336 <Position20> 318 <Filename Value=" UFinancePage.pas"/>319 <Caret Line=" 17" Column="17" TopLine="1"/>337 <Filename Value="index.pas"/> 338 <Caret Line="21" Column="3" TopLine="1"/> 320 339 </Position20> 321 340 <Position21> 322 <Filename Value="U FinancePage.pas"/>323 <Caret Line=" 122" Column="10" TopLine="95"/>341 <Filename Value="UBill.pas"/> 342 <Caret Line="317" Column="23" TopLine="287"/> 324 343 </Position21> 325 344 <Position22> 326 <Filename Value="U Database.pas"/>327 <Caret Line=" 1164" Column="10" TopLine="1129"/>345 <Filename Value="UBill.pas"/> 346 <Caret Line="8" Column="52" TopLine="1"/> 328 347 </Position22> 329 348 <Position23> 330 <Filename Value=" index.pas"/>331 <Caret Line=" 14" Column="16" TopLine="1"/>349 <Filename Value="UBill.pas"/> 350 <Caret Line="25" Column="29" TopLine="1"/> 332 351 </Position23> 333 352 <Position24> 334 <Filename Value="U UserPage.pas"/>335 <Caret Line=" 6" Column="31" TopLine="1"/>353 <Filename Value="UBill.pas"/> 354 <Caret Line="314" Column="1" TopLine="286"/> 336 355 </Position24> 337 356 <Position25> 338 <Filename Value="U User.pas"/>339 <Caret Line=" 29" Column="21" TopLine="1"/>357 <Filename Value="UBill.pas"/> 358 <Caret Line="168" Column="16" TopLine="149"/> 340 359 </Position25> 341 360 <Position26> 342 <Filename Value="U Database.pas"/>343 <Caret Line=" 442" Column="35" TopLine="434"/>361 <Filename Value="UNewsPage.pas"/> 362 <Caret Line="118" Column="3" TopLine="99"/> 344 363 </Position26> 345 364 <Position27> 346 <Filename Value="U Database.pas"/>347 <Caret Line=" 1132" Column="25" TopLine="1110"/>365 <Filename Value="USqlDatabase.pas"/> 366 <Caret Line="308" Column="13" TopLine="70"/> 348 367 </Position27> 349 368 <Position28> 350 <Filename Value="U Database.pas"/>351 <Caret Line="1 131" Column="7" TopLine="1109"/>369 <Filename Value="UBill.pas"/> 370 <Caret Line="177" Column="16" TopLine="161"/> 352 371 </Position28> 353 372 <Position29> 354 373 <Filename Value="UBill.pas"/> 355 <Caret Line=" 75" Column="26" TopLine="39"/>374 <Caret Line="314" Column="3" TopLine="286"/> 356 375 </Position29> 357 376 <Position30> 358 377 <Filename Value="UBill.pas"/> 359 <Caret Line="1 0" Column="15" TopLine="1"/>378 <Caret Line="168" Column="16" TopLine="149"/> 360 379 </Position30> 361 380 </JumpHistory> … … 363 382 <CompilerOptions> 364 383 <Version Value="8"/> 365 <Target>366 <Filename Value="index.cgi"/>367 </Target>368 384 <SearchPaths> 369 <OtherUnitFiles Value="/var/www/html/other/powtils/extras/;/var/www/html/other/powtils/main/"/> 385 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/"/> 386 <UnitOutputDirectory Value="bin"/> 370 387 <LCLWidgetType Value="gtk2"/> 371 388 </SearchPaths> 372 389 <Parsing> 373 390 <SyntaxOptions> 391 <SyntaxMode Value="Delphi"/> 374 392 <CStyleOperator Value="False"/> 393 <AllowLabel Value="False"/> 394 <CPPInline Value="False"/> 375 395 </SyntaxOptions> 376 396 </Parsing> … … 387 407 <Verbosity> 388 408 <ShoLineNum Value="True"/> 409 <ShowDebugInfo Value="True"/> 389 410 </Verbosity> 411 <WriteFPCLogo Value="False"/> 390 412 <CompilerPath Value="$(CompPath)"/> 391 413 </Other> -
branches/web/index.pas
r142 r279 4 4 5 5 uses 6 UCore, USqlDatabase, SysUtils, UMainPage, pwinit, pwmain,6 UCore, USqlDatabase, SysUtils, UMainPage, 7 7 UFinancePage, UNewsPage, UUserPage, UBill; 8 8 … … 12 12 PageName: string; 13 13 begin 14 SetHeader('Content-Type', 'text/html; charset=utf-8');15 PageName := GetCgiVar('p');14 // SetHeader('Content-Type', 'text/html; charset=utf-8'); 15 //PageName := GetCgiVar('p'); 16 16 if PageName = '' then PageName := 'index'; 17 17 I := 0; … … 19 19 if I < Length(Pages) then Output := Pages[I].Producer 20 20 else Output := 'Stránka nenalezena'; 21 WebWriteLn(FormatOutput(Output));21 // WebWriteLn(FormatOutput(Output)); 22 22 end.
Note:
See TracChangeset
for help on using the changeset viewer.