Changeset 169 for www


Ignore:
Timestamp:
Mar 24, 2009, 2:15:00 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Generování informací pro test sítě SunriseChatu.
  • Opraveno: Ukládání IP adresy posledního přihlášení.
Location:
www
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • www/sql/full.sql

    r144 r169  
    11-- phpMyAdmin SQL Dump
    2 -- version 3.1.2
     2-- version 3.1.3
    33-- http://www.phpmyadmin.net
    44--
    55-- Počítač: localhost
    6 -- Vygenerováno: Neděle 01. února 2009, 18:35
    7 -- Verze MySQL: 5.0.67
     6-- Vygenerováno: Úterý 24. března 2009, 13:43
     7-- Verze MySQL: 5.0.51
    88-- Verze PHP: 5.2.6
    99
     
    2222CREATE TABLE IF NOT EXISTS `ChatHistory` (
    2323  `Id` int(11) NOT NULL auto_increment,
    24   `Nick` varchar(64) NOT NULL,
     24  `Nick` varchar(64) NOT NULL default '',
    2525  `Text` text NOT NULL,
    2626  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
    2727  `Color` int(11) NOT NULL default '0',
    28   `RoomName` varchar(32) NOT NULL,
     28  `RoomName` varchar(32) NOT NULL default '',
    2929  `RoomType` int(11) NOT NULL default '0',
    30   `Host` varchar(255) NOT NULL,
    31   PRIMARY KEY  (`Id`)
    32 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=524350 ;
    33 
    34 -- --------------------------------------------------------
    35 
    36 --
    37 -- Struktura tabulky `FinanceAdvances`
    38 --
    39 
    40 CREATE TABLE IF NOT EXISTS `FinanceAdvances` (
    41   `Id` int(11) NOT NULL auto_increment,
    42   `Direction` enum('In','Out') collate utf8_czech_ci NOT NULL,
    43   `Subject` int(11) NOT NULL,
    44   `Value` float NOT NULL,
    45   `TimeCreation` datetime NOT NULL,
    46   `TimePass` datetime NOT NULL,
    47   `CashFlowId` int(11) NOT NULL,
    48   PRIMARY KEY  (`Id`)
    49 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=322 ;
     30  `Host` varchar(255) NOT NULL default '',
     31  PRIMARY KEY  (`Id`)
     32) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=528576 ;
     33
     34-- --------------------------------------------------------
     35
     36--
     37-- Struktura tabulky `DocumentLine`
     38--
     39
     40CREATE TABLE IF NOT EXISTS `DocumentLine` (
     41  `Id` int(11) NOT NULL auto_increment,
     42  `Name` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
     43  `Shortcut` varchar(16) character set utf8 collate utf8_czech_ci NOT NULL,
     44  `NextNumber` int(11) NOT NULL,
     45  PRIMARY KEY  (`Id`),
     46  UNIQUE KEY `Shortcut` (`Shortcut`)
     47) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
     48
     49-- --------------------------------------------------------
     50
     51--
     52-- Struktura tabulky `FinanceAdvances_old`
     53--
     54
     55CREATE TABLE IF NOT EXISTS `FinanceAdvances_old` (
     56  `Id` int(11) NOT NULL auto_increment,
     57  `Direction` enum('In','Out') collate utf8_czech_ci NOT NULL default 'In',
     58  `Subject` int(11) NOT NULL default '0',
     59  `Value` float NOT NULL default '0',
     60  `TimeCreation` datetime NOT NULL default '0000-00-00 00:00:00',
     61  `TimePass` datetime NOT NULL default '0000-00-00 00:00:00',
     62  `CashFlowId` int(11) NOT NULL default '0',
     63  PRIMARY KEY  (`Id`)
     64) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1466 ;
    5065
    5166-- --------------------------------------------------------
     
    5671
    5772CREATE TABLE IF NOT EXISTS `FinanceAssetsHistory` (
    58   `AssetsId` int(11) NOT NULL,
    59   `Time` datetime NOT NULL,
    60   `Text` varchar(255) collate utf8_czech_ci NOT NULL,
    61   `User` int(11) NOT NULL,
     73  `AssetsId` int(11) NOT NULL default '0',
     74  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
     75  `Text` varchar(255) collate utf8_czech_ci NOT NULL default '',
     76  `User` int(11) NOT NULL default '0',
    6277  KEY `AssetsId` (`AssetsId`)
    6378) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     
    6681
    6782--
    68 -- Struktura tabulky `FinanceCashFlow`
    69 --
    70 
    71 CREATE TABLE IF NOT EXISTS `FinanceCashFlow` (
    72   `Id` int(11) NOT NULL auto_increment,
    73   `Subject` int(11) NOT NULL,
    74   `Text` varchar(255) collate utf8_czech_ci NOT NULL,
     83-- Struktura tabulky `FinanceBills`
     84--
     85
     86CREATE TABLE IF NOT EXISTS `FinanceBills` (
     87  `Id` int(11) NOT NULL auto_increment,
     88  `TimeFrom` datetime NOT NULL default '0000-00-00 00:00:00',
     89  `Subject` int(11) NOT NULL default '0',
     90  `TimeTo` datetime NOT NULL default '0000-00-00 00:00:00',
     91  `TimeCreate` datetime NOT NULL default '0000-00-00 00:00:00',
     92  `TimeDue` datetime NOT NULL default '0000-00-00 00:00:00',
     93  `BillCode` varchar(32) collate latin2_czech_cs NOT NULL,
     94  `Type` enum('invoice','income') collate latin2_czech_cs NOT NULL,
     95  PRIMARY KEY  (`Id`)
     96) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=1707 ;
     97
     98-- --------------------------------------------------------
     99
     100--
     101-- Struktura tabulky `FinanceBillsItems`
     102--
     103
     104CREATE TABLE IF NOT EXISTS `FinanceBillsItems` (
     105  `Id` int(11) NOT NULL auto_increment,
     106  `Bill` int(11) NOT NULL default '0',
     107  `Description` varchar(255) collate latin2_czech_cs NOT NULL,
     108  `Price` float NOT NULL default '0',
     109  `Quantity` float NOT NULL default '1',
     110  PRIMARY KEY  (`Id`)
     111) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=13248 ;
     112
     113-- --------------------------------------------------------
     114
     115--
     116-- Struktura tabulky `FinanceCashFlow_old`
     117--
     118
     119CREATE TABLE IF NOT EXISTS `FinanceCashFlow_old` (
     120  `Id` int(11) NOT NULL auto_increment,
     121  `BillCode` varchar(16) collate utf8_czech_ci NOT NULL,
     122  `Subject` int(11) NOT NULL default '0',
     123  `Text` varchar(255) collate utf8_czech_ci NOT NULL default '',
     124  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
     125  `Taxable` tinyint(1) NOT NULL default '0',
     126  `Cash` tinyint(1) NOT NULL default '0',
     127  `Value` float NOT NULL default '0',
     128  `Bill` int(11) NOT NULL default '0',
     129  PRIMARY KEY  (`Id`)
     130) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=434 ;
     131
     132-- --------------------------------------------------------
     133
     134--
     135-- Struktura tabulky `FinanceClaimsLiabilities`
     136--
     137
     138CREATE TABLE IF NOT EXISTS `FinanceClaimsLiabilities` (
     139  `Id` int(11) NOT NULL auto_increment,
     140  `BillCode` varchar(16) collate utf8_czech_ci NOT NULL,
     141  `Subject` int(11) NOT NULL default '0',
     142  `TimeCreation` datetime NOT NULL default '0000-00-00 00:00:00',
     143  `TimeDue` datetime NOT NULL default '0000-00-00 00:00:00',
     144  `TimePayment` datetime NOT NULL default '0000-00-00 00:00:00',
     145  `Value` float NOT NULL default '0',
     146  `Bill` int(11) NOT NULL default '0',
     147  `Text` varchar(255) collate utf8_czech_ci NOT NULL default '',
     148  PRIMARY KEY  (`Id`)
     149) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4182 ;
     150
     151-- --------------------------------------------------------
     152
     153--
     154-- Struktura tabulky `FinanceLog`
     155--
     156
     157CREATE TABLE IF NOT EXISTS `FinanceLog` (
     158  `Id` int(11) NOT NULL auto_increment,
     159  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
     160  `Text` varchar(255) collate utf8_czech_ci NOT NULL default '',
     161  PRIMARY KEY  (`Id`)
     162) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     163
     164-- --------------------------------------------------------
     165
     166--
     167-- Struktura tabulky `FinanceOperation`
     168--
     169
     170CREATE TABLE IF NOT EXISTS `FinanceOperation` (
     171  `Id` int(11) NOT NULL auto_increment,
    75172  `Time` datetime NOT NULL,
     173  `Subject` int(11) NOT NULL default '0',
     174  `Cash` int(11) NOT NULL default '0',
     175  `Value` float NOT NULL,
     176  `BillCode` varchar(32) collate utf8_czech_ci NOT NULL,
    76177  `Taxable` tinyint(1) NOT NULL,
    77   `Cash` tinyint(1) NOT NULL,
    78   `Value` float NOT NULL,
    79   `Bill` int(11) NOT NULL,
    80   PRIMARY KEY  (`Id`)
    81 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=112 ;
    82 
    83 -- --------------------------------------------------------
    84 
    85 --
    86 -- Struktura tabulky `FinanceClaimsLiabilities`
    87 --
    88 
    89 CREATE TABLE IF NOT EXISTS `FinanceClaimsLiabilities` (
    90   `Id` int(11) NOT NULL auto_increment,
    91   `Subject` int(11) NOT NULL,
    92   `TimeCreation` datetime NOT NULL,
    93   `TimeDue` datetime NOT NULL,
    94   `TimePayment` datetime NOT NULL,
    95   `Value` float NOT NULL,
    96178  `Bill` int(11) NOT NULL,
    97179  `Text` varchar(255) collate utf8_czech_ci NOT NULL,
    98   PRIMARY KEY  (`Id`)
    99 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=258 ;
    100 
    101 -- --------------------------------------------------------
    102 
    103 --
    104 -- Struktura tabulky `FinanceLog`
    105 --
    106 
    107 CREATE TABLE IF NOT EXISTS `FinanceLog` (
    108   `Id` int(11) NOT NULL auto_increment,
    109   `Time` datetime NOT NULL,
    110   `Text` varchar(255) collate utf8_czech_ci NOT NULL,
     180  `Network` int(11) NOT NULL default '1',
     181  PRIMARY KEY  (`Id`)
     182) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4205 ;
     183
     184-- --------------------------------------------------------
     185
     186--
     187-- Struktura tabulky `FinanceSmallAssets`
     188--
     189
     190CREATE TABLE IF NOT EXISTS `FinanceSmallAssets` (
     191  `Id` int(11) NOT NULL auto_increment,
     192  `Text` varchar(255) collate utf8_czech_ci NOT NULL default '',
     193  `PricePurchase` float NOT NULL default '0',
     194  `TimeEnlistment` datetime NOT NULL default '0000-00-00 00:00:00',
     195  `TimeElimination` datetime NOT NULL default '0000-00-00 00:00:00',
     196  `SupplySubject` int(11) NOT NULL default '0',
     197  `DeviceId` varchar(128) collate utf8_czech_ci NOT NULL default '',
    111198  PRIMARY KEY  (`Id`)
    112199) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
    113 
    114 -- --------------------------------------------------------
    115 
    116 --
    117 -- Struktura tabulky `FinanceSmallAssets`
    118 --
    119 
    120 CREATE TABLE IF NOT EXISTS `FinanceSmallAssets` (
    121   `Id` int(11) NOT NULL auto_increment,
    122   `Text` varchar(255) collate utf8_czech_ci NOT NULL,
    123   `PricePurchase` float NOT NULL,
    124   `TimeEnlistment` datetime NOT NULL,
    125   `TimeElimination` datetime NOT NULL,
    126   `SupplySubject` int(11) NOT NULL,
    127   `DeviceId` varchar(128) collate utf8_czech_ci NOT NULL,
    128   PRIMARY KEY  (`Id`)
    129 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
    130 
    131 -- --------------------------------------------------------
    132 
    133 --
    134 -- Struktura tabulky `finance_bills`
    135 --
    136 
    137 CREATE TABLE IF NOT EXISTS `finance_bills` (
    138   `id` int(11) NOT NULL auto_increment,
    139   `time_from` datetime NOT NULL default '0000-00-00 00:00:00',
    140   `user_id` int(11) NOT NULL default '0',
    141   `pdf` mediumblob NOT NULL,
    142   `time_to` datetime NOT NULL default '0000-00-00 00:00:00',
    143   `time_create` datetime NOT NULL default '0000-00-00 00:00:00',
    144   `time_due` datetime NOT NULL default '0000-00-00 00:00:00',
    145   PRIMARY KEY  (`id`)
    146 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=336 ;
    147 
    148 -- --------------------------------------------------------
    149 
    150 --
    151 -- Struktura tabulky `finance_bills_items`
    152 --
    153 
    154 CREATE TABLE IF NOT EXISTS `finance_bills_items` (
    155   `id` int(11) NOT NULL auto_increment,
    156   `bill_id` int(11) NOT NULL default '0',
    157   `description` varchar(255) collate latin2_czech_cs NOT NULL default '',
    158   `price` float NOT NULL default '0',
    159   `quantity` float NOT NULL default '1',
    160   PRIMARY KEY  (`id`)
    161 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=3861 ;
    162200
    163201-- --------------------------------------------------------
     
    208246  `BaseTariffPrice` int(11) NOT NULL default '0',
    209247  `TopTariffPrice` int(11) NOT NULL default '0',
    210   `member_count` int(11) NOT NULL,
    211   PRIMARY KEY  (`id`)
    212 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=64 ;
     248  `member_count` int(11) NOT NULL default '0',
     249  `investment` int(11) NOT NULL,
     250  PRIMARY KEY  (`id`)
     251) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=75 ;
    213252
    214253-- --------------------------------------------------------
     
    227266  `bill_id` int(11) NOT NULL default '0',
    228267  `group` int(11) NOT NULL default '1',
    229   `Taxable` int(11) NOT NULL,
     268  `cash` int(11) NOT NULL default '0',
    230269  `BillCode` varchar(16) collate latin2_czech_cs NOT NULL,
     270  `Network` int(11) NOT NULL default '1',
     271  `Taxable` int(11) NOT NULL default '1',
    231272  `Invoice` int(11) NOT NULL,
    232   `cash` int(11) NOT NULL,
    233   PRIMARY KEY  (`id`)
    234 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=2565 ;
     273  `Source` int(11) NOT NULL,
     274  `Destination` int(11) NOT NULL,
     275  PRIMARY KEY  (`id`)
     276) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=4158 ;
    235277
    236278-- --------------------------------------------------------
     
    279321  `used` int(11) NOT NULL default '1',
    280322  PRIMARY KEY  (`id`)
    281 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=260 ;
     323) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=347 ;
    282324
    283325-- --------------------------------------------------------
     
    354396
    355397CREATE TABLE IF NOT EXISTS `Log` (
    356   `Time` datetime NOT NULL,
    357   `User` int(11) NOT NULL,
    358   `Module` varchar(64) collate utf8_czech_ci NOT NULL,
    359   `Operation` varchar(255) collate utf8_czech_ci NOT NULL,
    360   `Value` varchar(255) collate utf8_czech_ci NOT NULL,
     398  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
     399  `User` int(11) NOT NULL default '0',
     400  `Module` varchar(64) collate utf8_czech_ci NOT NULL default '',
     401  `Operation` varchar(255) collate utf8_czech_ci NOT NULL default '',
     402  `Value` varchar(255) collate utf8_czech_ci NOT NULL default '',
    361403  KEY `Time` (`Time`)
    362404) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     
    370412CREATE TABLE IF NOT EXISTS `Meals` (
    371413  `Date` date NOT NULL default '0000-00-00',
    372   `Soup` varchar(255) NOT NULL,
    373   `Meal` varchar(255) NOT NULL,
     414  `Soup` varchar(255) collate utf8_czech_ci NOT NULL,
     415  `Meal` varchar(255) collate utf8_czech_ci NOT NULL,
    374416  `Status` int(11) NOT NULL default '0',
    375417  UNIQUE KEY `date` (`Date`)
    376 ) ENGINE=MyISAM DEFAULT CHARSET=latin2;
     418) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
    377419
    378420-- --------------------------------------------------------
     
    383425
    384426CREATE TABLE IF NOT EXISTS `MealsInfo` (
    385   `Info` text NOT NULL,
     427  `Info` text collate utf8_czech_ci NOT NULL,
    386428  `Price` int(11) NOT NULL default '0'
    387 ) ENGINE=MyISAM DEFAULT CHARSET=latin2;
     429) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
     430
     431-- --------------------------------------------------------
     432
     433--
     434-- Struktura tabulky `Member`
     435--
     436
     437CREATE TABLE IF NOT EXISTS `Member` (
     438  `Id` int(11) NOT NULL auto_increment,
     439  `Subject` int(11) NOT NULL,
     440  `ResponsibleUser` int(11) NOT NULL,
     441  `FamilyMemberCount` int(11) NOT NULL,
     442  `MembershipDate` date NOT NULL,
     443  `MemberState` int(11) NOT NULL,
     444  `InternetTariffCurrentMonth` int(11) NOT NULL,
     445  `InternetTariffNextMonth` int(11) NOT NULL,
     446  `GPS` int(11) NOT NULL,
     447  `BillingPeriod` enum('never','monthly','quarterly','half-yearly','yearly') collate utf8_czech_ci NOT NULL default 'monthly',
     448  `NetworkSegment` int(11) NOT NULL,
     449  PRIMARY KEY  (`Id`)
     450) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=98 ;
     451
     452-- --------------------------------------------------------
     453
     454--
     455-- Struktura tabulky `MemberPayment`
     456--
     457
     458CREATE TABLE IF NOT EXISTS `MemberPayment` (
     459  `Id` int(11) NOT NULL auto_increment,
     460  `Member` int(11) NOT NULL,
     461  `MonthlyTotal` float NOT NULL,
     462  `MonthlyInternet` float NOT NULL,
     463  `MonthlyConsumption` float NOT NULL,
     464  `NetworkDevice` float NOT NULL,
     465  `MonthlyPlus` float NOT NULL,
     466  `Cash` float NOT NULL,
     467  PRIMARY KEY  (`Id`)
     468) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=83 ;
    388469
    389470-- --------------------------------------------------------
     
    395476CREATE TABLE IF NOT EXISTS `NetworkDeviceHistory` (
    396477  `Id` int(11) NOT NULL auto_increment,
    397   `Device` int(11) NOT NULL,
    398   `Time` datetime NOT NULL,
    399   `Action` int(11) NOT NULL,
    400   `Notice` varchar(255) collate utf8_czech_ci NOT NULL,
     478  `Device` int(11) NOT NULL default '0',
     479  `Time` datetime NOT NULL default '0000-00-00 00:00:00',
     480  `Action` int(11) NOT NULL default '0',
     481  `Notice` varchar(255) collate utf8_czech_ci NOT NULL default '',
    401482  PRIMARY KEY  (`Id`)
    402483) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     484
     485-- --------------------------------------------------------
     486
     487--
     488-- Struktura tabulky `NetworkSubnet`
     489--
     490
     491CREATE TABLE IF NOT EXISTS `NetworkSubnet` (
     492  `Id` int(11) NOT NULL auto_increment,
     493  `AddressRange` varchar(255) collate utf8_czech_ci NOT NULL,
     494  `Mask` int(11) NOT NULL,
     495  `DHCP` varchar(255) collate utf8_czech_ci NOT NULL,
     496  `Gateway` varchar(255) collate utf8_czech_ci NOT NULL,
     497  `WINS` varchar(255) collate utf8_czech_ci NOT NULL,
     498  `DNS` varchar(255) collate utf8_czech_ci NOT NULL,
     499  `Domain` varchar(255) collate utf8_czech_ci NOT NULL,
     500  `NTP` varchar(255) collate utf8_czech_ci NOT NULL,
     501  PRIMARY KEY  (`Id`)
     502) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;
    403503
    404504-- --------------------------------------------------------
     
    423523  `shop` varchar(64) NOT NULL default '',
    424524  `deprecated_price` int(11) NOT NULL default '0',
    425   `TimeEnlistment` datetime NOT NULL,
    426   `TimeElimination` datetime NOT NULL,
    427   PRIMARY KEY  (`id`)
    428 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=161 ;
     525  `TimeEnlistment` datetime NOT NULL default '0000-00-00 00:00:00',
     526  `TimeElimination` datetime NOT NULL default '0000-00-00 00:00:00',
     527  `StockCard` int(11) NOT NULL,
     528  PRIMARY KEY  (`id`)
     529) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=160 ;
    429530
    430531-- --------------------------------------------------------
     
    475576CREATE TABLE IF NOT EXISTS `news` (
    476577  `id` int(11) NOT NULL auto_increment,
    477   `title` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
    478   `content` text character set utf8 collate utf8_czech_ci NOT NULL,
     578  `title` varchar(255) collate utf8_czech_ci NOT NULL default '',
     579  `content` text collate utf8_czech_ci NOT NULL,
    479580  `date` datetime NOT NULL default '0000-00-00 00:00:00',
    480581  `target_date` datetime NOT NULL default '0000-00-00 00:00:00',
    481   `author` varchar(32) character set utf8 collate utf8_czech_ci NOT NULL,
    482   `ip` varchar(16) character set utf8 collate utf8_czech_ci NOT NULL,
     582  `author` varchar(32) collate utf8_czech_ci NOT NULL default 'Anonym',
     583  `ip` varchar(16) collate utf8_czech_ci NOT NULL default '',
    483584  `category` int(11) NOT NULL default '0',
    484   `enclosure` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
    485   `User` int(11) NOT NULL,
    486   PRIMARY KEY  (`id`)
    487 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=1444 ;
     585  `enclosure` varchar(255) collate utf8_czech_ci NOT NULL default '',
     586  `User` int(11) NOT NULL default '0',
     587  PRIMARY KEY  (`id`),
     588  KEY `category` (`category`),
     589  KEY `date` (`date`)
     590) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=30854 ;
    488591
    489592-- --------------------------------------------------------
     
    495598CREATE TABLE IF NOT EXISTS `news_category` (
    496599  `id` int(11) NOT NULL auto_increment,
    497   `caption` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
     600  `caption` varchar(255) NOT NULL default '',
    498601  `permission` int(11) NOT NULL default '0',
    499602  PRIMARY KEY  (`id`)
     
    508611CREATE TABLE IF NOT EXISTS `PermissionGroup` (
    509612  `Id` int(11) NOT NULL auto_increment,
    510   `Description` varchar(255) collate utf8_czech_ci NOT NULL,
     613  `Description` varchar(255) collate utf8_czech_ci NOT NULL default '',
    511614  PRIMARY KEY  (`Id`)
    512615) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;
     
    519622
    520623CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` (
    521   `Group` int(11) NOT NULL,
    522   `GroupOrOperation` int(11) NOT NULL,
    523   `Type` enum('Group','Operation') collate utf8_czech_ci NOT NULL
     624  `Group` int(11) NOT NULL default '0',
     625  `GroupOrOperation` int(11) NOT NULL default '0',
     626  `Type` enum('Group','Operation') collate utf8_czech_ci NOT NULL default 'Group'
    524627) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
    525628
     
    532635CREATE TABLE IF NOT EXISTS `PermissionOperation` (
    533636  `Id` int(11) NOT NULL auto_increment,
    534   `Module` varchar(64) collate utf8_czech_ci NOT NULL,
    535   `Operation` varchar(128) collate utf8_czech_ci NOT NULL,
    536   `Item` varchar(64) collate utf8_czech_ci NOT NULL,
     637  `Module` varchar(64) collate utf8_czech_ci NOT NULL default '',
     638  `Operation` varchar(128) collate utf8_czech_ci NOT NULL default '',
     639  `Item` varchar(64) collate utf8_czech_ci NOT NULL default '',
    537640  `ItemId` int(11) NOT NULL default '0',
    538641  PRIMARY KEY  (`Id`)
    539 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=28 ;
     642) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=37 ;
    540643
    541644-- --------------------------------------------------------
     
    546649
    547650CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` (
    548   `User` int(11) NOT NULL,
    549   `GroupOrOperation` int(11) NOT NULL,
    550   `Type` enum('Group','Operation') collate utf8_czech_ci NOT NULL
     651  `User` int(11) NOT NULL default '0',
     652  `GroupOrOperation` int(11) NOT NULL default '0',
     653  `Type` enum('Group','Operation') collate utf8_czech_ci NOT NULL default 'Group'
    551654) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
    552655
     
    565668  `last_time` datetime NOT NULL default '0000-00-00 00:00:00',
    566669  PRIMARY KEY  (`id`)
    567 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
     670) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
    568671
    569672-- --------------------------------------------------------
     
    584687
    585688--
     689-- Struktura tabulky `StockCard`
     690--
     691
     692CREATE TABLE IF NOT EXISTS `StockCard` (
     693  `Id` int(11) NOT NULL auto_increment,
     694  `Name` varchar(255) NOT NULL,
     695  `SellPrice` float NOT NULL,
     696  `Consumption` int(11) NOT NULL COMMENT 'In Watts',
     697  PRIMARY KEY  (`Id`)
     698) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
     699
     700-- --------------------------------------------------------
     701
     702--
    586703-- Struktura tabulky `Subject`
    587704--
     
    589706CREATE TABLE IF NOT EXISTS `Subject` (
    590707  `Id` int(11) NOT NULL auto_increment,
    591   `Name` varchar(64) collate utf8_czech_ci NOT NULL,
    592   `AddressStreet` varchar(64) collate utf8_czech_ci NOT NULL,
    593   `AddressTown` varchar(64) collate utf8_czech_ci NOT NULL,
    594   `AddressPSC` int(11) NOT NULL,
    595   `IC` int(11) NOT NULL,
    596   `DIC` varchar(32) collate utf8_czech_ci NOT NULL,
    597   `FamilyMemberCount` int(11) NOT NULL,
    598   `MapPositionX` float NOT NULL,
    599   `MapPositionY` float NOT NULL,
    600   `NetworkSegment` int(11) NOT NULL,
    601   `InternetTariffCurrentMonth` int(11) NOT NULL,
    602   `InternetTariffNextMonth` int(11) NOT NULL,
    603   `MembershipDate` date NOT NULL,
    604   PRIMARY KEY  (`Id`)
    605 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=75 ;
     708  `Name` varchar(64) collate utf8_czech_ci NOT NULL default '',
     709  `AddressStreet` varchar(64) collate utf8_czech_ci NOT NULL default '',
     710  `AddressTown` varchar(64) collate utf8_czech_ci NOT NULL default '',
     711  `AddressPSC` int(11) NOT NULL default '0',
     712  `IC` int(11) NOT NULL default '0',
     713  `DIC` varchar(32) collate utf8_czech_ci NOT NULL default '',
     714  `MapPositionX` float NOT NULL default '0',
     715  `MapPositionY` float NOT NULL default '0',
     716  `WWW` varchar(255) collate utf8_czech_ci NOT NULL,
     717  PRIMARY KEY  (`Id`)
     718) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=105 ;
    606719
    607720-- --------------------------------------------------------
     
    612725
    613726CREATE TABLE IF NOT EXISTS `SubjectOpenTime` (
    614   `Subject` int(11) NOT NULL,
    615   `UpdateTime` datetime NOT NULL,
    616   `Notice` varchar(255) collate utf8_czech_ci NOT NULL,
     727  `Subject` int(11) NOT NULL default '0',
     728  `UpdateTime` datetime NOT NULL default '0000-00-00 00:00:00',
     729  `Notice` varchar(255) collate utf8_czech_ci NOT NULL default '',
    617730  PRIMARY KEY  (`Subject`)
    618731) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     
    626739CREATE TABLE IF NOT EXISTS `SubjectOpenTimeInterval` (
    627740  `Id` int(11) NOT NULL auto_increment,
    628   `Subject` int(11) NOT NULL,
    629   `OpenTime` datetime NOT NULL,
    630   `CloseTime` datetime NOT NULL,
    631   PRIMARY KEY  (`Id`)
    632 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=51 ;
     741  `Subject` int(11) NOT NULL default '0',
     742  `DayOfWeek` int(11) NOT NULL default '0',
     743  `OpenTime` datetime NOT NULL default '0000-00-00 00:00:00',
     744  `CloseTime` datetime NOT NULL default '0000-00-00 00:00:00',
     745  PRIMARY KEY  (`Id`)
     746) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=50 ;
     747
     748-- --------------------------------------------------------
     749
     750--
     751-- Struktura tabulky `sunrisechat_history`
     752--
     753
     754CREATE TABLE IF NOT EXISTS `sunrisechat_history` (
     755  `id` int(11) NOT NULL auto_increment,
     756  `nick` varchar(64) NOT NULL default '',
     757  `text` text NOT NULL,
     758  `time` datetime NOT NULL default '0000-00-00 00:00:00',
     759  `color` int(11) NOT NULL default '0',
     760  `roomname` varchar(32) NOT NULL default '',
     761  `roomtype` int(11) NOT NULL default '0',
     762  PRIMARY KEY  (`id`)
     763) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=528523 ;
    633764
    634765-- --------------------------------------------------------
     
    650781  `info` varchar(255) character set latin2 NOT NULL default '',
    651782  PRIMARY KEY  (`id`)
    652 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=65950 ;
     783) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=78758 ;
     784
     785-- --------------------------------------------------------
     786
     787--
     788-- Struktura tabulky `test`
     789--
     790
     791CREATE TABLE IF NOT EXISTS `test` (
     792  `text` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL
     793) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    653794
    654795-- --------------------------------------------------------
     
    672813
    673814--
    674 -- Struktura tabulky `TrafficShaping`
    675 --
    676 
    677 CREATE TABLE IF NOT EXISTS `TrafficShaping` (
    678   `Id` int(11) NOT NULL auto_increment,
    679   `Host` int(11) NOT NULL,
    680   `Download` int(11) NOT NULL,
    681   `Upload` int(11) NOT NULL,
    682   PRIMARY KEY  (`Id`)
    683 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
    684 
    685 -- --------------------------------------------------------
    686 
    687 --
    688815-- Struktura tabulky `User`
    689816--
     
    691818CREATE TABLE IF NOT EXISTS `User` (
    692819  `Id` int(11) NOT NULL auto_increment,
    693   `Name` varchar(64) collate utf8_czech_ci NOT NULL,
    694   `FirstName` varchar(128) collate utf8_czech_ci NOT NULL,
    695   `SecondName` varchar(128) collate utf8_czech_ci NOT NULL,
    696   `Nick` varchar(128) collate utf8_czech_ci NOT NULL,
    697   `Password` varchar(255) collate utf8_czech_ci NOT NULL,
    698   `Email` varchar(128) collate utf8_czech_ci NOT NULL,
    699   `LastIpAddress` varchar(16) collate utf8_czech_ci NOT NULL,
    700   `LastLoginTime` datetime NOT NULL,
    701   `RegistrationTime` datetime NOT NULL,
    702   `Subject` int(11) NOT NULL,
    703   `Locked` tinyint(1) NOT NULL default '0',
    704   `PhoneNumber` varchar(32) collate utf8_czech_ci NOT NULL,
    705   `ICQ` int(11) NOT NULL,
    706   PRIMARY KEY  (`Id`),
    707   UNIQUE KEY `Name` (`Name`)
    708 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=73 ;
     820  `Name` varchar(64) collate utf8_czech_ci NOT NULL default '',
     821  `FirstName` varchar(128) collate utf8_czech_ci NOT NULL default '',
     822  `SecondName` varchar(128) collate utf8_czech_ci NOT NULL default '',
     823  `Nick` varchar(128) collate utf8_czech_ci NOT NULL default '',
     824  `Password` text collate utf8_czech_ci NOT NULL,
     825  `Email` varchar(128) collate utf8_czech_ci NOT NULL default '',
     826  `LastIpAddress` varchar(16) collate utf8_czech_ci NOT NULL default '',
     827  `LastLoginTime` datetime NOT NULL default '0000-00-00 00:00:00',
     828  `RegistrationTime` datetime NOT NULL default '0000-00-00 00:00:00',
     829  `Member` int(11) NOT NULL,
     830  `Locked` tinyint(1) NOT NULL default '1',
     831  `ICQ` int(11) NOT NULL default '0',
     832  `PhoneNumber` varchar(32) collate utf8_czech_ci NOT NULL default '',
     833  `InitPassword` varchar(255) collate utf8_czech_ci NOT NULL,
     834  PRIMARY KEY  (`Id`)
     835) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=99 ;
    709836
    710837-- --------------------------------------------------------
     
    716843CREATE TABLE IF NOT EXISTS `UserOnline` (
    717844  `Id` int(11) NOT NULL auto_increment,
    718   `User` int(11) NOT NULL,
    719   `LoginTime` datetime NOT NULL,
    720   `ActivityTime` datetime NOT NULL,
    721   `SessionId` varchar(255) collate utf8_czech_ci NOT NULL,
    722   `IpAddress` varchar(16) collate utf8_czech_ci NOT NULL,
    723   `HostName` varchar(255) collate utf8_czech_ci NOT NULL,
     845  `User` int(11) NOT NULL default '0',
     846  `ActivityTime` datetime NOT NULL default '0000-00-00 00:00:00',
     847  `LoginTime` datetime NOT NULL default '0000-00-00 00:00:00',
     848  `SessionId` varchar(255) collate utf8_czech_ci NOT NULL default '',
     849  `IpAddress` varchar(16) collate utf8_czech_ci NOT NULL default '',
     850  `HostName` varchar(255) collate utf8_czech_ci NOT NULL default '',
     851  `ScriptName` varchar(255) collate utf8_czech_ci NOT NULL,
    724852  PRIMARY KEY  (`Id`),
    725853  KEY `User` (`User`)
    726 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
    727 
    728 -- --------------------------------------------------------
    729 
    730 --
    731 -- Struktura tabulky `users`
    732 --
    733 
    734 CREATE TABLE IF NOT EXISTS `users` (
     854) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2 ;
     855
     856-- --------------------------------------------------------
     857
     858--
     859-- Struktura tabulky `users_old`
     860--
     861
     862CREATE TABLE IF NOT EXISTS `users_old` (
    735863  `id` int(11) NOT NULL auto_increment,
    736864  `first_name` varchar(64) character set latin2 collate latin2_czech_cs NOT NULL default '',
     
    761889  `inet_tarif_next` int(11) NOT NULL default '2',
    762890  `monthly_inet` int(11) NOT NULL default '0',
    763   `subject_name` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
     891  `subject_name` varchar(128) character set utf8 collate utf8_czech_ci NOT NULL default '',
    764892  `street` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL default '',
    765893  `town` varchar(64) character set utf8 collate utf8_czech_ci NOT NULL default '',
    766894  `psc` int(11) NOT NULL default '0',
    767895  `ico` int(11) NOT NULL default '0',
    768   `dic` varchar(32) NOT NULL,
    769   `User` int(11) NOT NULL,
     896  `dic` varchar(32) NOT NULL default '',
     897  `BillingPeriod` enum('never','monthly','quarterly','half-yearly','yearly') NOT NULL default 'monthly',
    770898  PRIMARY KEY  (`id`),
    771899  UNIQUE KEY `nick` (`nick`)
    772 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=72 ;
     900) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=98 ;
     901
     902-- --------------------------------------------------------
     903
     904--
     905-- Struktura tabulky `users_online`
     906--
     907
     908CREATE TABLE IF NOT EXISTS `users_online` (
     909  `id` int(11) NOT NULL auto_increment,
     910  `user` int(11) NOT NULL default '0',
     911  `time` int(11) NOT NULL default '0',
     912  `session` varchar(128) character set latin2 NOT NULL default '',
     913  `ip` varchar(64) character set latin2 NOT NULL default '',
     914  PRIMARY KEY  (`id`)
     915) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=282 ;
    773916
    774917-- --------------------------------------------------------
  • www/sunrisechat/network.php

    r8 r169  
    11<?php
    22
    3 include_once('../global.php');
    4 include_once('code.php');
     3include('../global.php');
    54
    6 $User = array(0 => array('fullname' => ''));
    7 $DbResult = $Database->select('users', '*,CONCAT(second_name, " ",first_name) as fullname');
     5$User = array(0 => array('Fullname' => ''));
     6$DbResult = $Database->select('User', '*, CONCAT(SecondName, " ", FirstName) as Fullname');
    87while($Row = $DbResult->fetch_array())
    98{
    10   $User[$Row['id']] = $Row;
     9  $User[$Row['Id']] = $Row;
    1110}
    1211
     
    1413while($Row = $DbResult->fetch_array())
    1514{
    16   $Row = $Row['id'].':'.$Row['parent'].':'.$Row['name'].':'.$Row['IP'].':'.$User[$Row['user']]['fullname'].':'.$Row['block']."\n";
    17   $Row = StrTr($Row, "\xA9\xAB\xAE\xB9\xBB\xBE", "\x8A\x8D\x8E\x9A\x9D\x9E");
     15  $Row = $Row['id'].':'.$Row['parent'].':'.$Row['name'].':'.$Row['IP'].':'.trim($User[$Row['user']]['Fullname']).':'.$Row['block']."\n";
     16  $Row = FromUTF8($Row, 'win1250');
    1817  echo($Row);
    1918}
  • www/user.php

    r168 r169  
    1616define('BAD_PASSWORD', 'Špatné heslo.');
    1717define('USER_NOT_FOUND', 'Uživatel nenalezen.');
    18 define('USER_TIMEOUT', 300);  // in seconds
    1918define('USER_PASSWORD_RECOVERY_SUCCESS', 'Přihlašovací údaje byly odeslány na zadanou emailovou adresu.');
    2019define('USER_PASSWORD_RECOVERY_FAIL', 'Podle zadaných údajů nebyl nalezen žádný uživatel.');
     
    3231  var $User = array();
    3332  var $DefaultRole = 2;
    34   var $AnonymousUserId = 96;
     33  var $AnonymousUserId = 98;
     34  var $OnlineStateTimeout = 600; // in seconds
    3535
    3636  function Check()
     
    6262
    6363    // Remove nonactive users
    64     $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)');
     64    $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)');
    6565    while($DbRow = $DbResult->fetch_array())
    6666    {
     
    134134      else
    135135      {
    136         $this->Database->update('User', 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()'));           
     136        $this->Database->update('User', 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()', 'LastIpAddress' => GetRemoteAddress()));           
    137137        $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $Row['Id']));
    138138        // načtení stavu stromu
Note: See TracChangeset for help on using the changeset viewer.