43,18 → 43,17 |
// Получение и отображение списка дистрибутивов |
function showDistributionList($name, $info = "", $format = 'html') { |
$query = "SELECT * FROM ".$this->prefix."distribution ORDER BY dist_id ASC"; |
$rq =& $this->db->query($query); |
switch ($format) { |
case 'html': |
$show = "<label for='".$name."'>".$info."</label> <select id='".$name."' name='".$name."'>\n"; |
$rq =& $this->db->query($query); |
$show = "<fieldset><legend>".$info."</legend>\n<select id='".$name."' name='".$name."'>\n"; |
while ($rq->fetchInto($element)) { |
$show .= "<option value='".$this->secure->checkInt($element["dist_id"])."'>".$this->secure->checkStr($element["distname"],1)."</option>\n"; |
} |
$show .= "</select>"; |
$show .= "</select></fieldset>"; |
break; |
case 'json': |
$show = '[{value:"",text:"'.$info.'"}'; |
$rq =& $this->db->query($query); |
$show = '[{value:"",text:"'.$info.'"}'; |
while ($rq->fetchInto($element)) { |
$show .= ',{value:"'.$this->secure->checkInt($element["dist_id"]).'",text:"'.$this->secure->checkStr($element["distname"],1).'"}'; |
} |
85,18 → 84,17 |
function showDistVersionsList($name, $distID, $format = 'html') { |
$distname = $this->getDistName($distID); |
$query = "SELECT * FROM ".$this->prefix."version WHERE dist_id='".$this->secure->checkInt($distID)."' ORDER BY version ASC"; |
$rq =& $this->db->query($query); |
switch ($format) { |
case 'html': |
$show = "<label for='".$name."'>Версии ".$distname["DistName"]."</label> <select id='".$name."' name='".$name."'>\n"; |
$rq =& $this->db->query($query); |
$show = "<fieldset><legend>Версии ".$distname["DistName"]."</legend>\n<select id='".$name."' name='".$name."'>\n"; |
while ($rq->fetchInto($element)) { |
$show .= "<option value='".$this->secure->checkInt($element["version_id"])."'>".$this->secure->checkStr($element["version"],1)." ".$this->secure->checkStr($element["vname"],1)."</option>\n"; |
} |
$show .= "</select>"; |
$show .= "</select></fieldset>"; |
break; |
case 'json': |
$show = '[{value:"",text:"Выбери версию '.$distname["DistName"].'"}'; |
$rq =& $this->db->query($query); |
$show = '[{value:"",text:"Выбери версию '.$distname["DistName"].'"}'; |
while ($rq->fetchInto($element)) { |
$show .= ',{value:"'.$this->secure->checkInt($element["version_id"]).'",text:"'.$this->secure->checkStr($element["version"],1).' '.$this->secure->checkStr($element["vname"],1).'"}'; |
} |
106,6 → 104,52 |
return $show; |
} |
|
// Получение и отображение списка секций основного (официального) репозитория |
function showBranchesList($version, $format = 'html') { |
$query = "SELECT rtype FROM ".$this->prefix."rtype WHERE rtype_id='1'"; |
$rq =& $this->db->query($query); |
$rq->fetchInto($types); |
$query = "SELECT s.*,t.rtype FROM ".$this->prefix."section s "; |
$query .= "JOIN ".$this->prefix."sect2rep l ON s.sect_id=l.sect_id "; |
$query .= "JOIN ".$this->prefix."repository r ON r.rep_id=l.rep_id "; |
$query .= "JOIN ".$this->prefix."rtype t ON r.rtype_id=t.rtype_id "; |
$query .= "WHERE t.rtype_id='1' AND r.version='".$this->secure->checkInt($version)."'"; |
$rq =& $this->db->query($query); |
switch ($format) { |
case 'html': |
$show = "<fieldset><legend>".$this->secure->checkStr($types["rtype"],1)."</legend>\n"; |
while ($rq->fetchInto($element)) { |
$show .= "<div class='sections'><input type='checkbox' name='section[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["sectname"])." — ".$this->secure->checkStr($element["sectinfo"])."</div>\n"; |
} |
$show .= "</fieldset>\n"; |
break; |
case 'json': |
//TODO Доделать JSON-вывод списка секций основного репозитория |
break; |
} |
} |
|
// Получение и отображение списка репозиториев |
function showRepList($version, $reptype, $format = 'html') { |
$query = "SELECT rtype FROM ".$this->prefix."rtype WHERE rtype_id='1'"; |
$rq =& $this->db->query($query); |
$rq->fetchInto($types); |
$query = "SELECT * FROM ".$this->prefix."repository WHERE version='".$this->secure->checkInt($version)."' AND rtype_id='".$this->secure->checkInt($reptype)."'"; |
$rq =& $this->db->query($query); |
switch ($format) { |
case 'html': |
$show = "<fieldset><legend>".$this->secure->checkStr($types["rtype"],1)."</legend>\n"; |
while ($rq->fetchInto($types)) { |
$show .= "<div class='repository'><input type='checkbox' name='repository[]' value='".$element["rep_id"]."'> ".$this->secure->checkStr($element["repname"])." — ".$this->secure->checkStr($element["repinfo"])."</div>\n"; |
} |
$show .= "</fieldset>\n"; |
break; |
case 'json': |
//TODO Доделать JSON-вывод списка репозиториев |
break; |
} |
} |
|
} |
|
?> |