Changeset 183
- Timestamp:
- Mar 26, 2009, 8:51:40 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogShow.php
r182 r183 1 1 <?php 2 include_once('global.php'); 2 include('global.php'); 3 include('aktuality/rss_generator.php'); 3 4 4 5 class LogShow extends Page … … 18 19 $Output = '<div align="center"><table class="WideTable" style="font-size: small;">'; 19 20 $Output .= '<tr><th>Čas</th><th>Uživatel</th><th>Modul</th><th>Operace</th><th>Hodnota</th></tr>'; 20 $DbResult = $this->Database->query('SELECT *, `User`.`Name` as UserName FROM `is`.`Log` LEFT JOIN `is`.`User` ON `User`.`Id` = `Log`.`User` ORDER BY Time DESC LIMIT '.$Page * $this->RowPerPage.','.$this->RowPerPage);21 while($DbRow = $DbResult->fetch_a rray())21 $DbResult = $this->Database->query('SELECT Log.*, `User`.`Name` as UserName FROM `Log` LEFT JOIN `User` ON `User`.`Id` = `Log`.`User` ORDER BY Time DESC LIMIT '.$Page * $this->RowPerPage.','.$this->RowPerPage); 22 while($DbRow = $DbResult->fetch_assoc()) 22 23 { 23 24 $Output .= '<tr><td>'.$DbRow['Time'].'</td><td>'.$DbRow['UserName'].'</td><td>'.$DbRow['Module'].'</td><td>'.$DbRow['Operation'].'</td><td>'.$DbRow['Value'].'</td></tr>'; … … 30 31 } 31 32 32 $System->AddModule(new LogShow()); 33 $System->Modules['LogShow']->GetOutput(); 33 if(array_key_exists('Action', $_GET)) 34 { 35 if($_GET['Action'] == 'rss') 36 { 37 $DbResult = $Database->query('SELECT UNIX_TIMESTAMP(Time), Log.*, `User`.`Name` as UserName FROM `Log` LEFT JOIN `User` ON `User`.`Id` = `Log`.`User` ORDER BY Time DESC LIMIT 0, 50'); 38 while($Row = $DbResult->fetch_assoc()) 39 { 40 $Info = $Row['UserName'].': '.$Row['Module'].' '.$Row['Operation'].' '.$Row['Value']; 41 $Items[] = array 42 ( 43 'Title' => $Info, 44 'Link' => 'http://'.$Config['Web']['Host'].'/', 45 'Description' => $Info, 46 'Time' => $Row['UNIX_TIMESTAMP(Time)'], 47 ); 48 } 49 echo(GenerateRSS(array( 50 'Title' => $Config['Web']['Title'].' - Záznamy operací', 51 'Link' => 'http://'.$Config['Web']['Host'].'/', 52 'Description' => 'Záznamy operací', 53 'WebmasterEmail' => $Config['Web']['AdminEmail'], 54 'Items' => $Items))); 55 } else 56 { 57 $System->AddModule(new LogShow()); 58 $System->Modules['LogShow']->GetOutput(); 59 } 60 } else 61 { 62 $System->AddModule(new LogShow()); 63 $System->Modules['LogShow']->GetOutput(); 64 } 34 65 35 66 ?> -
trunk/aktuality/index.php
r151 r183 31 31 { 32 32 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id);33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id); 34 34 if($DbResult->num_rows > 0) 35 35 { 36 36 $Row = $DbResult->fetch_array(); 37 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Row['Name'].$Row['author'].')</strong>'; 37 if($Row['Nick'] == '') $Author = $Row['author']; 38 else $Author = $Row['Nick']; 39 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Author.')</strong>'; 38 40 if($this->System->Modules['User']->User['Id'] == $Row['User']) 39 41 { … … 56 58 break; 57 59 case 'add': 58 59 60 60 $Output .= '<strong>Vložení nové aktuality:</strong><br />'; 61 if($Category == 2) $Output .= 'U inzerátů uvádějte co nejvíce informací ať případný zájemce ví co kupuje. Uvádějte kontaktní údaje jako Jméno, email, tel. číslo, ICQ. Dále navrženou cenu, detajlní popis předmětu nejlépe s odkazem na stránky výrobce. Pokud váš inzerát již není platný, připište do něj např. "Prodáno" pomocí editace.'; 62 $Output .= '<form enctype="multipart/form-data" action="?action=add2" method="post">'. 61 63 'Kategorie: <select name="category">'; 62 $DbResult = $this->Database->select('news_category', '*');63 while($DbRow = $DbResult->fetch_array())64 {65 if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['id']))66 {67 if($DbRow['id'] == $Category) $Selected = ' selected="1"'; else $Selected = '';68 $Output .= '<option value="'.$DbRow['id'].'"'.$Selected.'>'.$DbRow['caption'].'</option>';69 }70 }71 $Output .= '</select><br />'.64 $DbResult = $this->Database->select('news_category', '*'); 65 while($DbRow = $DbResult->fetch_array()) 66 { 67 if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['id'])) 68 { 69 if($DbRow['id'] == $Category) $Selected = ' selected="1"'; else $Selected = ''; 70 $Output .= '<option value="'.$DbRow['id'].'"'.$Selected.'>'.$DbRow['caption'].'</option>'; 71 } 72 } 73 $Output .= '</select><br />'. 72 74 'Nadpis:<br /><input type="text" size="54" name="title"><br /> 73 75 Obsah:<br /><textarea name="content" rows="20" cols="40"></textarea><br /> … … 103 105 104 106 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 105 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, ' User' => $this->System->Modules['User']->User['Id']));107 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['Nick'], 'User' => $this->System->Modules['User']->User['Id'])); 106 108 $Output .= 'Aktualita přidána!<br />Pokud budete chtít vaši aktualitu smazat, klikněte na odkaz Smazat v seznamu všech aktualit v kategorii.<br /><br />'; 107 109 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 150 152 $Output .= '<br />Přílohy: '; 151 153 $Enclosures = explode(';', $Row['enclosure']); 152 foreach($Enclosures as $Enclosure)153 {154 if(file_exists($this->UploadedFilesFolder.$Enclosure)) unlink($this->UploadedFilesFolder.$Enclosure);155 }154 foreach($Enclosures as $Enclosure) 155 { 156 if(file_exists($this->UploadedFilesFolder.$Enclosure)) unlink($this->UploadedFilesFolder.$Enclosure); 157 } 156 158 } 157 159 $this->Database->query('DELETE FROM news WHERE id='.$_GET['id']); … … 171 173 172 174 //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />'); 173 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);175 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage); 174 176 while($Row = $DbResult->fetch_array()) 175 177 { 176 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Row['Name'].$Row['author'].')</strong>'; 178 if($Row['Nick'] == '') $Author = $Row['author']; 179 else $Author = $Row['Nick']; 180 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Author.')</strong>'; 177 181 if($this->System->Modules['User']->User['Id'] == $Row['User']) 178 182 { … … 185 189 $Output .= '<br />Přílohy: '; 186 190 $Enclosures = explode(';', $Row['enclosure']); 187 foreach($Enclosures as $Enclosure)191 foreach($Enclosures as $Enclosure) 188 192 { 189 190 }193 if(file_exists($this->UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 194 } 191 195 } 192 196 $Output .= '</div>'; -
trunk/aktuality/news.php
r155 r183 27 27 $Output .= '<a href="aktuality/index.php?action=add&category='.$Category.'">Přidat aktualitu</a> '; 28 28 $Output .= '</td></tr><tr><td colspan="2">'; 29 $DbResult = $Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);29 $DbResult = $Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount); 30 30 //echo($Database->error.'<br />'); 31 31 //echo($Database->LastQuery.'<br />'); … … 38 38 while($Row = $DbResult->fetch_array()) 39 39 { 40 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row['id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Row['Name'].$Row['author'].' ('.HumanDate($Row['date']).')</td></tr></table>'; 40 if($Row['Nick'] == '') $Author = $Row['author']; 41 else $Author = $Row['Nick']; 42 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row['id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['date']).')</td></tr></table>'; 41 43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content']; 42 44 … … 45 47 $Output .= '<br />Přílohy: '; 46 48 $Enclosures = explode(';', $Row['enclosure']); 47 foreach($Enclosures as $Enclosure)48 {49 if(file_exists($UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>';50 }49 foreach($Enclosures as $Enclosure) 50 { 51 if(file_exists($UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 52 } 51 53 } 52 53 $Output .= '</div></td></tr>'; 54 $Index = $Index + 1; 55 $FontSize = $FontSize - 1; 56 } 57 $Output .= '</table>'; 54 $Output .= '</div></td></tr>'; 55 $Index = $Index + 1; 56 $FontSize = $FontSize - 1; 57 } 58 $Output .= '</table>'; 58 59 } 59 60 $Output .= '</td></tr></table>'."\n\n"; -
trunk/aktuality/rss.php
r151 r183 88 88 89 89 echo(GenerateRSS(array( 90 'Title' => 'ZděchovNET- Aktuality',91 'Link' => 'http:// centrala.zdechov.net/',90 'Title' => $Config['Web']['Title'].' - Aktuality', 91 'Link' => 'http://'.$Config['Web']['Host'].'/', 92 92 'Description' => 'Aktuality komunitní počítačové sítě ZděchovNET', 93 'WebmasterEmail' => 'robie@centrum.cz',93 'WebmasterEmail' => $Config['Web']['AdminEmail'], 94 94 'Items' => $Items))); 95 95 ?> -
trunk/aktuality/rss_generator.php
r151 r183 1 1 <?php 2 3 include_once('../global.php');4 2 5 3 function GenerateRSS($Data) -
trunk/form_classes.php
r181 r183 54 54 'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 55 55 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 56 'Nick' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 56 57 'FirstName' => array('Type' => 'String', 'Caption' => 'Křestní jméno', 'Default' => ''), 57 58 'SecondName' => array('Type' => 'String', 'Caption' => 'Přijmení jméno', 'Default' => ''), … … 71 72 'FirstName' => array('Type' => 'String', 'Caption' => 'Křestní jméno', 'Default' => ''), 72 73 'SecondName' => array('Type' => 'String', 'Caption' => 'Přijmení jméno', 'Default' => ''), 74 ), 75 ), 76 'MemberOptions' => array( 77 'Title' => 'Nastavení domácnosti', 78 'Table' => '(SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)', 79 'Items' => array( 80 'Name' => array('Type' => 'String', 'Caption' => 'Fakturační jméno', 'Default' => ''), 81 'AddressStreet' => array('Type' => 'String', 'Caption' => 'Ulice', 'Default' => 'Zděchov'), 82 'AddressTown' => array('Type' => 'String', 'Caption' => 'Město', 'Default' => 'Zděchov'), 83 'AddressPSC' => array('Type' => 'String', 'Caption' => 'PSČ', 'Default' => '75607'), 84 'IC' => array('Type' => 'String', 'Caption' => 'IČ', 'Default' => ''), 85 'DIC' => array('Type' => 'String', 'Caption' => 'DIČ', 'Default' => ''), 86 'FamilyMemberCount' => array('Type' => 'Integer', 'Caption' => 'Počet osob v domácnosti', 'Default' => ''), 87 'BillingPeriodNext' => array('Type' => 'TFinanceBillingPeriod', 'Caption' => 'Požadované fakturované období', 'Default' => ''), 88 'InternetTariffNextMonth' => array('Type' => 'TFinanceTariff', 'Caption' => 'Tarif internetu od dalšího období', 'Default' => 2), 73 89 ), 74 90 ), … … 120 136 'States' => array('Zakoupeno', 'Prodáno', 'Zařazeno do použití', 'Vyřazeno z použití', 'Zasláno do reklamace', 'Přijato z reklamace'), 121 137 ), 138 'TFinanceTariff' => array( 139 'Type' => 'Enumeration', 140 'States' => array(6 => 'Zdarma', 0 => 'Pomalejší', 1 => 'Pomalý', 2 => 'Střední', 3 => 'Rychlý', 4 => 'Rychlejší'), 141 ), 142 'TFinanceBillingPeriod' => array( 143 'Type' => 'Enumeration', 144 'States' => array(2 => 'Měsíčně', 3 => 'Čtvrtletně', 4 => 'Pololetně', 5 => 'Ročně'), 145 ), 122 146 'TFinanceSubject' => array( 123 147 'Type' => 'Reference', -
trunk/forms.php
r179 r183 80 80 $Edit = '<select name="'.$Context.$Index.'">'; 81 81 foreach($FormTypes[$Item['Type']]['States'] as $StateIndex => $StateName) 82 $Edit .= '<option value="'.$StateIndex.'">'.$StateName.'</option>'; 82 { 83 if($this->Values[$Index] == $StateIndex) $Selected = 'selected="selected"'; 84 else $Selected = ''; 85 $Edit .= '<option value="'.$StateIndex.'"'.$Selected.'>'.$StateName.'</option>'; 86 } 83 87 $Edit .= '</select>'; 84 88 break; … … 106 110 global $Database; 107 111 108 $DbResult = $Database->query('SELECT * FROM '.$this->Definition['Table'].' WHEREId='.$Id);112 $DbResult = $Database->query('SELECT T.* FROM '.$this->Definition['Table'].' AS T WHERE T.Id='.$Id); 109 113 $DbRow = $DbResult->fetch_array(); 110 114 foreach($this->Definition['Items'] as $Index => $Item) -
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 } -
trunk/page.php
r167 r183 152 152 if($this->System->Modules['User']->User['Id'] == $this->System->Modules['User']->AnonymousUserId) 153 153 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=LoginForm">Přihlášení</a> <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserRegister">Registrace</a>'; 154 else $Output .= $this->System->Modules['User']->User['N ame'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';154 else $Output .= $this->System->Modules['User']->User['Nick'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>'; 155 155 } else $Output .= ' '; 156 156 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>';
Note:
See TracChangeset
for help on using the changeset viewer.