Changeset 183 for trunk/index.php
- Timestamp:
- Mar 26, 2009, 8:51:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r168 r183 142 142 { 143 143 $Output = '<div class="PanelTitle">Nabídka uživatele:</div>'. 144 '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení účtu</a><br />'; 144 '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení uživatele</a><br />'; 145 if($this->System->Modules['User']->CheckPermission('Finance', 'MemberOptions')) 146 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Nastavení domácnosti</a><br />'; 145 147 if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) 146 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/user_state.php">Stav financí</a><br />';148 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/user_state.php">Stav financí</a><br />'; 147 149 if($this->System->Modules['User']->CheckPermission('Network', 'RegistredHostList')) 148 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/user_hosts.php">Registrované počítače</a><br />';150 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/user_hosts.php">Registrované počítače</a><br />'; 149 151 if($this->System->Modules['User']->CheckPermission('News', 'Insert')) 150 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />'; 151 if($this->System->Modules['User']->CheckPermission('EatingPlace', 'Edit')) $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/menuedit.php">Editace jídelníčků</a><br />'; 152 if($this->System->Modules['User']->CheckPermission('Finance', 'Manage')) $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/manage.php">Správa financí</a><br />'; 153 if($this->System->Modules['User']->CheckPermission('Network', 'Administration')) $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/is/administration_page.php">Správa sítě</a><br />'; 152 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />'; 153 if($this->System->Modules['User']->CheckPermission('EatingPlace', 'Edit')) 154 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/menuedit.php">Editace jídelníčků</a><br />'; 155 if($this->System->Modules['User']->CheckPermission('Finance', 'Manage')) 156 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/manage.php">Správa financí</a><br />'; 157 if($this->System->Modules['User']->CheckPermission('Network', 'Administration')) 158 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/is/administration_page.php">Správa sítě</a><br />'; 154 159 return($Output); 155 160 } … … 262 267 $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.'); 263 268 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 269 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 270 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 271 $Output .= $UserOptions->ShowEditForm(); 264 272 } 265 273 if($_GET['Action'] == 'UserRegister') … … 295 303 $UserRegister->LoadValuesFromForm(); 296 304 $Output .= $this->SystemMessage('Nastavení', $this->System->Modules['User']->Register($UserRegister->Values['Name'], $UserRegister->Values['Password'], $UserRegister->Values['Password2'], $UserRegister->Values['Email'], $UserRegister->Values['FirstName'], $UserRegister->Values['SecondName'])); 305 } else 306 if($_GET['Action'] == 'MemberOptions') 307 { 308 $UserOptions = new Form('MemberOptions'); 309 $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']); 310 $DbRow = $DbResult->fetch_array(); 311 foreach($UserOptions->Definition['Items'] as $Index => $Item) 312 { 313 $UserOptions->Values[$Index] = $DbRow[$Index]; 314 } 315 $UserOptions->OnSubmit = '?Action=MemberOptionsSave'; 316 $Output .= $UserOptions->ShowEditForm(); 317 } else 318 if($_GET['Action'] == 'MemberOptionsSave') 319 { 320 $UserOptions = new Form('MemberOptions'); 321 $UserOptions->LoadValuesFromForm(); 322 if($UserOptions->Values['FamilyMemberCount'] < 0) 323 $UserOptions->Values['FamilyMemberCount'] = 0; 324 if($UserOptions->Values['BillingPeriodNext'] < 2) 325 $UserOptions->Values['BillingPeriodNext'] = 2; 326 327 $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext'])); 328 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Modules['User']->User['Member']); 329 $Member = $DbResult->fetch_assoc(); 330 $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], array('Name' => $UserOptions->Values['Name'], 'AddressStreet' => $UserOptions->Values['AddressStreet'], 'AddressTown' => $UserOptions->Values['AddressTown'], 'AddressPSC' => $UserOptions->Values['AddressPSC'], 'IC' => $UserOptions->Values['IC'], 'DIC' => $UserOptions->Values['DIC'])); 331 $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.'); 332 $this->System->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', $UserOptions->Values['Name']); 333 $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']); 334 $DbRow = $DbResult->fetch_array(); 335 foreach($UserOptions->Definition['Items'] as $Index => $Item) 336 { 337 $UserOptions->Values[$Index] = $DbRow[$Index]; 338 } 339 $UserOptions->OnSubmit = '?Action=MemberOptionsSave'; 340 $Output .= $UserOptions->ShowEditForm(); 297 341 } 298 342 }
Note:
See TracChangeset
for help on using the changeset viewer.