Редакция 7 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 7 | Редакция 8 | ||
---|---|---|---|
Строка 139... | Строка 139... | ||
139 | }
|
139 | }
|
140 | $display .= "</ul>"; |
140 | $display .= "</ul>"; |
141 | break; |
141 | break; |
142 | case '1': |
142 | case '1': |
143 | // Список доступных репозиториев для конкретной версии дистрибутива
|
143 | // Список доступных репозиториев для конкретной версии дистрибутива
|
144 | $reps =& $db->query("SELECT * FROM repository r JOIN ver2rep a ON a.rep_id=r.rep_id JOIN rtype t ON r.reptype=t.rtype_id WHERE a.ver_id='$uid'"); |
144 | $reps =& $db->query("SELECT * FROM repository r JOIN ver2rep a ON a.rep_id=r.rep_id WHERE a.ver_id='$uid'"); |
145 | $display = "Доступные репозитории для выбранного дистрибутива: <ul id='replist'>"; |
145 | $display = "Доступные репозитории для выбранного дистрибутива: <ul id='replist'>"; |
146 | if ($reps->numRows()>0) { |
146 | if ($reps->numRows()>0) { |
147 | while ($reps->fetchInto($info, DB_FETCHMODE_ASSOC)) { |
147 | while ($reps->fetchInto($info, DB_FETCHMODE_ASSOC)) { |
148 | $display .= "<li>[<a href='./admin.php?mode=3&action=3&uid=".$info["rep_id"]."' class='edit'>править</a>][<a href='./admin.php?mode=3&action=4&uid=".$info["rep_id"]."' class='delete'>удалить</a>] ".stripslashes($info["repname"])." (".stripslashes($info["rtype"]).") — ".stripslashes($info["repdescribe"])."</li>"; |
148 | $display .= "<li>[<a href='./admin.php?mode=3&action=3&uid=".$info["rep_id"]."' class='edit'>править</a>][<a href='./admin.php?mode=3&action=4&uid=".$info["rep_id"]."' class='delete'>удалить</a>] ".stripslashes($info["repname"])." — ".stripslashes($info["repdescribe"])."</li>"; |
149 | }
|
149 | }
|
150 | }
|
150 | }
|
151 | $display .= "</ul><p><a href='./admin.php?mode=3&action=2&uid=".$uid."'>Добавить новый репозиторий</a></p>"; |
151 | $display .= "</ul><p><a href='./admin.php?mode=3&action=2&uid=".$uid."'>Добавить новый репозиторий</a></p>"; |
152 | break; |
152 | break; |
153 | case '2': |
153 | case '2': |
154 | // Новый репозиторий
|
154 | // Новый репозиторий
|
155 | $rep =& $db->query("SELECT * FROM distribution d JOIN version v ON v.dist_id=d.dist_id WHERE v.version_id='$uid'"); |
155 | $rep =& $db->query("SELECT * FROM distribution d JOIN version v ON v.dist_id=d.dist_id WHERE v.version_id='$uid'"); |
156 | $rep->fetchInto($dist, DB_FETCHMODE_ASSOC); |
156 | $rep->fetchInto($dist, DB_FETCHMODE_ASSOC); |
157 | $dist_id = $dist["dist_id"]; |
157 | $dist_id = $dist["dist_id"]; |
158 | $dist_vname = stripslashes($dist["distname"])." ".stripslashes($dist["version"])." “".stripslashes($dist["vname"])."”"; |
158 | $dist_vname = stripslashes($dist["distname"])." ".stripslashes($dist["version"])." “".stripslashes($dist["vname"])."”"; |
159 | $dtype =& $db->query("SELECT * FROM rtype"); |
159 | $dtype =& $db->query("SELECT * FROM scheme"); |
160 | $type = "<select name='repType'>"; |
160 | $type = "<select name='scheme'>"; |
161 | while ($dtype->fetchInto($dtinfo, DB_FETCHMODE_ASSOC)) { |
161 | while ($dtype->fetchInto($dtinfo, DB_FETCHMODE_ASSOC)) { |
162 | $type .= "<option value='".$dtinfo["rtype_id"]."'>".stripslashes($dtinfo["rtype"])."</option>"; |
162 | $type .= "<option value='".$dtinfo["scheme_id"]."'>".stripslashes($dtinfo["scheme"])."</option>"; |
163 | }
|
163 | }
|
164 | $sect =& $db->query("SELECT * FROM section s JOIN sect2dist d ON d.sect_id=s.sect_id WHERE d.dist_id='$dist_id'"); |
164 | $sect =& $db->query("SELECT * FROM section s JOIN sect2dist d ON d.sect_id=s.sect_id WHERE d.dist_id='$dist_id'"); |
165 | $list = ""; |
165 | $list = ""; |
166 | while ($sect->fetchInto($slist, DB_FETCHMODE_ASSOC)) { |
166 | while ($sect->fetchInto($slist, DB_FETCHMODE_ASSOC)) { |
167 | $list .= "<input type='checkbox' name='sect[]' value='".$slist["sect_id"]."'> <span title='".stripslashes($slist["sectinfo"])."'>".stripslashes($slist["sectname"])."</span> "; |
167 | $list .= "<input type='checkbox' name='sect[]' value='".$slist["sect_id"]."'> <span title='".stripslashes($slist["sectinfo"])."'>".stripslashes($slist["sectname"])."</span> "; |
Строка 171... | Строка 171... | ||
171 | $display .= "<form action='./process.php' method='POST'>\n"; |
171 | $display .= "<form action='./process.php' method='POST'>\n"; |
172 | $display .= "<input type='hidden' name='mode' value='7'>\n"; |
172 | $display .= "<input type='hidden' name='mode' value='7'>\n"; |
173 | $display .= "<input type='hidden' name='vers' value='$uid'>\n"; |
173 | $display .= "<input type='hidden' name='vers' value='$uid'>\n"; |
174 | $display .= "Название репозитория (codename): <input type='text' name='repName'><br>\n"; |
174 | $display .= "Название репозитория (codename): <input type='text' name='repName'><br>\n"; |
175 | $display .= "Описание репозитория:<br> <textarea name='repInfo'></textarea><br>\n"; |
175 | $display .= "Описание репозитория:<br> <textarea name='repInfo'></textarea><br>\n"; |
176 | $display .= "Тип репозитория: ".$type."<br>"; |
176 | $display .= "Схема репозитория: ".$type."<br>"; |
177 | $display .= "Секции: ".$list; |
177 | $display .= "Секции: ".$list; |
178 | $display .= "<br><input type='submit' value='Создать'></form>\n"; |
178 | $display .= "<br><input type='submit' value='Создать'></form>\n"; |
179 | break; |
179 | break; |
180 | case '3': |
180 | case '3': |
181 | // Редактирование репозитория
|
181 | // Редактирование репозитория
|
182 | $rep =& $db->query("SELECT * FROM repository WHERE rep_id='$uid'"); |
182 | $rep =& $db->query("SELECT * FROM repository WHERE rep_id='$uid'"); |
183 | $rep->fetchInto($info, DB_FETCHMODE_ASSOC); |
183 | $rep->fetchInto($info, DB_FETCHMODE_ASSOC); |
184 | $tlist = "<select name='repType'>"; |
184 | $tlist = "<select name='scheme'>"; |
185 | $sq =& $db->query("SELECT * FROM rtype"); |
185 | $sq =& $db->query("SELECT * FROM scheme"); |
186 | while ($sq->fetchInto($type, DB_FETCHMODE_ASSOC)) { |
186 | while ($sq->fetchInto($type, DB_FETCHMODE_ASSOC)) { |
187 | if ($type["rtype_id"]==$info["reptype"]) { |
187 | if ($type["scheme_id"]==$info["scheme_id"]) { |
188 | $tlist .= "<option value='".$type["rtype_id"]."' selected>".stripslashes($type["rtype"])."</option>"; |
188 | $tlist .= "<option value='".$type["scheme_id"]."' selected>".stripslashes($type["scheme"])."</option>"; |
189 | } else { |
189 | } else { |
190 | $tlist .= "<option value='".$type["rtype_id"]."'>".stripslashes($type["rtype"])."</option>"; |
190 | $tlist .= "<option value='".$type["scheme_id"]."'>".stripslashes($type["scheme"])."</option>"; |
191 | }
|
191 | }
|
192 | }
|
192 | }
|
193 | $tlist .= "</select>"; |
193 | $tlist .= "</select>"; |
194 | $list = ""; |
194 | $list = ""; |
195 | $req =& $db->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$uid'"); |
195 | $req =& $db->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$uid'"); |
Строка 208... | Строка 208... | ||
208 | $display .= "<form action='./process.php' method='POST'>\n"; |
208 | $display .= "<form action='./process.php' method='POST'>\n"; |
209 | $display .= "<input type='hidden' name='mode' value='8'>\n"; |
209 | $display .= "<input type='hidden' name='mode' value='8'>\n"; |
210 | $display .= "<input type='hidden' name='rep' value='$uid'>\n"; |
210 | $display .= "<input type='hidden' name='rep' value='$uid'>\n"; |
211 | $display .= "Название репозитория (codename): <input type='text' name='repName' value='".stripslashes($info["repname"])."'><br>\n"; |
211 | $display .= "Название репозитория (codename): <input type='text' name='repName' value='".stripslashes($info["repname"])."'><br>\n"; |
212 | $display .= "Описание репозитория:<br> <textarea name='repInfo'>".stripslashes($info["repdescribe"])."</textarea><br>\n"; |
212 | $display .= "Описание репозитория:<br> <textarea name='repInfo'>".stripslashes($info["repdescribe"])."</textarea><br>\n"; |
213 | $display .= "Тип репозитория: ".$tlist."<br>"; |
213 | $display .= "Схема репозитория: ".$tlist."<br>"; |
214 | $display .= "Секции: ".$list; |
214 | $display .= "Секции: ".$list; |
215 | $display .= "<br><input type='submit' value='Править'></form>\n"; |
215 | $display .= "<br><input type='submit' value='Править'></form>\n"; |
216 | break; |
216 | break; |
217 | case '4': |
217 | case '4': |
218 | // Удаление репозитория
|
218 | // Удаление репозитория
|