Changeset 427 for trunk/finance/user_state.php
- Timestamp:
- Oct 10, 2012, 8:46:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/user_state.php
r415 r427 22 22 if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 23 23 $UserId = $this->System->Modules['User']->User['Id']; 24 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Customer FROM UserCustomerRel WHERE User='.$UserId.' LIMIT 1))'); 25 $Subject = $DbResult->fetch_assoc(); 24 $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$UserId.' LIMIT 1'); 25 if($DbResult->num_rows > 0) 26 { 27 $CustomerUserRel = $DbResult->fetch_assoc(); 28 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id='.$CustomerUserRel['Customer'].')'); 29 $Subject = $DbResult->fetch_assoc(); 30 } else return($this->SystemMessage('Chyba', 'Nejste zákazníkem')); 26 31 } 27 32 … … 42 47 $FinanceYearSelected = $DbResult->fetch_assoc(); 43 48 $YearWhere = ' WHERE (Time >= "'.$FinanceYearSelected['DateStart'].'") AND (Time <= "'.$FinanceYearSelected['DateEnd'].'")'; 44 45 49 46 50 47 51 // Year list
Note:
See TracChangeset
for help on using the changeset viewer.