Changeset 494
- Timestamp:
- Mar 1, 2013, 10:44:18 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Page.php
r493 r494 149 149 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'. 150 150 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">'. 151 '<head><link rel="stylesheet" href="'.$this->System-> Config['Web']['RootFolder'].'/style/'.$this->System->Config['Web']['Style'].'/style.css" type="text/css" media="all" />'.151 '<head><link rel="stylesheet" href="'.$this->System->Link('/style/').$this->System->Config['Web']['Style'].'/style.css" type="text/css" media="all" />'. 152 152 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->System->Config['Web']['Charset'].'" />'. 153 '<script type="text/javascript" src="'.$this->System-> Config['Web']['RootFolder'].'/style/'.$this->System->Config['Web']['Style'].'/global.js"></script>'.153 '<script type="text/javascript" src="'.$this->System->Link('/style/').$this->System->Config['Web']['Style'].'/global.js"></script>'. 154 154 '<title>'.$this->System->Config['Web']['Title'].' - '.$Path.'</title> 155 155 </head><body'.$BodyParam.'> … … 159 159 { 160 160 if($this->System->Modules['User']->User['Id'] == null) 161 $Output .= '<a href="'.$this->System-> Config['Web']['RootFolder'].'/?Action=LoginForm">Přihlášení</a> <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserRegister">Registrace</a>';162 else $Output .= $this->System->Modules['User']->User['Name'].' <a href="'.$this->System-> Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';161 $Output .= '<a href="'.$this->System->Link('/?Action=LoginForm').'">Přihlášení</a> <a href="'.$this->System->Link('/?Action=UserRegister').'">Registrace</a>'; 162 else $Output .= $this->System->Modules['User']->User['Name'].' <a href="'.$this->System->Link('/?Action=Logout').'">Odhlásit</a>'; 163 163 } else $Output .= ' '; 164 164 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; -
trunk/Common/Version.php
r493 r494 1 1 <?php 2 2 3 $Revision = 49 3; // Subversion revision4 $DatabaseRevision = 49 3;3 $Revision = 494; // Subversion revision 4 $DatabaseRevision = 494; 5 5 $ReleaseTime = '2013-03-01'; 6 6 -
trunk/Modules/Portal/Portal.php
r493 r494 169 169 if($_GET['Action'] == 'Logout') 170 170 { 171 $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 171 if($this->System->Modules['User']->User['Id'] != null) 172 { 173 $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 174 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 172 175 } else 173 176 if($_GET['Action'] == 'UserOptions') 174 177 { 175 $UserOptions = new Form('UserOptions'); 176 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 177 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 178 $Output .= $UserOptions->ShowEditForm(); 178 if($this->System->Modules['User']->User['Id'] != null) 179 { 180 $UserOptions = new Form('UserOptions'); 181 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 182 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 183 $Output .= $UserOptions->ShowEditForm(); 184 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 179 185 } else 180 186 if($_GET['Action'] == 'UserOptionsSave') -
trunk/Modules/TV/TV.php
r479 r494 68 68 $Output .= '</div><br/>'; 69 69 70 $Output .= 'Originální informace o televizi: <a href="http://tv.hovnet.czf/">HovNet televize</a><br/>';71 70 $Output .= 'Další online TV na webu: <a href="http://spustit.cz">Spustit.cz</a><br/>'; 72 71 $Output .= 'Další online TV na webu: <a href="http://www.tvinfo.cz/live/televize/evropa/cz">TV info</a><br/>'; -
trunk/admin/FullInstall.php
r493 r494 2336 2336 (40, 'Produkty', 27, 'Product', ''), 2337 2337 (41, 'Sklady', 27, 'Stock', '');"); 2338 $Manager->Execute("INSERT INTO `ServiceCategory` (`Id`, `Name`) VALUES 2339 (1, 'Internet'), 2340 (2, 'VoIP'), 2341 (3, 'Spotřeba + nájem'), 2342 (4, 'IPTV'), 2343 (5, 'IP kamery'), 2344 (6, 'Meteostanice'), 2345 (7, 'Web hosting'), 2346 (8, 'VPS hosting');"); 2347 $Manager->Execute("INSERT INTO `Service` (`Id`, `Name`, `Category`, `Price`, `CustomerCount`, `ReplaceId`, `Public`, `InternetSpeedMin`, `InternetSpeedMax`, `UploadAsymmetry`, `Memory`, `MemorySwap`, `Storage`, `CPUCount`) VALUES 2348 (1, 'Internet 4M', 1, 190, 23, NULL, 1, 4096, 204, 1, 0, 0, 0, 0), 2349 (2, 'Internet 8M', 1, 260, 23, NULL, 1, 8192, 408, 1, 0, 0, 0, 0), 2350 (3, 'Internet 16M', 1, 360, 50, NULL, 1, 16384, 816, 1, 0, 0, 0, 0), 2351 (4, 'Internet 32M', 1, 520, 6, NULL, 1, 32768, 1638, 1, 0, 0, 0, 0), 2352 (5, 'Internet 64M', 1, 750, 0, NULL, 1, 65536, 8196, 1, 0, 0, 0, 0), 2353 (6, 'Internet Instituce', 2, 1000, 1, NULL, 1, 65536, 8192, 1, 0, 0, 0, 0), 2354 (7, 'Zdarma', 3, 0, 12, NULL, 1, 128, 128, 1, 0, 0, 0, 0), 2355 (8, 'Hosting 4GB', 2, 500, 2, NULL, 1, 64000, 4000, 1, 0, 0, 0, 0), 2356 (9, 'Hosting 2GB', 2, 300, 0, NULL, 1, 40000, 2000, 1, 0, 0, 0, 0), 2357 (10, 'Hosting 1GB', 2, 170, 1, NULL, 1, 30000, 2000, 1, 0, 0, 0, 0), 2358 (11, 'Hosting 512M', 2, 100, 0, NULL, 1, 20000, 1500, 1, 0, 0, 0, 0), 2359 (12, 'Hosting 8GB', 2, 900, 1, NULL, 1, 60000, 4000, 1, 0, 0, 0, 0), 2360 (13, 'Hosting 16G', 2, 1500, 0, NULL, 1, 60000, 4000, 1, 0, 0, 0, 0), 2361 (14, 'Hosting 6GB', 2, 700, 0, NULL, 1, 64000, 4000, 1, 0, 0, 0, 0);"); 2362 $Manager->Execute("INSERT INTO `ServiceCustomerRel` (`Id`, `Service`, `Customer`, `Period`) VALUES 2363 (1, 1, 1, 0), (2, 1, 1, 1);"); 2364 $Manager->Execute("INSERT INTO `File` (`Id` ,`Name` ,`Size` ,`Directory`) VALUES (NULL , 'invoice_1.pdf', '123', NULL);"); 2365 $Manager->Execute("INSERT INTO `FinanceInvoice` (`Id` ,`BillCode` ,`Subject` ,`TimeCreation` ,`TimeDue` ,`TimePayment` ,`Value` ,`File` ,`Text` ,`PeriodTo` ,`PeriodFrom`) ". 2366 "VALUES (1 , 'VF123/2013', '1', NOW( ) , '0000-00-00 00:00:00', NULL , '300', '1', 'Měsíční paušál', '2013-01-01', '2013-01-31');"); 2367 $Manager->Execute("INSERT INTO `FinanceInvoiceItem` (`Id` ,`FinanceInvoice` ,`Description` ,`Price` ,`VAT` ,`Quantity`) ". 2368 "VALUES (1 , '1', 'Internet 16M', '300', '21', '1');"); 2369 $Manager->Execute("INSERT INTO `FinanceYear` (`Id`, `Year`, `DateStart`, `DateEnd`) VALUES 2370 (1, 2007, '2007-12-01', '2007-12-31'), 2371 (2, 2008, '2008-01-01', '2008-12-31'), 2372 (3, 2009, '2009-01-01', '2009-12-31'), 2373 (4, 2010, '2010-01-01', '2010-12-31'), 2374 (6, 2011, '2011-01-01', '2011-12-31'), 2375 (7, 2012, '2012-01-01', '2012-12-31'), 2376 (8, 2013, '2013-01-01', '2013-12-31');"); 2377 $Manager->Execute("INSERT INTO `FinanceCharge` (`Period`, `Internet`, `InternetSpeed`, `InternetSpeedReserve`, `AdministrationPerUser`, `kWh`, `BaseSpeedElement`, `BaseTariffPrice`, `TopTariffPrice`) VALUES 2378 (1, 10000, 100000, 10000, 50, 6, 1024, 50, 138), 2379 (0, 10000, 100000, 10000, 50, 6, 1024, 50, 138);"); 2338 2380 } 2339 2381 -
trunk/admin/Updates.php
r493 r494 6 6 } 7 7 8 function UpdateTo494($Manager) 9 { 10 $Manager->Execute("ALTER TABLE `FinanceOperation` DROP FOREIGN KEY `FinanceOperation_ibfk_2` ;\n". 11 "ALTER TABLE `FinanceOperation` CHANGE `Bill` `File` INT( 11 ) NULL DEFAULT NULL;\n". 12 "ALTER TABLE `FinanceOperation` ADD FOREIGN KEY ( `File` ) REFERENCES `File` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 13 } 14 15 16 8 17 $Updates = array( 9 18 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), 19 493 => array('Revision' => 494, 'Function' => 'UpdateTo494'), 10 20 ); 11 21 -
trunk/finance/finance.php
r486 r494 59 59 $Tariffs['CustomerCount'] = $Row[0]; 60 60 61 //echo($Tariff['Name'].' '.$Tariff['MemberCount'].' '.$Tariff['SpeedMax'] * $Tariff['MemberCount'].' '.$ResidualSpeed.'<br />');62 61 switch($Tariff['Category']) 63 62 { … … 73 72 } 74 73 } 75 $Aggregation = $ResidualSpeed / $TotalMaxSpeed;76 //echo($TotalMaxSpeed.' '.$Aggregation.'<br />');74 if($TotalMaxSpeed > 0) $Aggregation = $ResidualSpeed / $TotalMaxSpeed; 75 else $Aggregation = 1; 77 76 78 77 // Recalculate price … … 82 81 { 83 82 case 1: 84 // Přepočítávání rychlostí koliduje s rozdílovým zapisováním stromu front do mikrotiku. Vždy při změně počtu počítačů či domácností docházelo ke změně minima a přepočtu všeho. 83 // Přepočítávání rychlostí koliduje s rozdílovým zapisováním stromu front do mikrotiku. 84 // Vždy při změně počtu počítačů či domácností docházelo ke změně minima a přepočtu všeho. 85 85 //$Tariff['InternetSpeedMin'] = round($Tariff['InternetSpeedMax'] * $Aggregation); 86 86 break; … … 90 90 break; 91 91 } 92 //echo('MinSpeed: '.$Tariff['InternetSpeedMin'].'<br />');93 92 $this->Database->update('Service', 'Id='.$Tariff['Id'], 94 93 array('InternetSpeedMin' => ($Tariff['InternetSpeedMin'] / 1024), … … 196 195 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkSegment` WHERE `Id`='.$Id); 197 196 $Device = $DbResult2->fetch_assoc(); 198 //print_r($Device); 199 //echo($Id.': '.$NetworkDevice.', '.$Device['Price'].', '.$Device['Users']."<br/>\n"); 200 $NetworkDevice += $Device['Price'] / $Device['Users']; 201 $Consumption += $Device['Consumption'] / $Device['UsersOverheads']; 202 //echo($ID.' '.$InternetSegment.' '.$InternetSegmentId.' '.$Row['inet_hw'].' '.$Price.'<br>'); 197 if($Device['Users'] > 0) $NetworkDevice += $Device['Price'] / $Device['Users']; 198 if($Device['UsersOverheads'] > 0) $Consumption += $Device['Consumption'] / $Device['UsersOverheads']; 203 199 $Id = $Device['Parent']; 204 200 } … … 210 206 $DbRow = $DbResult2->fetch_assoc(); 211 207 $Monthly = 0; 212 $MonthlyInet = $DbRow['Price']; 208 if($DbRow['Price'] != '') $MonthlyInet = $DbRow['Price']; 209 else $MonthlyInet = 0; 210 213 211 //if($Row['inet'] == 1) 214 212 $Monthly += $MonthlyInet; … … 216 214 $Monthly -= $Member['Hire']; 217 215 //if($Row['overheads'] == 1) $Monthly += $Sprava; // + W2Kc($Consumption); 218 //echo($Row['fullname'].' '.$Row['inet'].' '.$Monthly.'<br>');219 216 $Monthly = round($Monthly); 220 //echo($Row['fullname'].' '.$Row['inet'].' '.$Monthly.'<br>')221 217 222 218 if($Member['BillingPeriodNext'] == 1) … … 246 242 while($NetworkSegment = $DbResult->fetch_array()) 247 243 { 248 //echo('Segment '.$Row['name'].'<br>');249 244 $DbResult2 = $this->Database->query('SELECT `Users` FROM `NetworkSegment` WHERE `Id`='.$NetworkSegment['Id']); 250 245 $RowP = $DbResult2->fetch_array(); … … 262 257 while($ID != 0) 263 258 { 264 //echo($ID.', ');265 259 $DbResult2 = $this->Database->query('SELECT * FROM NetworkSegment WHERE Id='.$ID); 266 260 $Row4 = $DbResult2->fetch_array(); -
trunk/finance/user_state.php
r486 r494 63 63 64 64 // Account state 65 $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill, BillCode, NULL AS PeriodFrom, NULL AS PeriodTo '.65 $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, File, BillCode, NULL AS PeriodFrom, NULL AS PeriodTo '. 66 66 'FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '. 67 67 '(SELECT (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoice=FinanceInvoice.Id) AS Text, '. 68 'TimeCreation as Time, -Value as Value, Bill, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';68 'TimeCreation as Time, -Value as Value, File, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1'; 69 69 $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery); 70 70 $DbRow = $DbResult->fetch_array(); … … 87 87 if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 88 88 if($Row['BillCode'] == '') $Row['BillCode'] = 'PDF'; 89 if($Row[' Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">'.$Row['BillCode'].'</a>';89 if($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/FileDownload.php?Id='.$Row['File']).'">'.$Row['BillCode'].'</a>'; 90 90 else $Invoice = ' '; 91 91 if($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']); -
trunk/sql/updates/486.sql
r486 r494 37 37 ALTER TABLE `FinanceInvoice` CHANGE `TimePayment` `TimePayment` DATETIME NULL DEFAULT NULL ; 38 38 ALTER TABLE `FinanceInvoice` CHANGE `Bill` `File` INT( 11 ) NULL DEFAULT NULL; 39 ALTER TABLE `FinanceInvoice` DROP FOREIGN KEY `FinanceInvoice_ibfk_1` ,39 -- ALTER TABLE `FinanceInvoice` DROP FOREIGN KEY `FinanceInvoice_ibfk_1` , 40 40 UPDATE `FinanceInvoice` SET `File` = NULL WHERE `File`=0; 41 41 UPDATE `FinanceInvoice` SET File=NULL WHERE (NOT EXISTS (SELECT `Id` FROM `File` WHERE `File`.`Id` = `FinanceInvoice`.`File`));
Note:
See TracChangeset
for help on using the changeset viewer.