Changeset 178
- Timestamp:
- Mar 24, 2009, 9:00:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/clenove.php
r167 r178 30 30 $Tarif = $Finance->Tarify[$Row['InternetTariffCurrentMonth']]['name']; 31 31 $PristiTarif = $Finance->Tarify[$Row['InternetTariffNextMonth']]['name']; 32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php? userid='.$Row['Id'].'">'.$Row['Name'].'</a></td>';32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?Subject='.$Row['Id'].'">'.$Row['Name'].'</a></td>'; 33 33 //<td align="right">'.$Row['network_device'].'</td> 34 34 $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td></tr>'; -
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(); -
trunk/global.php
r170 r178 190 190 global $Database; 191 191 192 $DbResult = $Database->query('SELECT Id FROM User WHERE (SELECT user FROM hosts WHERE IP="'.$IP.'") = User.Id'); 193 $DbRow = $DbResult->fetch_assoc(); 194 return($DbRow['Id']); 192 $DbResult = $Database->query('SELECT Id FROM Member WHERE (SELECT user FROM hosts WHERE IP="'.$IP.'") = Member.Id'); 193 if($DbResult->num_rows > 0) 194 { 195 $DbRow = $DbResult->fetch_assoc(); 196 return($DbRow['Id']); 197 } else return(''); 195 198 } 196 199
Note:
See TracChangeset
for help on using the changeset viewer.