Changeset 4 for www/finance/zarizeni.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/finance/zarizeni.php
r1 r4 1 <? 1 <?php 2 include_once('../global.php'); 2 3 include('../style.php'); 3 include('../db.php'); 4 //include('../is/global.php'); 5 DB_Init('localhost','root','','is'); 6 DB_Query('SET CHARACTER SET latin2'); 7 ShowHeader('Zaøízení sítì','Zaøízení'); 4 ShowHeader('Zařízení sítě','Zařízení'); 8 5 9 // Seznam segment ù a zaøízení10 echo('Seznam segment ù a zaøízení:<br><table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Název</th><th>Spotøeba<br>[W]</th><th>Datum<br>zakoupení</th><th>Cena [Kè]</th></tr>');11 DB_Query("SELECT * FROM network_segments");12 while($Row = DB_Row())6 // Seznam segmentů a zařízení 7 echo('Seznam segmentů a zařízení:<br><table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Název</th><th>Spotřeba<br>[W]</th><th>Datum<br>zakoupení</th><th>Cena [Kč]</th></tr>'); 8 $DbResult = $Database->query("SELECT * FROM network_segments"); 9 while($Row = $DbResult->fetch_array()) 13 10 { 14 11 echo('<tr><td colspan="3"><strong>Segment: '.$Row['name'].' ('.$Row['users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Row['price'].'</td></tr>'); 15 DB_Save(); 16 DB_Query("SELECT * FROM network_devices WHERE segment=".$Row['id']." AND used=1"); 17 while($Row = DB_Row()) 12 $DbResult2 = $Database->query("SELECT * FROM network_devices WHERE segment=".$Row['id']." AND used=1"); 13 while($Row = $DbResult2->fetch_array()) 18 14 { 19 15 echo('<tr><td>'.$Row['name'].'</td><td align="right">'.$Row['consumption'].'</td><td align="right">'.HumanDate($Row['date']).'</td><td align="right">'.$Row['price'].'</td></tr>'); 20 16 } 21 DB_Load();22 17 } 23 DB_Query("SELECT SUM(price) FROM network_devices WHERE used=1");24 $Row = DB_Row();18 $DbResult = $Database->query("SELECT SUM(price) FROM network_devices WHERE used=1"); 19 $Row = $DbResult->fetch_array(); 25 20 echo('<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>'); 26 21 echo('</table>');
Note:
See TracChangeset
for help on using the changeset viewer.