Changeset 873 for trunk/Modules/Portal/Portal.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/Portal.php
r860 r873 60 60 $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '. 61 61 'WHERE (`Action`.`Group`='.$ActionGroup['Id'].') AND (`Action`.`Enable` = 1)'); 62 while ($Action = $DbResult->fetch_assoc())62 while ($Action = $DbResult->fetch_assoc()) 63 63 { 64 64 $Output .= $this->System->ShowAction($Action['Id']).'<br/>'; 65 65 } 66 return ($this->Panel($ActionGroup['Name'], $Output));66 return ($this->Panel($ActionGroup['Name'], $Output)); 67 67 } 68 68 … … 98 98 //$Output .= 'Server běží: '.$this->GetServerUptime().' '; 99 99 100 if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))100 if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 101 101 { 102 102 $DbResult = $this->Database->select('MemberPayment', 'Cash', 'Member=(SELECT Customer FROM UserCustomerRel WHERE Id='.$this->System->User->User['Id'].')'); 103 if ($DbResult->num_rows > 0)103 if ($DbResult->num_rows > 0) 104 104 { 105 105 $DbRow = $DbResult->fetch_assoc(); … … 109 109 110 110 $Output = '<div class="Navigation"><span class="MenuItem">'.$Output.'</span><div class="MenuItem2"> '.$Output2.'</div></div>'; 111 return ($Output);111 return ($Output); 112 112 } 113 113 … … 115 115 { 116 116 $Output = '<a href="'.$this->System->Link('/user/?Action=UserOptions').'">Profil</a><br />'; 117 if ($this->System->User->CheckPermission('Finance', 'MemberOptions'))117 if ($this->System->User->CheckPermission('Finance', 'MemberOptions')) 118 118 $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Fakturační adresa</a><br />'; 119 if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))119 if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 120 120 $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />'; 121 if ($this->System->User->CheckPermission('Network', 'RegistredHostList'))121 if ($this->System->User->CheckPermission('Network', 'RegistredHostList')) 122 122 $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />'; 123 if ($this->System->User->CheckPermission('News', 'Insert'))123 if ($this->System->User->CheckPermission('News', 'Insert')) 124 124 $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />'; 125 if ($this->System->User->CheckPermission('EatingPlace', 'Edit'))125 if ($this->System->User->CheckPermission('EatingPlace', 'Edit')) 126 126 $Output .= '<a href="'.$this->System->Link('/jidelna/menuedit.php').'">Úprava jídelníčků</a><br />'; 127 if ($this->System->User->CheckPermission('Finance', 'Manage'))127 if ($this->System->User->CheckPermission('Finance', 'Manage')) 128 128 $Output .= '<a href="'.$this->System->Link('/finance/sprava/').'">Správa financí</a><br />'; 129 if ($this->System->User->CheckPermission('IS', 'Manage'))129 if ($this->System->User->CheckPermission('IS', 'Manage')) 130 130 $Output .= '<a href="'.$this->System->Link('/is/').'">Správa dat</a><br />'; 131 return ($Output);131 return ($Output); 132 132 } 133 133 … … 135 135 { 136 136 $Output = $this->System->ModuleManager->Modules['WebCam']->ShowImage(); 137 return ($Output);137 return ($Output); 138 138 } 139 139 … … 141 141 { 142 142 $Output = '<a href="https://stat.zdechov.net/meteo/?Measure=28" title="Klikněte pro detailní informace a předpověď"><img src="https://www.zdechov.net/meteo/koliba.png" border="0" alt="Počasí - Meteostanice Zděchov" width="150" height="150" /></a>'; 143 return ($Output);143 return ($Output); 144 144 } 145 145 … … 150 150 'LEFT JOIN `NetworkDeviceType` ON `NetworkDeviceType`.`Id` = `NetworkDevice`.`Type` '. 151 151 'WHERE (`NetworkDeviceType`.`ShowOnline` = 1) AND (`NetworkDevice`.`Online` = 1) ORDER BY `NetworkDevice`.`Name`'); 152 while ($Device = $DbResult->fetch_array())152 while ($Device = $DbResult->fetch_array()) 153 153 { 154 154 $Output .= $Device['Name'].'<br />'; 155 155 } 156 156 $Output .= '</span>'; 157 return ($Output);157 return ($Output); 158 158 } 159 159 … … 162 162 $Output .= '<div class="PanelTitle">Dlužníci:</div><span style="font-size: smaller;">'; 163 163 $DbResult = $Database->select('Subject', 'Name', 'Money < 0 ORDER BY Money'); 164 while ($Row = $DbResult->fetch_array())164 while ($Row = $DbResult->fetch_array()) 165 165 { 166 166 $Output .= $Row['Name'].'<br />'; 167 167 } 168 168 $Output .= '</span>'; 169 return ($Output);169 return ($Output); 170 170 } 171 171 172 172 function Panel($Title, $Content, $Menu = array()) 173 173 { 174 if (count($Menu) > 0)175 foreach ($Menu as $Item)174 if (count($Menu) > 0) 175 foreach ($Menu as $Item) 176 176 $Title .= '<div class="Action">'.$Item.'</div>'; 177 return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>');177 return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>'); 178 178 } 179 179 … … 181 181 { 182 182 $Output = ''; 183 if (array_key_exists('Action', $_GET))183 if (array_key_exists('Action', $_GET)) 184 184 { 185 185 $Action = $_GET['Action']; 186 if ($Action == 'CustomizeNewsSave')186 if ($Action == 'CustomizeNewsSave') 187 187 { 188 188 $Output .= $this->System->ModuleManager->Modules['News']->CustomizeSave(); 189 189 } else 190 if ($Action == 'MemberOptions')190 if ($Action == 'MemberOptions') 191 191 { 192 192 $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` '. 193 193 'WHERE `User`='.$this->System->User->User['Id']); 194 while ($CustomerUserRel = $DbResult->fetch_assoc())194 while ($CustomerUserRel = $DbResult->fetch_assoc()) 195 195 { 196 196 $DbResult2 = $this->Database->query('SELECT `Member`.`Id`, '. … … 202 202 $Form->SetClass('MemberOptions'); 203 203 $DbRow = $DbResult2->fetch_array(); 204 foreach ($Form->Definition['Items'] as $Index => $Item)204 foreach ($Form->Definition['Items'] as $Index => $Item) 205 205 { 206 206 $Form->Values[$Index] = $DbRow[$Index]; … … 210 210 } 211 211 } else 212 if ($Action == 'MemberOptionsSave')212 if ($Action == 'MemberOptionsSave') 213 213 { 214 214 $Form = new Form($this->System->FormManager); 215 215 $Form->SetClass('MemberOptions'); 216 216 $Form->LoadValuesFromForm(); 217 if ($Form->Values['FamilyMemberCount'] < 0)217 if ($Form->Values['FamilyMemberCount'] < 0) 218 218 $Form->Values['FamilyMemberCount'] = 0; 219 219 … … 235 235 'ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->User->User['Member']); 236 236 $DbRow = $DbResult->fetch_array(); 237 foreach ($Form->Definition['Items'] as $Index => $Item)237 foreach ($Form->Definition['Items'] as $Index => $Item) 238 238 { 239 239 $Form->Values[$Index] = $DbRow[$Index]; … … 243 243 } 244 244 } else $Output = $this->ShowMain(); 245 return ($Output);245 return ($Output); 246 246 } 247 247 … … 250 250 $Output = ''; 251 251 $DbResult = $this->Database->query('SELECT * FROM `ActionGroup`'); 252 while ($DbRow = $DbResult->fetch_assoc())252 while ($DbRow = $DbResult->fetch_assoc()) 253 253 $ActionGroups[$DbRow['Id']] = $DbRow; 254 254 255 255 // Show pannels 256 //if (IsInternetAddr()) echo('Internet'); else echo('LAN');256 //if (IsInternetAddr()) echo('Internet'); else echo('LAN'); 257 257 //$Output .= $this->InfoBar(); 258 258 $Output .= '<table id="MainTable"><tr>'; 259 259 $DbResult = $this->Database->select('PanelColumn', '*'); 260 while ($PanelColumn = $DbResult->fetch_assoc())261 { 262 if ($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"';260 while ($PanelColumn = $DbResult->fetch_assoc()) 261 { 262 if ($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"'; 263 263 else $Width = ''; 264 264 $Output .= '<td valign="top"'.$Width.'>'; 265 265 $DbResult2 = $this->Database->query('SELECT * FROM `Panel` WHERE `PanelColumn`='.$PanelColumn['Id'].' ORDER BY `Order`'); 266 while ($Panel = $DbResult2->fetch_assoc())267 { 268 if ($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]);269 else if ($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());270 else if ($Panel['Module'] == 'UserOptions')266 while ($Panel = $DbResult2->fetch_assoc()) 267 { 268 if ($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]); 269 else if ($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList()); 270 else if ($Panel['Module'] == 'UserOptions') 271 271 { 272 //if ($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());272 //if ($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); 273 273 } else 274 if ($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());275 if ($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel());276 else if ($Panel['Module'] == 'NewsGroupList')274 if ($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel()); 275 if ($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel()); 276 else if ($Panel['Module'] == 'NewsGroupList') 277 277 $Output .= $this->Panel('Aktuality', $this->System->ModuleManager->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>')); 278 278 } … … 280 280 } 281 281 $Output .= '</tr></table>'; 282 return ($Output);282 return ($Output); 283 283 } 284 284 }
Note:
See TracChangeset
for help on using the changeset viewer.