Changeset 197 for trunk/includes/global_function.php
- Timestamp:
- Jun 5, 2009, 11:51:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global_function.php
r191 r197 18 18 } 19 19 20 function getmonthyears($Days) { 21 22 $month = floor($Days/30); 23 $year = floor($month/12); 24 $Days = floor($Days - $month*30); 25 $month = $month - $year*12; 26 27 return $year.'r '.$month.'m '.$Days.'d'; 20 function getmonthyears($Days) 21 { 22 $month = floor($Days / 30); 23 $year = floor($month / 12); 24 $Days = floor($Days - $month * 30); 25 $month = $month - $year * 12; 26 return($year.'r '.$month.'m '.$Days.'d'); 28 27 } 29 28 … … 86 85 function WriteLanguages($Selected) 87 86 { 88 echo('<select name="Language">'); 89 echo('<option value="1"'); if ($Selected == '1') echo(' selected="selected"'); echo('>Českého jazyka</option>'); 90 echo('<option value="2"'); if ($Selected == '2') echo(' selected="selected"'); echo('>Slovenského jazyka</option>'); 91 echo('<option value="3"'); if ($Selected == '3') echo(' selected="selected"'); echo('>Jiného jazyka</option>'); 92 echo('</select>'); 87 global $LanguageList; 88 89 echo('<select name="Language">'); 90 foreach($LanguageList as $Language) 91 if($Language['Enabled'] == 1) 92 { 93 echo('<option value="'.$Language['Id'].'"'); 94 if($Selected == $Language['Id']) echo(' selected="selected"'); echo('>'.$Language['Name'].'</option>'); 95 } 96 echo('</select>'); 93 97 } 94 98 95 99 function WriteLanguagesWithoutSel($Selected) 96 100 { 97 if($Selected == '0') echo('Původní verze jazyka'); 98 if($Selected == '1') echo('Českého jazyka'); 99 if($Selected == '2') echo('Slovenského jazyka'); 100 if($Selected == '3') echo('Jiného jazyka'); 101 global $LanguageList; 102 103 foreach($LanguageList as $Language) 104 { 105 if($Selected == $Language['Id']) echo($Language['Name']); 106 } 101 107 } 102 108 … … 130 136 } 131 137 138 function GetLanguageList() 139 { 140 global $Database; 141 142 $Result = array(); 143 $DbResult = $Database->SQLCommand('SELECT * FROM `language`'); 144 while($DbRow = mysql_fetch_assoc($DbResult)) 145 $Result[$DbRow['Id']] = $DbRow; 146 return($Result); 147 } 148 132 149 function GetTranslationTree() 133 150 { … … 138 155 while($DbRow = mysql_fetch_assoc($DbResult)) 139 156 { 140 $DbRow['Items'] = array();141 $Result[$DbRow['Id']] = $DbRow;157 $DbRow['Items'] = array(); 158 $Result[$DbRow['Id']] = $DbRow; 142 159 } 143 160 $DbResult = $Database->SQLCommand('SELECT * FROM `group_item`'); 144 161 while($DbRow = mysql_fetch_assoc($DbResult)) 145 162 { 146 $Result[$DbRow['Group']]['Items'][] = $DbRow;163 $Result[$DbRow['Group']]['Items'][] = $DbRow; 147 164 } 148 165 return($Result); … … 192 209 } 193 210 194 function FollowingTran($TextID, $Table,$GroupId, $Prev = false) {195 211 function FollowingTran($TextID, $Table, $GroupId, $Prev = false) 212 { 196 213 global $Database; 197 214 … … 205 222 206 223 $Next = mysql_fetch_array($Database->SQLCommand($sql)); 207 if( !$Next) {} else224 if($Next) 208 225 { 209 226 if($Prev) echo('<a href="form.php?group='.$GroupId.'&ID='.$Next['ID'].'">Předcházející '.$Next['ID'].'</a> ');
Note:
See TracChangeset
for help on using the changeset viewer.