Changeset 452
- Timestamp:
- Oct 28, 2012, 10:20:32 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r442 r452 213 213 global $Config, $Database, $System, $ScriptTimeStart, $ConfigFileName, $Mail, $Type; 214 214 215 date_default_timezone_set('Europe/Prague'); 215 216 $ScriptTimeStart = GetMicrotime(); 216 217 // SQL injection hack protection -
trunk/aktuality/news.php
r440 r452 22 22 { 23 23 $I = strpos($Content, 'http://'); 24 if(($I > 0) and ($Content{$I - 1} != '"')) 24 if((($I == 0)) or 25 (($I > 0) and ($Content{$I - 1} != '"'))) 25 26 { 26 27 $Result .= substr($Content, 0, $I); 27 28 $Content = substr($Content, $I); 28 if(strpos($Content, ' ') !== false) 29 $URL = substr($Content, 0, strpos($Content, ' ')); 30 else $URL = substr($Content, 0); 31 if(strpos($Content, '<') !== false) 32 $URL = substr($Content, 0, strpos($Content, '<')); 33 else $URL = substr($Content, 0); 29 $URL = $Content; 30 if(strpos($URL, '<') !== false) $URL = substr($URL, 0, strpos($URL, '<')); 31 if(strpos($URL, ' ') !== false) $URL = substr($URL, 0, strpos($URL, ' ')); 34 32 $Result .= '<a href="'.$URL.'">'.$URL.'</a>'; 35 33 $Content = substr($Content, strlen($URL)); -
trunk/finance/spotreba.php
r438 r452 16 16 $CelkovaSpotreba = 0; 17 17 $DbResult = $this->Database->query('SELECT * FROM NetworkSegment'); 18 while($Segment = $DbResult->fetch_a rray())18 while($Segment = $DbResult->fetch_assoc()) 19 19 { 20 $DbResult2 = $this->Database->query('SELECT SUM( Consumption) FROM Product WHERE Segment='.$Segment['Id'].' AND Used=1');21 $Row2 = $DbResult2->fetch_a rray();22 $CelkovaSpotreba = $CelkovaSpotreba + $Row2[ 0];23 $Output .= '<tr><td>'.$Segment['Name'].'</td><td align="right">'.$Row2[ 0].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2[0]).'</td></tr>';20 $DbResult2 = $this->Database->query('SELECT SUM(Product.Consumption) AS Consumption FROM StockItem JOIN Product ON Product.Id = StockItem.Product WHERE (StockItem.Segment='.$Segment['Id'].') AND (StockItem.TimeElimination IS NULL)'); 21 $Row2 = $DbResult2->fetch_assoc(); 22 $CelkovaSpotreba = $CelkovaSpotreba + $Row2['Consumption']; 23 $Output .= '<tr><td>'.$Segment['Name'].'</td><td align="right">'.$Row2['Consumption'].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2['Consumption']).'</td></tr>'; 24 24 } 25 25 $Output .= '<tr style="font-weight: Bold;"><td><strong>Celkem</strong></td><td align="right">'.$CelkovaSpotreba.'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($CelkovaSpotreba).'</td></tr>'; -
trunk/finance/tarify.php
r438 r452 62 62 63 63 $Output .= '<br />Tarif na další období si lze nastavit po přihlášení do systému pomocí nastavení domácnosti přes pravé užifatelské menu.<br />'; 64 $Output .= '<a href="http:// centrala.zdechov.net/forum/viewtopic.php?t=50">Diskuse</a><br />';64 $Output .= '<a href="http://forum.zdechov.net/viewtopic.php?t=50">Diskuse</a><br />'; 65 65 return($Output); 66 66 } -
trunk/finance/zarizeni.php
r438 r452 11 11 { 12 12 // Seznam segmentů a zařízení 13 $Price = 0; 13 14 $Output = 'Seznam segmentů a zařízení:<br><table style="font-size: smaller;" class="WideTable"><tr><th>Název</th><th>Spotřeba<br>[W]</th><th>Datum<br>zakoupení</th><th>Cena [Kč]</th></tr>'; 14 15 $DbResult = $this->Database->query('SELECT * FROM NetworkSegment'); 15 while($Segment = $DbResult->fetch_a rray())16 while($Segment = $DbResult->fetch_assoc()) 16 17 { 17 18 $Output .= '<tr><td style="text-align: left" colspan="3"><strong>Segment: '.$Segment['Name'].' ('.$Segment['Users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Segment['Price'].'</td></tr>'; 18 $DbResult2 = $this->Database->query('SELECT * FROM Product WHERE Segment='.$Segment['Id'].' AND used=1'); 19 while($Row = $DbResult2->fetch_array()) 19 $DbResult2 = $this->Database->query('SELECT Product.Consumption AS Consumption, Product.Name AS Name, '. 20 'StockItem.BuyPrice AS Price, StockItem.TimeEnlistment AS Date '. 21 'FROM StockItem JOIN Product ON Product.Id = StockItem.Product WHERE (StockItem.Segment='.$Segment['Id'].') AND (StockItem.TimeElimination IS NULL)'); 22 while($Row = $DbResult2->fetch_assoc()) 20 23 { 21 $Output .= '<tr><td style="text-align: left; padding-left: 20px;">'.$Row['Name'].'</td><td align="right">'.$Row['Consumption'].'</td><td align="right">'.HumanDate($Row['Date']).'</td><td align="right">'.$Row['Price'].'</td></tr>'; 24 $Output .= '<tr><td style="text-align: left; padding-left: 20px;">'. 25 $Row['Name'].'</td><td align="right">'.$Row['Consumption'].'</td><td align="right">'. 26 HumanDate($Row['Date']).'</td><td align="right">'.$Row['Price'].'</td></tr>'; 22 27 } 28 $Price = $Price + $Row['Price']; 23 29 } 24 $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used=1'); 25 $Row = $DbResult->fetch_array(); 26 $Output .= '<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>'; 30 $Output .= '<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'. 31 $Price.'</strong></td></tr>'; 27 32 $Output .= '</table>'; 28 33 return($Output); -
trunk/form_classes.php
r451 r452 76 76 'TimeCreate' => array('Type' => 'Date', 'Caption' => 'Datum zadání', 'Default' => ''), 77 77 'TimeDue' => array('Type' => 'Date', 'Caption' => 'Termín', 'Default' => ''), 78 'TimeClose' => array('Type' => 'Date', 'Caption' => 'Datum uzavření', 'Default' => '' ),78 'TimeClose' => array('Type' => 'Date', 'Caption' => 'Datum uzavření', 'Default' => '', 'Null' => true), 79 79 'Priority' => array('Type' => 'TPriority', 'Caption' => 'Důležitost', 'Default' => '0'), 80 80 'Conclusion' => array('Type' => 'Text', 'Caption' => 'Vyhodnocení', 'Default' => ''), -
trunk/sql/updates/446.sql
r451 r452 1 ALTER TABLE SystemVersion CHANGE COLUMN Rev44 1 Rev445bit;1 ALTER TABLE SystemVersion CHANGE COLUMN Rev445 Rev446 bit; 2 2 3 3 RENAME TABLE `Product` TO `ProductOld` ; … … 13 13 `Product` int(11) NOT NULL, 14 14 `TimeEnlistment` date NOT NULL, 15 `TimeElimination` date NOT NULL, 16 `Amount` float NOT NULL, 15 `TimeElimination` date NULL, 16 `BuyPrice` DECIMAL NOT NULL, 17 `SellPrice` DECIMAL NOT NULL, 17 18 `SerialNumber` varchar(255) COLLATE utf8_czech_ci NOT NULL, 18 19 `Location` int(11) DEFAULT NULL COMMENT 'Member', 19 `Segment` int(11) NOT NULL, 20 `Segment` int(11) NULL, 21 `Info` TEXT NOT NULL, 20 22 PRIMARY KEY (`Id`), 21 KEY `Location` (`Location`),22 23 KEY `Product` (`Product`), 23 24 KEY `Stock` (`Stock`), 24 KEY `Segment` (`Segment`) 25 KEY `Segment` (`Segment`), 26 KEY `Location` (`Location`) 25 27 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ; 26 28 … … 30 32 ADD CONSTRAINT `StockItem_ibfk_3` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`), 31 33 ADD CONSTRAINT `StockItem_ibfk_5` FOREIGN KEY (`Product`) REFERENCES `Product` (`Id`); 32 ALTER TABLE `StockItem` CHANGE `Segment` `Segment` INT( 11 ) NULL;33 ALTER TABLE `StockItem` ADD `Info` TEXT NOT NULL ;34 ALTER TABLE `StockItem` CHANGE `TimeElimination` `TimeElimination` DATE NULL;35 34 36 ALTER TABLE `Stock` ADD `Location` INT NULL , ADD INDEX ( `Location` );35 ALTER TABLE `Stock` ADD `Location` INT NULL ; 37 36 ALTER TABLE `Stock` ADD FOREIGN KEY ( `Location` ) REFERENCES `Member` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 38 39 40 41 37 42 38 … … 46 42 PRIMARY KEY (`Id`) 47 43 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; 44 45 INSERT INTO `Language` (`Id`, `Name`) VALUES 46 (1, 'Česky'), 47 (2, 'Slovensky'), 48 (3, 'Anglicky'), 49 (4, 'Německy'), 50 (5, 'Slovensky'), 51 (6, 'Polsky'); 52 48 53 49 54 UPDATE `TV` SET Language=1 WHERE Language="česky"; … … 55 60 ALTER TABLE `TV` CHANGE `Language` `Language` INT( 11 ) NULL ; 56 61 UPDATE `TV` SET Language=NULL WHERE Language=0; 57 ALTER TABLE `TV` ADD INDEX ( `Language` );58 ALTER TABLE `TV` DROP INDEX ( `ShortName_2` );62 ALTER TABLE `TV` ADD INDEX `Language` ; 63 ALTER TABLE `TV` DROP INDEX `ShortName_2` ; 59 64 ALTER TABLE `TV` ADD FOREIGN KEY ( `Language` ) REFERENCES `Language` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 60 65 … … 84 89 ALTER TABLE `TV` ADD INDEX ( `Category` ); 85 90 ALTER TABLE `TV` ADD FOREIGN KEY ( `Category` ) REFERENCES `TVGroup` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 91 92 TRUNCATE TABLE `ISMenuItem`; 93 INSERT INTO `ISMenuItem` (`Id`, `Name`, `Parent`, `Table`) VALUES 94 (1, 'Síť', NULL, ''), 95 (2, 'Finance', NULL, ''), 96 (12, 'Obecné', NULL, ''), 97 (23, 'Systém', NULL, ''), 98 (27, 'Sklad', NULL, ''), 99 (3, 'Zařízení', 1, 'NetworkDevice'), 100 (4, 'Rozhraní', 1, 'NetworkInterface'), 101 (5, 'Příjmy a výdaje', 2, 'FinanceOperation'), 102 (6, 'Závazky a pohledávky', 2, 'FinanceClaimsLiabilities'), 103 (7, 'Typ zařízení', 1, 'NetworkDeviceType'), 104 (8, 'Typ rozhraní', 1, 'NetworkInterfaceType'), 105 (9, 'Doménové aliasy', 1, 'NetworkDomainAlias'), 106 (10, 'Bankovní účty', 2, 'FinanceBankAccount'), 107 (11, 'Pokladny', 2, 'FinanceTreasury'), 108 (13, 'Uživatelé', 12, 'User'), 109 (14, 'Subjekty', 12, 'Subject'), 110 (15, 'Země', 12, 'Country'), 111 (16, 'Produkty', 27, 'Product'), 112 (17, 'Sklady', 27, 'Stock'), 113 (18, 'Platební období', 2, 'FinanceBillingPeriod'), 114 (19, 'Tarify', 2, 'FinanceTariff'), 115 (20, 'Zákazníci', 2, 'Member'), 116 (22, 'Podsítě', 1, 'NetworkSubnet'), 117 (24, 'Záznamy', 23, 'Log'), 118 (25, 'Úkoly', 12, 'Task'), 119 (26, 'Kategorie úkolů', 12, 'TaskGroup'), 120 (28, 'Měrné jednotky', 27, 'UnitOfMeasure'), 121 (29, 'Skladové položky', 27, 'StockItem'), 122 (30, 'TV kanály', 12, 'TV'), 123 (31, 'Jazyky', 12, 'Language'), 124 (32, 'Kategorie TV kanálů', 12, 'TVGroup'), 125 (33, 'Účetní roky', 2, 'FinanceYear'), 126 (34, 'Dokladové řady', 2, 'DocumentLine'), 127 (35, 'Čísleník dokladové řady', 2, 'DocumentLineSequence'); -
trunk/temp/product.php
r451 r452 12 12 echo($DbRow['Name'].', '); 13 13 14 $System->Database->insert('Product', array('Name' => $DbRow['Name'], 'SellPrice' => $DbRow['Price'],15 ' BuyPrice' => $DbRow['Price'],14 $System->Database->insert('Product', array('Name' => $DbRow['Name'], 15 'SellPrice' => $DbRow['Price'], 'BuyPrice' => $DbRow['Price'], 16 16 'Consumption' => $DbRow['Consumption'], 'UnitOfMeasure' => 1, 'VAT' => 20)); 17 17 $ProductId = $System->Database->insert_id; 18 if($DbRow['Used'] == 1) $Elimination = 'NULL'; 19 else $Elimination = $DbRow['TimeElimination']; 18 20 $Database->insert('StockItem', array('Stock' => 1, 'Product' => $ProductId, 'Amount' => $DbRow['Count'], 19 'Segment' => $DbRow['Segment'], 'TimeEnlistment' => $DbRow['Date'], 'SerialNumber' => $DbRow['DeviceId'], 21 'Segment' => $DbRow['Segment'], 'TimeEnlistment' => $DbRow['Date'], 'TimeElimination' => $Elimination, 22 'SerialNumber' => $DbRow['DeviceId'], 'BuyPrice' => $DbRow['Price'], 'SellPrice' => $DbRow['Price'], 20 23 'Location' => $DbRow['User'], 'Info' => $DbRow['Info'])); 21 24 }
Note:
See TracChangeset
for help on using the changeset viewer.