|
15 | 15 | ...action=1&lang=[langid] ... Language menu |
16 | 16 | ...action=2&lang=[langid] ... Texts in a language |
17 | 17 | ...action=3&lang=[langid]&text=[textid] ... Sentences of a text |
| 18 | + ...action=4&lang=[langid]&text=[textid]&sent=[sentid] ... Words of a sentence |
18 | 19 | LWT Mobile |
19 | 20 | ***************************************************************/ |
20 | 21 |
|
|
95 | 96 |
|
96 | 97 | ?> |
97 | 98 |
|
98 | | - <ul id="<?php echo $action . '-' . $_REQUEST["text"]; ?>" title="<?php echo tohtml($texttitle); ?>"> |
| 99 | + <ul id="<?php echo $action . '-' . $text; ?>" title="<?php echo tohtml($texttitle); ?>"> |
| 100 | + <li class="group">Title</li> |
| 101 | + <li><?php echo tohtml($texttitle); ?></li> |
99 | 102 |
|
100 | 103 | <?php |
101 | 104 |
|
|
118 | 121 |
|
119 | 122 | while ($record = mysql_fetch_assoc($res)) { |
120 | 123 | if (trim($record["SeText"]) != '¶') |
121 | | - echo '<li><a href="mobile.php#notyetimpl">' . |
| 124 | + echo '<li><a href="mobile.php?action=4&lang=' . |
| 125 | + $lang . '&text=' . $text . |
| 126 | + '&sent=' . $record["SeID"] . '">' . |
122 | 127 | tohtml($record["SeText"]) . '</a></li>'; |
123 | 128 | } |
124 | 129 |
|
|
134 | 139 |
|
135 | 140 | /* -------------------------------------------------------- */ |
136 | 141 |
|
| 142 | + elseif ($action == 4) { |
| 143 | + |
| 144 | + $lang = $_REQUEST["lang"]; |
| 145 | + $text = $_REQUEST["text"]; |
| 146 | + $sent = $_REQUEST["sent"]; |
| 147 | + $senttext = get_first_value('select SeText as value from sentences where SeID = ' . $sent); |
| 148 | + $sql = 'select TiWordCount as Code, TiText, TiOrder, TiIsNotWord, WoID, WoTranslation, WoRomanization, WoStatus from (textitems left join words on (TiTextLC = WoTextLC) and (TiLgID = WoLgID)) where TiSeID = ' . $sent . ' and (not (TiWordCount > 1 and WoID is null)) order by TiOrder asc, TiWordCount desc'; |
| 149 | + $res = mysql_query($sql); |
| 150 | + if ($res == FALSE) die("Invalid Query: $sql"); |
| 151 | + |
| 152 | + ?> |
| 153 | + |
| 154 | + <ul id="<?php echo $action . '-' . $sent; ?>" title="<?php echo tohtml($senttext); ?>"> |
| 155 | + <li class="group">Sentence</li> |
| 156 | + <li><?php echo tohtml($senttext); ?></li> |
| 157 | + <li class="group">Words</li> |
| 158 | + |
| 159 | + <?php |
| 160 | + |
| 161 | + $saveterm = ''; |
| 162 | + $savetrans = ''; |
| 163 | + $saverom = ''; |
| 164 | + $savestat = ''; |
| 165 | + $until = 0; |
| 166 | + while ($record = mysql_fetch_assoc($res)) { |
| 167 | + $actcode = $record['Code'] + 0; |
| 168 | + $order = $record['TiOrder'] + 0; |
| 169 | + |
| 170 | + if ( $order <= $until ) { |
| 171 | + continue; |
| 172 | + } |
| 173 | + if ( $order > $until ) { |
| 174 | + if (trim($saveterm) != '') { |
| 175 | + $desc = trim(($saverom != '' ? '[' . $saverom . '] ' : '') . $savetrans); |
| 176 | + echo '<li><span class="status' . $savestat . '">' . tohtml($saveterm) . '</span>' . |
| 177 | + tohtml($desc != '' ? ' → ' . $desc : '') . '</li>'; |
| 178 | + } |
| 179 | + $saveterm = ''; |
| 180 | + $savetrans = ''; |
| 181 | + $saverom = ''; |
| 182 | + $savestat = ''; |
| 183 | + $until = $order; |
| 184 | + } |
| 185 | + if ($record['TiIsNotWord'] != 0 && trim($record['TiText']) != '') { |
| 186 | + echo '<li>' . tohtml($record['TiText']) . '</li>'; |
| 187 | + } |
| 188 | + else { |
| 189 | + $until = $order + 2 * ($actcode-1); |
| 190 | + $saveterm = $record['TiText']; |
| 191 | + $savetrans = ''; |
| 192 | + if(isset($record['WoID'])) { |
| 193 | + $savetrans = $record['WoTranslation']; |
| 194 | + if ($savetrans == '*') $savetrans = ''; |
| 195 | + } |
| 196 | + $saverom = trim(isset($record['WoRomanization']) ? |
| 197 | + $record['WoRomanization'] : ""); |
| 198 | + $savestat = $record['WoStatus']; |
| 199 | + } |
| 200 | + } |
| 201 | + mysql_free_result($res); |
| 202 | + if (trim($saveterm) != '') { |
| 203 | + $desc = trim(($saverom != '' ? '[' . $saverom . '] ' : '') . $savetrans); |
| 204 | + echo '<li><span class="status' . $savestat . '">' . tohtml($saveterm) . '</span>' . |
| 205 | + tohtml($desc != '' ? ' → ' . $desc : '') . '</li>'; |
| 206 | + } |
| 207 | + |
| 208 | + ?> |
| 209 | + |
| 210 | + </ul> |
| 211 | + |
| 212 | + <?php |
| 213 | + |
| 214 | + mysql_free_result($res); |
| 215 | + |
| 216 | + } // $action == 4 |
| 217 | + |
| 218 | + /* -------------------------------------------------------- */ |
| 219 | + |
137 | 220 | } // isset($_REQUEST["action"]) |
138 | 221 |
|
139 | 222 | /**************************************************************/ |
|
156 | 239 | <meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
157 | 240 | <style type="text/css" media="screen"> |
158 | 241 | @import "./iui/iui.css"; |
| 242 | +span.status1 { |
| 243 | + background-color: #F5B8A9; |
| 244 | +} |
| 245 | +span.status2 { |
| 246 | + background-color: #F5CCA9; |
| 247 | +} |
| 248 | +span.status3 { |
| 249 | + background-color: #F5E1A9; |
| 250 | +} |
| 251 | +span.status4 { |
| 252 | + background-color: #F5F3A9; |
| 253 | +} |
| 254 | +span.status5 { |
| 255 | + background-color: #DDFFDD; |
| 256 | +} |
159 | 257 | </style> |
160 | 258 | <script type="text/javascript" src="./iui/iui.js" charset="utf-8"></script> |
161 | 259 | </head> |
|
0 commit comments