Changeset 178 for trunk/finance/user_state.php
- Timestamp:
- Mar 24, 2009, 9:00:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/user_state.php
r167 r178 10 10 function Show() 11 11 { 12 $Finance = &$this->System->Modules['Finance']; 13 $this->System->Modules['Finance']->RecalculateTariffs(1); 14 12 15 if(array_key_exists('old', $_GET)) 13 { 14 $UserId = GetMemberByIP(GetRemoteAddress()); 15 } else 16 if(array_key_exists('userid', $_GET)) 17 { 18 if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 19 $UserId = $_GET['userid']; 20 } else 21 { 22 if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 16 { 17 $MemberId = GetMemberByIP(GetRemoteAddress()); 18 if($MemberId != '') 19 { 20 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Member.Id='.$MemberId.')'); 21 $Subject = $DbResult->fetch_assoc(); 22 } else die('Nemáte oprávnění'); 23 } else 24 if(array_key_exists('Subject', $_GET)) 25 { 26 if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 27 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id='.$_GET['Subject']); 28 $Subject = $DbResult->fetch_assoc(); 29 } else 30 { 31 if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 23 32 $UserId = $this->System->Modules['User']->User['Id']; 24 } 25 26 $Finance = &$this->System->Modules['Finance'];27 $this->System->Modules['Finance']->RecalculateTariffs(1); 33 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$UserId.'))'); 34 $Subject = $DbResult->fetch_assoc(); 35 } 36 28 37 if(!array_key_exists('show', $_GET)) $_GET['show'] = ''; 29 $DbResult = $this->Database->query('SELECT Id FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$UserId.'))'); 30 $Subject = $DbResult->fetch_assoc(); 31 $DbResult = $this->Database->query('SELECT * FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Id=(SELECT Member FROM User WHERE User.Id='.$UserId.')'); 38 $DbResult = $this->Database->query('SELECT * FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Id='.$Subject['Id']); 32 39 $Member = $DbResult->fetch_assoc(); 33 40 $TarifName = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]['name']; 34 $TarifPrice = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]['price'];41 $TarifPrice = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]['price']; 35 42 $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">'; 36 43 37 44 // Tabulka operaci 38 $DbResult = $this->Database->query('SELECT CONCAT(SecondName, " ", FirstName) as Name FROM User WHERE Id='.$UserId); 39 $User = $DbResult->fetch_assoc(); 40 $Output .= 'Výpis operací pro účastníka '.$User['Name'].':<br>'; 45 $Output .= 'Výpis operací pro subjekt '.$Subject['Name'].':<br>'; 41 46 $Output .= '<table style="font-size: smaller;" class="WideTable"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>'; 42 47 $Operations = array();
Note:
See TracChangeset
for help on using the changeset viewer.