Changeset 427
- Timestamp:
- Oct 10, 2012, 8:46:02 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 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 -
trunk/global.php
r423 r427 413 413 } 414 414 $QueryItems['all'] = '1'; 415 if($PageCount > 1) $Result.= ' <a href="?'.SetQueryStringArray($QueryItems).'">Vše</a>';415 if($PageCount > 1) $Result.= ' <a href="?'.SetQueryStringArray($QueryItems).'">Vše</a>'; 416 416 417 417 $Result = '<div style="text-align: center">'.$Result.'</div>'; … … 470 470 )); 471 471 } 472 472 473 function GetRemoteAddress() 473 474 { -
trunk/index.php
r420 r427 231 231 { 232 232 $UserOptions = new Form('MemberOptions'); 233 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->User['Member']); 234 $DbRow = $DbResult->fetch_array(); 235 foreach($UserOptions->Definition['Items'] as $Index => $Item) 236 { 237 $UserOptions->Values[$Index] = $DbRow[$Index]; 238 } 239 $UserOptions->OnSubmit = '?Action=MemberOptionsSave'; 240 $Output .= $UserOptions->ShowEditForm(); 233 $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->Modules['User']->User['Id']); 234 if($DbResult->num_rows > 0) 235 { 236 $CustomerUserRel = $DbResult->fetch_assoc(); 237 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, '. 238 'Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, '. 239 'Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject '. 240 'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerUserRel['Customer']); 241 $DbRow = $DbResult->fetch_array(); 242 foreach($UserOptions->Definition['Items'] as $Index => $Item) 243 { 244 $UserOptions->Values[$Index] = $DbRow[$Index]; 245 } 246 $UserOptions->OnSubmit = '?Action=MemberOptionsSave'; 247 $Output .= $UserOptions->ShowEditForm(); 248 } else $Output .= $this->SystemMessage('Chyba', 'Nejste zákazníkem'); 241 249 } else 242 250 if($_GET['Action'] == 'MemberOptionsSave')
Note:
See TracChangeset
for help on using the changeset viewer.